openapi: 3.0.1 info: title: Nutanix Virtual Machine Management APIs description: Manage the life-cycle of virtual machines hosted on Nutanix version: 1.0.0 x-logo: altText: Vmm Logo url: https://developers.nutanix.com/api/v1/namespaces/vmm/images/vmm-logo-img.svg x-repo-name: vmm x-minimum-negotiation-version: v4.2 servers: - url: "https://{host}:{port}/api" security: - basicAuthScheme: [] - apiKeyAuthScheme: [] tags: - name: Vm description: | A virtual machine (VM) is a digital environment that operates as a virtual compute resource on a physical server. It uses software to run and deploy applications instead of a physical computer system. One server or host can support multiple VMs or guests running simultaneously. The APIs under VM are used for creating and managing virtual machines on AHV. x-displayName: VMs - name: EsxiVm description: | The ESXi VM APIs are used to manage virtual machines on ESXi. x-displayName: ESXi VMs - name: Stats description: | The APIs provide functionality to fetch statistics for AHV Virtual machines. Users can utilize the list/get VM stats APIs to retrieve comprehensive statistics, including specific metrics for disks and NICs attached to the VMs. The APIs support querying data within a specified time range by allowing users to specify start and end times. In addition, users can specify the sample interval, apply filters, and perform various aggregations such as AVG, SUM, COUNT, MIN, and MAX on the retrieved data. x-displayName: Stats - name: EsxiStats description: | The APIs provide functionality to fetch statistics for ESXi Virtual machines. Users can utilize the list/get VM stats APIs to retrieve comprehensive statistics, including specific metrics for disks and NICs attached to the VMs. The APIs support querying data within a specified time range by allowing users to specify start and end times. In addition, users can specify the sample interval, apply filters, and perform various aggregations such as AVG, SUM, COUNT, MIN, and MAX on the retrieved data. x-displayName: ESXi Stats - name: VmAntiAffinityPolicies description: | The VM-VM anti-affinity policy is used to specify anti-affinity between the AHV virtual machines. The VM-VM anti-affinity policy keeps the specified virtual machines apart in such a way that when a problem occurs with one host, you should not lose both the virtual machines. The VM-VM anti-affinity policy APIs are used to manage these policies. x-displayName: VM-VM Anti-Affinity Policies - name: VmHostAffinityPolicies description: | APIs for managing VM-Host Affinity Policies. x-displayName: VM-Host Affinity Policies - name: VmRecoveryPoints description: | APIs for managing the AHV VM Recovery Point entity. A VM recovery point is a snapshot of a VM at a specific point in time. x-displayName: VM Recovery Points - name: VmGuestCustomizationProfiles description: | APIs for managing VM Guest Customization Profiles. x-displayName: VM Guest Customization Profiles - name: VmStartupPolicies description: | The VM Startup policies can be used to configure dependencies between groups of VMs. During an HA event or Cluster restart event, these policies would be honoured to start the VMs in the order as specified by the dependencies. x-displayName: VM Startup Policies - name: TemplatePlacementPolicies description: | APIs for managing Template Placement Policies. x-displayName: Template Placement Policies - name: Templates description: | It enables the creation and management of templates from AHV virtual machines, as well as the deployment of VMs from these templates across multiple clusters. These templates include versioned configurations and disks, which can be replicated to other clusters when necessary. - name: Ovas description: | Enables the creation and management of OVAs through upload or VM export and facilitates the deployment of VMs from OVAs across clusters. OVAs store VM configurations and disks and can also be downloaded from the Nutanix environment. x-displayName: OVAs - name: Images description: | It enables the creation of images (from URLs, objects or existing VM disks) and the management of them, which can be used to create VM disks for virtual machines. Additionally, it allows the downloading of existing images. x-displayName: Images - name: ImagePlacementPolicies description: | It enables the creation and management of placement policies for image entities. Additionally, it allows the suspension and resumption of these policies. These policies ensure that images are placed on the targeted PEs according to the specified policies. x-displayName: Image Placement Policies - name: ImageRateLimitPolicies description: | It enables the creation and management of the rate limit policies for image entities. Additionally, it allows viewing the effective rate limit policy on all PEs. These policies ensure that bandwidth on the targeted PEs is used according to the policy when creating an image or while copying it from one PE to another. x-displayName: Image Rate Limit Policies paths: /vmm/v4.2/esxi/stats/vms: get: tags: - EsxiStats summary: List VM stats for all VMs description: "List VM stats for all VMs. Users can fetch the stats by specifying\ \ the following params in the request query: 1) '$select': comma-separated\ \ attributes with the prefix 'stats/', e.g. 'stats/controllerNumIo,stats/hypervisorNumIo'.\ \ 2) '$startTime': the start time for which stats should be reported, e.g.\ \ '2023-01-01T12:00:00.000-08:00'; 3) '$endTime': the end time for which stats\ \ should be reported; 4) '$samplingInterval': the sampling interval in seconds\ \ at which statistical data should be collected; 5) '$statType': the down-sampling\ \ operator to use while performing down-sampling on stats data; 6) '$orderby';\ \ 7) '$page'; 8) '$limit'; and 9) '$filter': the OData filter to use, e.g.\ \ 'stats/hypervisorCpuUsagePpm gt 100000 and stats/guestMemoryUsagePpm lt\ \ 2000000.'" operationId: listVmStats parameters: - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 41 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: stats/checkScore example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/checkScore\ \ eq 51)" - name: stats/cluster example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/cluster\ \ eq 'string')" - name: stats/controllerAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerAvgIoLatencyMicros\ \ eq 25)" - name: stats/controllerAvgReadIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerAvgReadIoLatencyMicros\ \ eq 33)" - name: stats/controllerAvgReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerAvgReadIoSizeKb\ \ eq 37)" - name: stats/controllerAvgWriteIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerAvgWriteIoLatencyMicros\ \ eq 92)" - name: stats/controllerAvgWriteIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerAvgWriteIoSizeKb\ \ eq 32)" - name: stats/controllerIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerIoBandwidthKbps\ \ eq 87)" - name: stats/controllerNumIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumIo\ \ eq 60)" - name: stats/controllerNumIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumIops\ \ eq 28)" - name: stats/controllerNumRandomIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumRandomIo\ \ eq 33)" - name: stats/controllerNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumReadIo\ \ eq 84)" - name: stats/controllerNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumReadIops\ \ eq 93)" - name: stats/controllerNumSeqIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumSeqIo\ \ eq 84)" - name: stats/controllerNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumWriteIo\ \ eq 64)" - name: stats/controllerNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerNumWriteIops\ \ eq 14)" - name: stats/controllerRandomIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerRandomIoPpm\ \ eq 59)" - name: stats/controllerReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerReadIoBandwidthKbps\ \ eq 76)" - name: stats/controllerReadIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerReadIoPpm\ \ eq 37)" - name: stats/controllerSeqIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerSeqIoPpm\ \ eq 41)" - name: stats/controllerStorageTierSsdUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerStorageTierSsdUsageBytes\ \ eq 26)" - name: stats/controllerTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerTimespanMicros\ \ eq 60)" - name: stats/controllerTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerTotalIoSizeKb\ \ eq 75)" - name: stats/controllerTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerTotalIoTimeMicros\ \ eq 73)" - name: stats/controllerTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerTotalReadIoSizeKb\ \ eq 40)" - name: stats/controllerTotalReadIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerTotalReadIoTimeMicros\ \ eq 32)" - name: stats/controllerTotalTransformedUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerTotalTransformedUsageBytes\ \ eq 40)" - name: stats/controllerUserBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerUserBytes\ \ eq 52)" - name: stats/controllerWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerWriteIoBandwidthKbps\ \ eq 43)" - name: stats/controllerWriteIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/controllerWriteIoPpm\ \ eq 33)" - name: stats/hypervisorAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorAvgIoLatencyMicros\ \ eq 52)" - name: stats/hypervisorCpuReadyTimePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorCpuReadyTimePpm\ \ eq 6)" - name: stats/hypervisorCpuUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorCpuUsagePpm\ \ eq 35)" - name: stats/hypervisorIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorIoBandwidthKbps\ \ eq 25)" - name: stats/hypervisorMemoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorMemoryUsagePpm\ \ eq 81)" - name: stats/hypervisorNumIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumIo\ \ eq 68)" - name: stats/hypervisorNumIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumIops\ \ eq 48)" - name: stats/hypervisorNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumReadIo\ \ eq 92)" - name: stats/hypervisorNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumReadIops\ \ eq 21)" - name: stats/hypervisorNumReceivedBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumReceivedBytes\ \ eq 67)" - name: stats/hypervisorNumTransmittedBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumTransmittedBytes\ \ eq 47)" - name: stats/hypervisorNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumWriteIo\ \ eq 62)" - name: stats/hypervisorNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorNumWriteIops\ \ eq 29)" - name: stats/hypervisorReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorReadIoBandwidthKbps\ \ eq 14)" - name: stats/hypervisorSwapInRateKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorSwapInRateKbps\ \ eq 17)" - name: stats/hypervisorSwapOutRateKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorSwapOutRateKbps\ \ eq 60)" - name: stats/hypervisorTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorTimespanMicros\ \ eq 3)" - name: stats/hypervisorTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorTotalIoSizeKb\ \ eq 65)" - name: stats/hypervisorTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorTotalIoTimeMicros\ \ eq 27)" - name: stats/hypervisorTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorTotalReadIoSizeKb\ \ eq 80)" - name: stats/hypervisorType example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorType\ \ eq 'string')" - name: stats/hypervisorWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/hypervisorWriteIoBandwidthKbps\ \ eq 41)" - name: stats/memoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$filter=stats/any(a:a/memoryUsagePpm\ \ eq 28)" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: stats/checkScore example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/checkScore" - name: stats/controllerAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerAvgIoLatencyMicros" - name: stats/controllerAvgReadIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerAvgReadIoLatencyMicros" - name: stats/controllerAvgReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerAvgReadIoSizeKb" - name: stats/controllerAvgWriteIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerAvgWriteIoLatencyMicros" - name: stats/controllerAvgWriteIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerAvgWriteIoSizeKb" - name: stats/controllerIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerIoBandwidthKbps" - name: stats/controllerNumIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumIo" - name: stats/controllerNumIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumIops" - name: stats/controllerNumRandomIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumRandomIo" - name: stats/controllerNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumReadIo" - name: stats/controllerNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumReadIops" - name: stats/controllerNumSeqIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumSeqIo" - name: stats/controllerNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumWriteIo" - name: stats/controllerNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerNumWriteIops" - name: stats/controllerRandomIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerRandomIoPpm" - name: stats/controllerReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerReadIoBandwidthKbps" - name: stats/controllerReadIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerReadIoPpm" - name: stats/controllerSeqIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerSeqIoPpm" - name: stats/controllerStorageTierSsdUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerStorageTierSsdUsageBytes" - name: stats/controllerTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerTimespanMicros" - name: stats/controllerTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerTotalIoSizeKb" - name: stats/controllerTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerTotalIoTimeMicros" - name: stats/controllerTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerTotalReadIoSizeKb" - name: stats/controllerTotalReadIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerTotalReadIoTimeMicros" - name: stats/controllerTotalTransformedUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerTotalTransformedUsageBytes" - name: stats/controllerUserBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerUserBytes" - name: stats/controllerWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerWriteIoBandwidthKbps" - name: stats/controllerWriteIoPpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/controllerWriteIoPpm" - name: stats/hypervisorAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorAvgIoLatencyMicros" - name: stats/hypervisorCpuReadyTimePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorCpuReadyTimePpm" - name: stats/hypervisorCpuUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorCpuUsagePpm" - name: stats/hypervisorIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorIoBandwidthKbps" - name: stats/hypervisorMemoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorMemoryUsagePpm" - name: stats/hypervisorNumIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumIo" - name: stats/hypervisorNumIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumIops" - name: stats/hypervisorNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumReadIo" - name: stats/hypervisorNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumReadIops" - name: stats/hypervisorNumReceivedBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumReceivedBytes" - name: stats/hypervisorNumTransmittedBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumTransmittedBytes" - name: stats/hypervisorNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumWriteIo" - name: stats/hypervisorNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorNumWriteIops" - name: stats/hypervisorReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorReadIoBandwidthKbps" - name: stats/hypervisorSwapInRateKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorSwapInRateKbps" - name: stats/hypervisorSwapOutRateKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorSwapOutRateKbps" - name: stats/hypervisorTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorTimespanMicros" - name: stats/hypervisorTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorTotalIoSizeKb" - name: stats/hypervisorTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorTotalIoTimeMicros" - name: stats/hypervisorTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorTotalReadIoSizeKb" - name: stats/hypervisorWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/hypervisorWriteIoBandwidthKbps" - name: stats/memoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$orderby=stats/memoryUsagePpm" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$select=extId" - name: links example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$select=links" - name: stats example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$select=stats" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/esxi/stats/vms?$select=tenantId" responses: "200": description: Returns the list of VM stats for all VMs. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmStats' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms Get operation x-permissions: operationName: View ESXi Virtual Machine Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 2 timeUnit: seconds - type: XLarge count: 2 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiStatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiStats.ListVmStatsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.stats.ListVmStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiStatsApi esxiStatsApi = new EsxiStatsApi(apiClient);\n\n \ \ // Datetime needs to be in RFC3339 format\n OffsetDateTime startTime\ \ = OffsetDateTime.now();\n // Datetime needs to be in RFC3339 format\n\ \ OffsetDateTime endTime = OffsetDateTime.now();\n \n \ \ int samplingInterval = 1;\n \n Object statType = SOME_RAW_DATA;\n\ \ \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n EsxiStatsListVmStatsApiResponse\ \ esxiStatsListVmStatsApiResponse = esxiStatsApi.listVmStats(ListVmStatsRequest.builder()\n\ \ .$startTime(startTime)\n .$endTime(endTime)\n\ \ .$samplingInterval(samplingInterval)\n .$statType(statType)\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(esxiStatsListVmStatsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, EsxiStatsApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let esxiStatsApi = new EsxiStatsApi(apiClientInstance); function sample() { //Datetime needs to be in RFC3339 format let $startTime = "2021-01-01T00:00:00-08:00"; //Datetime needs to be in RFC3339 format let $endTime = "2021-01-01T00:00:00-08:00"; // Construct Optional Parameters var opts = {}; opts["$samplingInterval"] = 1; opts["$statType"] = SOME_RAW_DATA; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; esxiStatsApi.listVmStats($startTime, $endTime, opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_stats_api\ \ = ntnx_vmm_py_client.EsxiStatsApi(api_client=client)\n # Datetime needs\ \ to be in RFC3339 format\n start_time = datetime.datetime.Now()\n \ \ # Datetime needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = esxi_stats_api.list_vm_stats(_startTime=start_time, _endTime=end_time,\ \ _samplingInterval=sampling_interval, _statType=stat_type, _page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxistats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiStatsServiceApiInstance\ \ *api.EsxiStatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ EsxiStatsServiceApiInstance = api.NewEsxiStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n // Datetime needs to be in RFC3339\ \ format\n startTime_ := time.Now()\n // Datetime needs to be in RFC3339\ \ format\n endTime_ := time.Now()\n \n samplingInterval_ := 1\n\ \ \n statType_ := SOME_RAW_DATA\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := esxistats.ListVmStatsRequest{ StartTime_: &startTime_,\ \ EndTime_: &endTime_, SamplingInterval_: &samplingInterval_, StatType_:\ \ &statType_, Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil,\ \ Select_: nil }\n response, error := EsxiStatsServiceApiInstance.ListVmStats(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmStats)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/stats/vms?$startTime=2021-01-01T00:00:00-08:00&$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$page=0&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/stats/vms?$startTime=2021-01-01T00:00:00-08:00&$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$page=0&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiStatsApi esxiStatsApi\ \ = new EsxiStatsApi(client);\n\n String startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n String endTime = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval\ \ = 1;\n Object statType = SOME_RAW_DATA;\n int page = 0;\n \ \ int limit = 50;\n String filter = \"string_sample_data\";\n \ \ String orderby = \"string_sample_data\";\n String select = \"\ string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListVmStatsRequest {\n StartTime =\ \ startTime,\n EndTime = endTime,\n SamplingInterval\ \ = samplingInterval,\n StatType = statType,\n Page\ \ = page,\n Limit = limit,\n Filter = filter,\n \ \ Orderby = orderby,\n Select = select\n };\n\ \ try {\n EsxiStatsListVmStatsApiResponse esxiStatsListVmStatsApiResponse\ \ = esxiStatsApi.ListVmStats(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/esxi/stats/vms/{extId}: get: tags: - EsxiStats summary: Get VM stats for a given VM description: "Get VM stats for a given VM. Users can fetch the stats by specifying\ \ the following params in the request query: 1) '$select': comma-separated\ \ attributes with the prefix 'stats/', e.g. 'stats/checkScore'. 2) '$startTime':\ \ the start time for which stats should be reported, e.g. '2023-01-01T12:00:00.000-08:00';\ \ 3) '$endTime': the end time for which stats should be reported; 4) '$samplingInterval':\ \ the sampling interval in seconds at which statistical data should be collected;\ \ 5) '$statType': the down-sampling operator to use while performing down-sampling\ \ on stats data" operationId: getVmStatsById parameters: - name: extId in: path description: Retrieve statistics for the VM with the specified external ID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1fbd5a48-ee86-4450-9cd2-383db5dbb7ca - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 85 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId - name: links - name: stats - name: tenantId responses: "200": description: Returns the requested stats for the VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmStats' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{extId}\ \ Get operation" x-permissions: operationName: View ESXi Virtual Machine Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiStatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiStats.GetVmStatsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.stats.GetVmStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiStatsApi esxiStatsApi = new EsxiStatsApi(apiClient);\n\n \ \ \n String extId = \"bdE97fEE-bBfc-C9D3-85BB-2DA0Ecd40AE7\";\n\ \ // Datetime needs to be in RFC3339 format\n OffsetDateTime\ \ startTime = OffsetDateTime.now();\n // Datetime needs to be in\ \ RFC3339 format\n OffsetDateTime endTime = OffsetDateTime.now();\n\ \ \n int samplingInterval = 1;\n \n Object statType\ \ = SOME_RAW_DATA;\n\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiStatsGetVmStatsApiResponse esxiStatsGetVmStatsApiResponse = esxiStatsApi.getVmStatsById(GetVmStatsByIdRequest.builder()\n\ \ .extId(extId)\n .$startTime(startTime)\n\ \ .$endTime(endTime)\n .$samplingInterval(samplingInterval)\n\ \ .$statType(statType)\n .$select(null)\n\ \ .build());\n\n System.out.println(esxiStatsGetVmStatsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiStatsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiStatsApi = new EsxiStatsApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let extId = \"f7cAbb21-0904-2fEE-0eFB-cf77cdd5E9bf\";\n\ \ //Datetime needs to be in RFC3339 format\n let $startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n //Datetime needs to be in RFC3339 format\n let $endTime = \"2021-01-01T00:00:00-08:00\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $samplingInterval\"] = 1;\n opts[\"$statType\"] = SOME_RAW_DATA;\n \ \ opts[\"$select\"] = \"string_sample_data\";\n\n\n\n\n esxiStatsApi.getVmStatsById(extId,\ \ $startTime, $endTime, opts).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_stats_api\ \ = ntnx_vmm_py_client.EsxiStatsApi(api_client=client)\n \n ext_id\ \ = \"1A3Dc1bB-f4d8-AfDc-43a5-Ed0fEDC9D5e9\"\n # Datetime needs to be\ \ in RFC3339 format\n start_time = datetime.datetime.Now()\n # Datetime\ \ needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\n\ \n try:\n api_response = esxi_stats_api.get_vm_stats_by_id(extId=ext_id,\ \ _startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxistats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiStatsServiceApiInstance\ \ *api.EsxiStatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ EsxiStatsServiceApiInstance = api.NewEsxiStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"Df362B2b-2EBE-A3Dd-72B6-cF9BCf9AbDD2\"\ \n // Datetime needs to be in RFC3339 format\n startTime_ := time.Now()\n\ \ // Datetime needs to be in RFC3339 format\n endTime_ := time.Now()\n\ \ \n samplingInterval_ := 1\n \n statType_ := SOME_RAW_DATA\n\ \n\n request := esxistats.GetVmStatsByIdRequest{ ExtId: &extId, StartTime_:\ \ &startTime_, EndTime_: &endTime_, SamplingInterval_: &samplingInterval_,\ \ StatType_: &statType_, Select_: nil }\n response, error := EsxiStatsServiceApiInstance.GetVmStatsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmStats)\n \ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/stats/vms/fA4c6EDa-F7bb-6f6e-aA89-9Ba2FBb2E5CE?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/stats/vms/E4B2C05A-dAcF-5BCD-7ffA-ECFAebDDD5B5?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiStatsApi esxiStatsApi\ \ = new EsxiStatsApi(client);\n\n String extId = \"cAd94B57-bEbA-bD0a-bA35-B1d8fCac5FBD\"\ ;\n String startTime = \"2021-01-01T00:00:00-08:00\";\n String\ \ endTime = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval =\ \ 1;\n Object statType = SOME_RAW_DATA;\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetVmStatsByIdRequest {\n ExtId = extId,\n \ \ StartTime = startTime,\n EndTime = endTime,\n SamplingInterval\ \ = samplingInterval,\n StatType = statType,\n Select\ \ = select\n };\n try {\n EsxiStatsGetVmStatsApiResponse\ \ esxiStatsGetVmStatsApiResponse = esxiStatsApi.GetVmStatsById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/stats/vms/{vmExtId}/nics/{extId}: get: tags: - EsxiStats summary: Get the stats for the specified VM NIC description: "Fetches the stats for the specified VM NIC. Users can fetch the\ \ stats by specifying the following params in the request query: 1) '$select':\ \ comma-separated attributes with the prefix 'stats/', e.g. 'stats/checkScore'.\ \ 2) '$startTime': the start time for which stats should be reported, e.g.\ \ '2023-01-01T12:00:00.000-08:00'; 3) '$endTime': the end time for which stats\ \ should be reported; 4) '$samplingInterval': the sampling interval in seconds\ \ at which statistical data should be collected; 5) '$statType': the down-sampling\ \ operator to use while performing down-sampling on stats data" operationId: getNicStatsById parameters: - name: vmExtId in: path description: This field specifies the VM external ID when retrieving the stats for a given VM NIC. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: de0a92f7-a2f9-40ca-9068-4cdafa9f1e0b - name: extId in: path description: This field specifies the external ID of the VM NIC when retrieving stats for a given VM NIC. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 289de27c-cb58-4351-abf5-11ef67211e64 - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 71 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId - name: links - name: stats - name: tenantId - name: vmExtId responses: "200": description: Returns the requested stats for the VM NIC. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmNicStats' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" x-permissions: operationName: View ESXi Virtual Machine NIC Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiStatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiStats.GetNicStatsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.stats.GetNicStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiStatsApi esxiStatsApi = new EsxiStatsApi(apiClient);\n\n \ \ \n String vmExtId = \"FfbCE09E-C6ee-eaea-Ab95-CFBbdebeC91B\";\n\ \ \n String extId = \"8D3d51B1-cFAF-a980-8e53-e7eAf1F3DEc7\"\ ;\n // Datetime needs to be in RFC3339 format\n OffsetDateTime\ \ startTime = OffsetDateTime.now();\n // Datetime needs to be in\ \ RFC3339 format\n OffsetDateTime endTime = OffsetDateTime.now();\n\ \ \n int samplingInterval = 1;\n \n Object statType\ \ = SOME_RAW_DATA;\n\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiStatsGetNicStatsApiResponse esxiStatsGetNicStatsApiResponse = esxiStatsApi.getNicStatsById(GetNicStatsByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .$startTime(startTime)\n .$endTime(endTime)\n\ \ .$samplingInterval(samplingInterval)\n .$statType(statType)\n\ \ .$select(null)\n .build());\n\n \ \ System.out.println(esxiStatsGetNicStatsApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiStatsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiStatsApi = new EsxiStatsApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let vmExtId = \"D77347cE-E9eD-9CB2-acc2-b4DC1D9FF42D\"\ ;\n \n let extId = \"3cCAC669-1FfC-bF30-afAE-41C591f5A4dc\";\n \ \ //Datetime needs to be in RFC3339 format\n let $startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n //Datetime needs to be in RFC3339 format\n let $endTime = \"2021-01-01T00:00:00-08:00\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $samplingInterval\"] = 1;\n opts[\"$statType\"] = SOME_RAW_DATA;\n \ \ opts[\"$select\"] = \"string_sample_data\";\n\n\n\n\n esxiStatsApi.getNicStatsById(vmExtId,\ \ extId, $startTime, $endTime, opts).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_stats_api\ \ = ntnx_vmm_py_client.EsxiStatsApi(api_client=client)\n \n vm_ext_id\ \ = \"fcFD0e8d-eBa6-Add6-D493-bdB84BAFe0BA\"\n \n ext_id = \"5AFfbBbF-49c8-cc2d-BAA7-d7D1EF2aEc9c\"\ \n # Datetime needs to be in RFC3339 format\n start_time = datetime.datetime.Now()\n\ \ # Datetime needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\n\ \n try:\n api_response = esxi_stats_api.get_nic_stats_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, _startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxistats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiStatsServiceApiInstance\ \ *api.EsxiStatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ EsxiStatsServiceApiInstance = api.NewEsxiStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmExtId := \"1C5AcAC5-D7Fd-E0eA-69DD-4BdAcdbdFba8\"\ \n \n extId := \"8BaeE754-Bb7b-Ff26-4dAE-CDbFd1D0fA3E\"\n // Datetime\ \ needs to be in RFC3339 format\n startTime_ := time.Now()\n // Datetime\ \ needs to be in RFC3339 format\n endTime_ := time.Now()\n \n samplingInterval_\ \ := 1\n \n statType_ := SOME_RAW_DATA\n\n\n request := esxistats.GetNicStatsByIdRequest{\ \ VmExtId: &vmExtId, ExtId: &extId, StartTime_: &startTime_, EndTime_: &endTime_,\ \ SamplingInterval_: &samplingInterval_, StatType_: &statType_, Select_:\ \ nil }\n response, error := EsxiStatsServiceApiInstance.GetNicStatsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmNicStats)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/stats/vms/DB45dDbe-d50C-Bd0B-8bcc-64d6ECAcf2dd/nics/7CCdCaAF-efB5-deCc-485E-fB5CF9C4DD4A?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/stats/vms/Cebef7D8-9f78-bCc6-eaDF-DddA07a04FEC/nics/3E77EDc5-B1A2-2Fca-b7dA-a8dAd3eabBff?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiStatsApi esxiStatsApi\ \ = new EsxiStatsApi(client);\n\n String vmExtId = \"fd8c7BBd-2E9c-fde8-6DCC-aBafaFfbAe4B\"\ ;\n String extId = \"B5DaD8Cd-FD82-32df-5Daa-9cF8E42eccaD\";\n \ \ String startTime = \"2021-01-01T00:00:00-08:00\";\n String endTime\ \ = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval = 1;\n \ \ Object statType = SOME_RAW_DATA;\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetNicStatsByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId,\n StartTime = startTime,\n \ \ EndTime = endTime,\n SamplingInterval = samplingInterval,\n\ \ StatType = statType,\n Select = select\n \ \ };\n try {\n EsxiStatsGetNicStatsApiResponse esxiStatsGetNicStatsApiResponse\ \ = esxiStatsApi.GetNicStatsById(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/esxi/stats/vms/{vmExtId}/disks/{extId}: get: tags: - EsxiStats summary: Get the stats for the specified VM disk description: "Fetches the stats for the specified VM disk. Users can fetch the\ \ stats by specifying the following params in the request query: 1) '$select':\ \ comma-separated attributes with the prefix 'stats/', e.g. 'stats/checkScore'.\ \ 2) '$startTime': the start time for which stats should be reported, e.g.\ \ '2023-01-01T12:00:00.000-08:00'; 3) '$endTime': the end time for which stats\ \ should be reported; 4) '$samplingInterval': the sampling interval in seconds\ \ at which statistical data should be collected; 5) '$statType': the down-sampling\ \ operator to use while performing down-sampling on stats data" operationId: getDiskStatsById parameters: - name: vmExtId in: path description: This field specifies the VM external ID when retrieving the stats for a given VM Disk. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 6114f6b1-1eb0-4025-a588-930969e3e52f - name: extId in: path description: This field specifies the VM external ID when retrieving the stats for a given VM Disk. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 77ebf79b-01e1-4df6-9e76-f908d0c1924b - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 83 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId - name: links - name: stats - name: tenantId - name: vmExtId responses: "200": description: Returns the requested stats for the VM Disk. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmDiskStats' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" x-permissions: operationName: View ESXi Virtual Machine Disk Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiStatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiStats.GetDiskStatsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.stats.GetDiskStatsApiResponse;\n\ import java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiStatsApi esxiStatsApi = new EsxiStatsApi(apiClient);\n\n \ \ \n String vmExtId = \"0aA8296f-93F4-eBa0-1D0A-EbB5ca4a1CAD\";\n\ \ \n String extId = \"92BbaFC0-30f3-fbab-Fc65-4FfFDabBdfa5\"\ ;\n // Datetime needs to be in RFC3339 format\n OffsetDateTime\ \ startTime = OffsetDateTime.now();\n // Datetime needs to be in\ \ RFC3339 format\n OffsetDateTime endTime = OffsetDateTime.now();\n\ \ \n int samplingInterval = 1;\n \n Object statType\ \ = SOME_RAW_DATA;\n\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiStatsGetDiskStatsApiResponse esxiStatsGetDiskStatsApiResponse = esxiStatsApi.getDiskStatsById(GetDiskStatsByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .$startTime(startTime)\n .$endTime(endTime)\n\ \ .$samplingInterval(samplingInterval)\n .$statType(statType)\n\ \ .$select(null)\n .build());\n\n \ \ System.out.println(esxiStatsGetDiskStatsApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiStatsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiStatsApi = new EsxiStatsApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let vmExtId = \"2AE2Fc2A-2C13-b9E7-ceD5-BFbb5C7cFCCa\"\ ;\n \n let extId = \"1eAf78f2-dEba-dCB6-4dFD-De27803C3Cdc\";\n \ \ //Datetime needs to be in RFC3339 format\n let $startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n //Datetime needs to be in RFC3339 format\n let $endTime = \"2021-01-01T00:00:00-08:00\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $samplingInterval\"] = 1;\n opts[\"$statType\"] = SOME_RAW_DATA;\n \ \ opts[\"$select\"] = \"string_sample_data\";\n\n\n\n\n esxiStatsApi.getDiskStatsById(vmExtId,\ \ extId, $startTime, $endTime, opts).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_stats_api\ \ = ntnx_vmm_py_client.EsxiStatsApi(api_client=client)\n \n vm_ext_id\ \ = \"5B564cBD-E5F6-3Fe8-3baB-dcb64DA797eF\"\n \n ext_id = \"b0fF13bB-cEBC-52B3-DaAD-EdE9EdbfaFB9\"\ \n # Datetime needs to be in RFC3339 format\n start_time = datetime.datetime.Now()\n\ \ # Datetime needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\n\ \n try:\n api_response = esxi_stats_api.get_disk_stats_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, _startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxistats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiStatsServiceApiInstance\ \ *api.EsxiStatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ EsxiStatsServiceApiInstance = api.NewEsxiStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmExtId := \"f6a2e0d5-Be0B-51a8-b7d8-cAb57aE7Ca49\"\ \n \n extId := \"7Bada3dD-dFac-f278-2Ac6-eccA4b58C1AE\"\n // Datetime\ \ needs to be in RFC3339 format\n startTime_ := time.Now()\n // Datetime\ \ needs to be in RFC3339 format\n endTime_ := time.Now()\n \n samplingInterval_\ \ := 1\n \n statType_ := SOME_RAW_DATA\n\n\n request := esxistats.GetDiskStatsByIdRequest{\ \ VmExtId: &vmExtId, ExtId: &extId, StartTime_: &startTime_, EndTime_: &endTime_,\ \ SamplingInterval_: &samplingInterval_, StatType_: &statType_, Select_:\ \ nil }\n response, error := EsxiStatsServiceApiInstance.GetDiskStatsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmDiskStats)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/stats/vms/bBD8A7aB-Eba0-bC15-7Cc4-76CccfABE152/disks/1d560eDC-bc9c-cB69-EbC8-fe63149d8CeF?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/stats/vms/fE1Dd33a-eCB9-ddB3-c3c5-AE7A5155DeFB/disks/f87CAdbE-e7df-Ae4b-7dc7-AE68aF3AdD3d?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiStatsApi esxiStatsApi\ \ = new EsxiStatsApi(client);\n\n String vmExtId = \"fCeD3e11-5EdB-eaA2-b6Ab-Bd84CCDF0de7\"\ ;\n String extId = \"0D4CBdbb-b6CD-eCF9-d3F9-FFfFfBA7DEeD\";\n \ \ String startTime = \"2021-01-01T00:00:00-08:00\";\n String endTime\ \ = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval = 1;\n \ \ Object statType = SOME_RAW_DATA;\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetDiskStatsByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId,\n StartTime = startTime,\n \ \ EndTime = endTime,\n SamplingInterval = samplingInterval,\n\ \ StatType = statType,\n Select = select\n \ \ };\n try {\n EsxiStatsGetDiskStatsApiResponse esxiStatsGetDiskStatsApiResponse\ \ = esxiStatsApi.GetDiskStatsById(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/associate-categories: post: tags: - EsxiVm summary: Associate categories to a VM description: Associate categories to a virtual machine. operationId: associateCategories parameters: - name: extId in: path description: The globally unique identifier of an instance of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 7f914a65-f145-4cf4-ab8f-a916982abbf6 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 17a47d19-60bd-4cdd-b19c-4b6f011b56a5 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.AssociateVmCategoriesParams' required: true responses: "202": description: The request to associate categories to a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/associate-categories\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/associate-categories\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/associate-categories\ \ Post operation" x-permissions: operationName: Associate ESXi Virtual Machine Categories deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.AssociateCategoriesRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssociateVmCategoriesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssociateCategoriesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n EsxiConfigAssociateVmCategoriesParams\ \ esxiConfigAssociateVmCategoriesParams = new EsxiConfigAssociateVmCategoriesParams();\n\ \n // EsxiConfigAssociateVmCategoriesParams object initializations\ \ here...\n esxiConfigAssociateVmCategoriesParams.setCategories(new\ \ ArrayList<>()); // required field\n \n String extId = \"\ bDaabdbB-ecBd-beE4-D6BD-fDBff5Cb7cD2\";\n\n /*\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigAssociateCategoriesApiResponse esxiConfigAssociateCategoriesApiResponse\ \ = esxiVmApi.associateCategories(AssociateCategoriesRequest.builder()\n\ \ .extId(extId)\n .build(), esxiConfigAssociateVmCategoriesParams,\ \ opts);\n\n System.out.println(esxiConfigAssociateCategoriesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, AssociateVmCategoriesParams } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let esxiConfigAssociateVmCategoriesParams = new EsxiConfigAssociateVmCategoriesParams();\n\ \n // EsxiConfigAssociateVmCategoriesParams object initializations here...\n\ \ esxiConfigAssociateVmCategoriesParams.setCategories([]); // required\ \ field\n esxiConfigAssociateVmCategoriesParams = JSON.stringify(esxiConfigAssociateVmCategoriesParams);\n\ \n \n let extId = \"7FFf8B7C-0E49-b102-48FC-5aDf1d3fbfdB\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.associateCategories(extId,\ \ esxiConfigAssociateVmCategoriesParams, args).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n esxiConfigAssociateVmCategoriesParams\ \ = ntnx_vmm_py_client.EsxiConfigAssociateVmCategoriesParams()\n\n #\ \ EsxiConfigAssociateVmCategoriesParams object initializations here...\n\ \ esxiConfigAssociateVmCategoriesParams.categories = [] # required field\n\ \ \n ext_id = \"9b12D0cB-A3af-FFfA-3ffB-DbAB97AfF1Fe\"\n\n \"\"\ \"\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = esxi_vm_api.associate_categories(extId=ext_id,\ \ body=esxiConfigAssociateVmCategoriesParams, if_match=etag_value)\n \ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n esxiConfigAssociateVmCategoriesParams\ \ := import1.NewEsxiConfigAssociateVmCategoriesParams()\n\n // EsxiConfigAssociateVmCategoriesParams\ \ object initializations here...\n\n \n extId := \"Af1f5DC6-dfBB-8cAa-fbFe-8b6f3FCFd65c\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.AssociateCategoriesRequest{ ExtId: &extId,\ \ Body: esxiConfigAssociateVmCategoriesParams }\n response, error :=\ \ EsxiVmServiceApiInstance.AssociateCategories(ctx, &request, args)\n \ \ if error != nil {\n fmt.Println(error)\n return\n }\n\ \ data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/0ee0A5a1-6D27-CfB4-abb8-6b8A74ed5E2d/$actions/associate-categories" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"categories":[{"extId":"string","$objectType":"vmm.v4.esxi.config.CategoryReference"}],"$objectType":"vmm.v4.esxi.config.AssociateVmCategoriesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"categories":[{"extId":"string","$objectType":"vmm.v4.esxi.config.CategoryReference"}],"$objectType":"vmm.v4.esxi.config.AssociateVmCategoriesParams"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/1e9a62Fd-3ceF-88Cc-d21c-AB7CAEcdFfCE/$actions/associate-categories" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n EsxiConfigAssociateVmCategoriesParams\ \ esxiConfigAssociateVmCategoriesParams = new EsxiConfigAssociateVmCategoriesParams();\n\ \n // EsxiConfigAssociateVmCategoriesParams object initializations\ \ here...\n esxiConfigAssociateVmCategoriesParams.Categories = new\ \ ArrayList(); // required field\n\n String extId = \"FdE7B4cD-fCC6-dD76-a7dA-e3ada13DEB1d\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new AssociateCategoriesRequest\ \ {\n ExtId = extId,\n Body = esxiConfigAssociateVmCategoriesParams,\n\ \ \n \n };\n try {\n EsxiConfigAssociateCategoriesApiResponse\ \ esxiConfigAssociateCategoriesApiResponse = esxiVmApi.AssociateCategories(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/disassociate-categories: post: tags: - EsxiVm summary: Disassociate categories from a VM description: Disassociate categories from a virtual machine. operationId: disassociateCategories parameters: - name: extId in: path description: The globally unique identifier of an instance of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 3e62389c-36d9-4723-9082-a01210e8aa79 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: c144fdc7-ac79-4835-a57d-32781970a7ce requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.DisassociateVmCategoriesParams' required: true responses: "202": description: The request to disassociate categories from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" x-permissions: operationName: Disassociate ESXi Virtual Machine Categories deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.DisassociateCategoriesRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.DisassociateVmCategoriesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.DisassociateCategoriesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n EsxiConfigDisassociateVmCategoriesParams\ \ esxiConfigDisassociateVmCategoriesParams = new EsxiConfigDisassociateVmCategoriesParams();\n\ \n // EsxiConfigDisassociateVmCategoriesParams object initializations\ \ here...\n esxiConfigDisassociateVmCategoriesParams.setCategories(new\ \ ArrayList<>()); // required field\n \n String extId = \"\ aCC915CC-AD0D-baEF-cAcb-6eCf3aE3cd6A\";\n\n /*\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigDisassociateCategoriesApiResponse esxiConfigDisassociateCategoriesApiResponse\ \ = esxiVmApi.disassociateCategories(DisassociateCategoriesRequest.builder()\n\ \ .extId(extId)\n .build(), esxiConfigDisassociateVmCategoriesParams,\ \ opts);\n\n System.out.println(esxiConfigDisassociateCategoriesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, DisassociateVmCategoriesParams }\ \ from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let esxiConfigDisassociateVmCategoriesParams = new EsxiConfigDisassociateVmCategoriesParams();\n\ \n // EsxiConfigDisassociateVmCategoriesParams object initializations\ \ here...\n esxiConfigDisassociateVmCategoriesParams.setCategories([]);\ \ // required field\n esxiConfigDisassociateVmCategoriesParams = JSON.stringify(esxiConfigDisassociateVmCategoriesParams);\n\ \n \n let extId = \"dDddcC7D-D1fC-2DA0-bDdF-Ac90D5aDc11d\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.disassociateCategories(extId,\ \ esxiConfigDisassociateVmCategoriesParams, args).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n esxiConfigDisassociateVmCategoriesParams\ \ = ntnx_vmm_py_client.EsxiConfigDisassociateVmCategoriesParams()\n\n \ \ # EsxiConfigDisassociateVmCategoriesParams object initializations here...\n\ \ esxiConfigDisassociateVmCategoriesParams.categories = [] # required\ \ field\n \n ext_id = \"b2acfd0f-5cEc-8A1d-E4E5-cB6aE98B7f8b\"\n\n\ \ \"\"\"\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = esxi_vm_api.disassociate_categories(extId=ext_id,\ \ body=esxiConfigDisassociateVmCategoriesParams, if_match=etag_value)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n esxiConfigDisassociateVmCategoriesParams\ \ := import1.NewEsxiConfigDisassociateVmCategoriesParams()\n\n // EsxiConfigDisassociateVmCategoriesParams\ \ object initializations here...\n\n \n extId := \"fcCEeef9-B18E-D720-0f0d-feb716acc7ED\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.DisassociateCategoriesRequest{ ExtId: &extId,\ \ Body: esxiConfigDisassociateVmCategoriesParams }\n response, error\ \ := EsxiVmServiceApiInstance.DisassociateCategories(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/cAbA01cb-eb79-C9D1-ea70-0aA69ECfed60/$actions/disassociate-categories" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"categories":[{"extId":"string","$objectType":"vmm.v4.esxi.config.CategoryReference"}],"$objectType":"vmm.v4.esxi.config.DisassociateVmCategoriesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"categories":[{"extId":"string","$objectType":"vmm.v4.esxi.config.CategoryReference"}],"$objectType":"vmm.v4.esxi.config.DisassociateVmCategoriesParams"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/dEDC9dB2-aFbA-Ff0f-BC95-8f86F6b47b8c/$actions/disassociate-categories" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n EsxiConfigDisassociateVmCategoriesParams\ \ esxiConfigDisassociateVmCategoriesParams = new EsxiConfigDisassociateVmCategoriesParams();\n\ \n // EsxiConfigDisassociateVmCategoriesParams object initializations\ \ here...\n esxiConfigDisassociateVmCategoriesParams.Categories = new\ \ ArrayList(); // required field\n\n String extId = \"e0EA2edB-B10F-BAf4-a68D-5ffcDFbeAEC5\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new DisassociateCategoriesRequest\ \ {\n ExtId = extId,\n Body = esxiConfigDisassociateVmCategoriesParams,\n\ \ \n \n };\n try {\n EsxiConfigDisassociateCategoriesApiResponse\ \ esxiConfigDisassociateCategoriesApiResponse = esxiVmApi.DisassociateCategories(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}: get: tags: - EsxiVm summary: Get VM configuration details description: Retrieves configuration details for a virtual machine. operationId: getVmById parameters: - name: extId in: path description: The globally unique identifier of an instance of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8cbff9fd-d979-42af-9c2e-d4a6d833ec29 responses: "200": description: Returns the configuration details for a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.esxi.config.Vm' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}\ \ Get operation" x-permissions: operationName: View ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Storage Admin - name: Disaster Recovery Admin - name: Disaster Recovery Viewer - name: Backup Admin x-rate-limit: - type: xsmall count: 6 timeUnit: seconds - type: Small count: 12 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.GetVmByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.GetVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"EBEeE98f-8EaE-FbcA-eC8a-0e829Eb6E1E7\";\n\n \ \ try {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n EsxiConfigGetVmApiResponse\ \ esxiConfigGetVmApiResponse = esxiVmApi.getVmById(GetVmByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(esxiConfigGetVmApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"EBBB60BB-84cA-ccB2-7feD-Ca1eF336cCEa\";\n\n\n\n\ \n\n esxiVmApi.getVmById(extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"C8bDC026-6c1D-7EEA-fCeb-cd4faAcCb4cD\"\n\n\n try:\n api_response\ \ = esxi_vm_api.get_vm_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"eeaACD09-D2F3-CeE5-91CE-FD1aE7Ef0fa1\"\ \n\n\n request := esxivm.GetVmByIdRequest{ ExtId: &extId }\n response,\ \ error := EsxiVmServiceApiInstance.GetVmById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.Vm)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/63277DF6-a6fF-c3eD-e6Ea-B9BA1ca11C8F" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/9E967FbA-f42c-0Dea-dA6D-01C464CDacDe" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"Db81Ff4B-febB-bc9e-A1B7-fDaB4CDDCCB4\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetVmByIdRequest {\n ExtId = extId\n };\n \ \ try {\n EsxiConfigGetVmApiResponse esxiConfigGetVmApiResponse\ \ = esxiVmApi.GetVmById(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms: get: tags: - EsxiVm summary: List VMs description: Lists the Virtual Machines defined on the system. List of Virtual Machines can be further filtered out using various filtering options. operationId: listVms parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: cluster/extId example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=cluster/extId\ \ eq 'f6110938-7cf2-42b0-9789-ffc7ed5b4349'" - name: guestOsName example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=guestOsName\ \ eq 'CentOS 7 (64-bit)'" - name: host/extId example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=host/extId\ \ eq '06e9dc8b-6b63-4290-a244-8078aa56882d'" - name: memorySizeBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=memorySizeBytes\ \ eq 60" - name: name example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=name\ \ eq 'Test VM'" - name: numCoresPerSocket example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=numCoresPerSocket\ \ eq 45" - name: numCpus example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=numCpus\ \ eq 47" - name: nutanixGuestTools/guestInfo/dnsName/value example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=nutanixGuestTools/guestInfo/dnsName/value\ \ eq 'string'" - name: nutanixGuestTools/guestInfo/guestOsBuildNumber example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=nutanixGuestTools/guestInfo/guestOsBuildNumber\ \ eq 'string'" - name: nutanixGuestTools/guestInfo/installedVirtIoVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=nutanixGuestTools/guestInfo/installedVirtIoVersion\ \ eq 'string'" - name: nutanixGuestTools/guestInfo/lastBootUpTime example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=nutanixGuestTools/guestInfo/lastBootUpTime\ \ eq '2009-09-23T14:30:00-07:00'" - name: powerState example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=powerState\ \ eq Vmm.Esxi.Config.PowerState'ON'" - name: virtualHardwareVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$filter=virtualHardwareVersion\ \ eq 32" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: guestOsName example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=guestOsName" - name: memorySizeBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=memorySizeBytes" - name: name example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=name" - name: numCoresPerSocket example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=numCoresPerSocket" - name: numCpus example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=numCpus" - name: nutanixGuestTools/guestInfo/dnsName/value example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=nutanixGuestTools/guestInfo/dnsName/value" - name: nutanixGuestTools/guestInfo/installedVirtIoVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=nutanixGuestTools/guestInfo/installedVirtIoVersion" - name: nutanixGuestTools/guestInfo/lastBootUpTime example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=nutanixGuestTools/guestInfo/lastBootUpTime" - name: virtualHardwareVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$orderby=virtualHardwareVersion" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: categories example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=categories" - name: cdRoms example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=cdRoms" - name: cluster/extId example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=cluster/extId" - name: description example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=description" - name: disks example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=disks" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=extId" - name: guestOsName example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=guestOsName" - name: host/extId example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=host/extId" - name: links example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=links" - name: memorySizeBytes example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=memorySizeBytes" - name: name example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=name" - name: nics example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nics" - name: numCoresPerSocket example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=numCoresPerSocket" - name: numCpus example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=numCpus" - name: nutanixGuestTools/availableVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/availableVersion" - name: nutanixGuestTools/capabilities example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/capabilities" - name: nutanixGuestTools/guestInfo/dnsName/value example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestInfo/dnsName/value" - name: nutanixGuestTools/guestInfo/guestOsBuildNumber example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestInfo/guestOsBuildNumber" - name: nutanixGuestTools/guestInfo/guestOsFullName example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestInfo/guestOsFullName" - name: nutanixGuestTools/guestInfo/installedVirtIoVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestInfo/installedVirtIoVersion" - name: nutanixGuestTools/guestInfo/isVmMobilityDriversInstalled example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestInfo/isVmMobilityDriversInstalled" - name: nutanixGuestTools/guestInfo/lastBootUpTime example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestInfo/lastBootUpTime" - name: nutanixGuestTools/guestOsVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/guestOsVersion" - name: nutanixGuestTools/isEnabled example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/isEnabled" - name: nutanixGuestTools/isInstalled example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/isInstalled" - name: nutanixGuestTools/isIsoInserted example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/isIsoInserted" - name: nutanixGuestTools/isReachable example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/isReachable" - name: nutanixGuestTools/isVmMobilityDriversInstalled example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/isVmMobilityDriversInstalled" - name: nutanixGuestTools/isVssSnapshotCapable example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/isVssSnapshotCapable" - name: nutanixGuestTools/version example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=nutanixGuestTools/version" - name: ownershipInfo/owner example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=ownershipInfo/owner" - name: powerState example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=powerState" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=tenantId" - name: virtualHardwareVersion example: "https://{host}:{port}/api/vmm/v4.2/esxi/config/vms?$select=virtualHardwareVersion" responses: "200": description: Returns the list of virtual machines. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.Vm' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/config/vms Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/config/vms Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/config/vms Get operation x-permissions: operationName: View ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Storage Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.ListVmsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.ListVmsApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ int page = 0;\n \n int limit = 50;\n\n try {\n\ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n EsxiConfigListVmsApiResponse esxiConfigListVmsApiResponse\ \ = esxiVmApi.listVms(ListVmsRequest.builder()\n .$page(page)\n\ \ .$limit(limit)\n .$filter(null)\n \ \ .$orderby(null)\n .$select(null)\n \ \ .build());\n\n System.out.println(esxiConfigListVmsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, EsxiVmApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let esxiVmApi = new EsxiVmApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; esxiVmApi.listVms(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n page = 0\n\ \ \n limit = 50\n\n\n try:\n api_response = esxi_vm_api.list_vms(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := esxivm.ListVmsRequest{ Page_: &page_, Limit_:\ \ &limit_, Filter_: nil, Orderby_: nil, Select_: nil }\n response, error\ \ := EsxiVmServiceApiInstance.ListVms(ctx, &request)\n if error != nil\ \ {\n fmt.Println(error)\n return\n }\n data, _ := response.GetData().([]import1.Vm)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n int page = 0;\n int limit = 50;\n\ \ String filter = \"string_sample_data\";\n String orderby = \"\ string_sample_data\";\n String select = \"string_sample_data\";\n\n\ \ // Create request object with parameters\n var request =\ \ new ListVmsRequest {\n Page = page,\n Limit = limit,\n\ \ Filter = filter,\n Orderby = orderby,\n \ \ Select = select\n };\n try {\n EsxiConfigListVmsApiResponse\ \ esxiConfigListVmsApiResponse = esxiVmApi.ListVms(request);\n }\ \ catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/revert: post: tags: - EsxiVm summary: Revert the ESXi VM. description: "Revert VM identified by {extId}. This does an in-place VM restore\ \ from a specified VM Recovery Point." operationId: revertVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 530ef4c7-c0cd-4cfc-83a7-55debaa7b38d - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: fcc2e7be-0bc5-4cfc-b6e8-db1008a4585b requestBody: description: Input for the VM revert operation. Specify the VM Recovery Point ID to which the VM would be reverted. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.RevertParams' required: true responses: "202": description: Task Id to monitor the progress of VM revert operation. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/revert\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/revert\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/revert\ \ Post operation" x-permissions: operationName: Revert ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Disaster Recovery Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 1 timeUnit: seconds - type: small count: 1 timeUnit: seconds - type: large count: 1 timeUnit: seconds - type: xlarge count: 1 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.RevertVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.RevertParams;\nimport com.nutanix.dp1.vmm.vmm.v4.esxi.config.RevertVmApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n EsxiConfigRevertParams\ \ esxiConfigRevertParams = new EsxiConfigRevertParams();\n\n // EsxiConfigRevertParams\ \ object initializations here...\n esxiConfigRevertParams.setVmRecoveryPointExtId(\"\ bdF1c4D0-Ee6e-4bB0-ccaD-3eBF5cCeaCED\"); // required field\n \n\ \ String extId = \"CD8B3C7C-0aA3-2AE2-7d0c-B4fFEeaDC6D8\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigRevertVmApiResponse esxiConfigRevertVmApiResponse = esxiVmApi.revertVm(RevertVmRequest.builder()\n\ \ .extId(extId)\n .build(), esxiConfigRevertParams,\ \ opts);\n\n System.out.println(esxiConfigRevertVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, RevertParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let esxiConfigRevertParams = new EsxiConfigRevertParams();\n\n //\ \ EsxiConfigRevertParams object initializations here...\n esxiConfigRevertParams.setVmRecoveryPointExtId(\"\ 0b24A387-eFcF-Ec03-FE5A-5fcC9F0FEbE1\"); // required field\n esxiConfigRevertParams\ \ = JSON.stringify(esxiConfigRevertParams);\n\n \n let extId = \"\ F9bcBc71-FeFc-1B6e-Bf5F-07b2dfeEa3A0\";\n\n\n /*\n Some Create, Update,\ \ and Delete operations generally require an If-Match header with a value\ \ to be passed in order to protect against concurrent updates.\n The\ \ value that needs to be sent in the If-Match header needs to be retrieved\ \ by performing a Read(Get) operation on the same resource.\n ETags can\ \ be retrieved by calling a static method of ApiClient as below:\n let\ \ etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\" : etagValue};\n\ \ */\n esxiVmApi.revertVm(extId, esxiConfigRevertParams, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n esxiConfigRevertParams\ \ = ntnx_vmm_py_client.EsxiConfigRevertParams()\n\n # EsxiConfigRevertParams\ \ object initializations here...\n esxiConfigRevertParams.vm_recovery_point_ext_id\ \ = \"fE393deB-d7d5-bC3F-D32B-fccbbECbC7FD\" # required field\n \n \ \ ext_id = \"A30BC697-3b0b-EEd2-D10a-eE3aAd74fE6D\"\n\n \"\"\"\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.revert_vm(extId=ext_id, body=esxiConfigRevertParams,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n esxiConfigRevertParams := import1.NewEsxiConfigRevertParams()\n\ \n // EsxiConfigRevertParams object initializations here...\n\n \n\ \ extId := \"9FFc5F1D-FcfB-F07C-2A83-EBc1C8B8CFdB\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := esxivm.RevertVmRequest{ ExtId: &extId, Body: esxiConfigRevertParams\ \ }\n response, error := EsxiVmServiceApiInstance.RevertVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/5295fEeE-95ef-d84a-Ce7B-bbf2Fcb8fae7/$actions/revert" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"vmRecoveryPointExtId":"string","$objectType":"vmm.v4.esxi.config.RevertParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"vmRecoveryPointExtId":"string","$objectType":"vmm.v4.esxi.config.RevertParams"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/14ACD2a0-AcDd-eEeb-FaFb-ad2fa98d2cAa/$actions/revert" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n EsxiConfigRevertParams esxiConfigRevertParams\ \ = new EsxiConfigRevertParams();\n\n // EsxiConfigRevertParams object\ \ initializations here...\n esxiConfigRevertParams.VmRecoveryPointExtId\ \ = \"Bc97BCEB-DE7B-E3Db-bCF2-EDffaAA5Fa4a\"; // required field\n\n \ \ String extId = \"FbC5Cb1d-3fA0-8412-5ADC-daEaC048EB3a\";\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new RevertVmRequest {\n\ \ ExtId = extId,\n Body = esxiConfigRevertParams,\n\ \ \n \n };\n try {\n EsxiConfigRevertVmApiResponse\ \ esxiConfigRevertVmApiResponse = esxiVmApi.RevertVm(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools: get: tags: - EsxiVm summary: Get VM NGT configuration description: Retrieves the Nutanix Guest Tools configuration for a virtual machine. operationId: getNutanixGuestToolsById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: f0a0e37e-f9ff-4deb-ad15-ee9ae01d246a responses: "200": description: Returns the Nutanix Guest Tools configuration for a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestTools' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Get operation" x-permissions: operationName: View ESXi Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Storage Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 6 timeUnit: seconds - type: Small count: 12 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.GetNutanixGuestToolsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.GetNutanixGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"ebDED9F8-a8Ec-3EcF-bc01-F61bcbaF33Ab\";\n\n \ \ try {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n GetNutanixGuestToolsApiResponse\ \ getNutanixGuestToolsApiResponse = esxiVmApi.getNutanixGuestToolsById(GetNutanixGuestToolsByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getNutanixGuestToolsApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"D4AcdBFd-954C-EEBa-DE0B-BFa853AE8feB\";\n\n\n\n\ \n\n esxiVmApi.getNutanixGuestToolsById(extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"A7DdECea-DBbd-ddc3-920E-aC7FbFe0f7bb\"\n\n\n try:\n api_response\ \ = esxi_vm_api.get_nutanix_guest_tools_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"450ccBB3-Adb7-e0ED-D7df-bdA1cbeca2aC\"\ \n\n\n request := esxivm.GetNutanixGuestToolsByIdRequest{ ExtId: &extId\ \ }\n response, error := EsxiVmServiceApiInstance.GetNutanixGuestToolsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.NutanixGuestTools)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/daeA21Fc-cBFc-ABEb-c254-160AAC9bc4Cb/nutanix-guest-tools" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/DBa8EccC-cBEf-ae73-B527-a10addAFF41E/nutanix-guest-tools" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"4CFE1c5E-C5EB-Ff5e-ACF4-05da2abCfE4A\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetNutanixGuestToolsByIdRequest {\n ExtId = extId\n \ \ };\n try {\n GetNutanixGuestToolsApiResponse getNutanixGuestToolsApiResponse\ \ = esxiVmApi.GetNutanixGuestToolsById(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" put: tags: - EsxiVm summary: Update NGT configuration for a VM description: Updates the Nutanix Guest Tools configuration for a virtual machine. operationId: updateNutanixGuestToolsById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: dc348c34-a491-440a-bc5c-3da5c82065ce - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 591615a1-7d45-4a9e-8c3f-caabd4eac3da requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestTools' required: true responses: "202": description: The request to update NGT configuration for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Put operation" x-permissions: operationName: Update ESXi Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.UpdateNutanixGuestToolsByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestTools;\nimport com.nutanix.dp1.vmm.vmm.v4.esxi.config.UpdateNutanixGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n NutanixGuestTools\ \ nutanixGuestTools = NutanixGuestTools.UNKNOWN;\n\n // NutanixGuestTools\ \ object initializations here...\n \n String extId = \"9BacB4Ce-5DCc-D1e1-bFC3-aAFe2aEdfca6\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ UpdateNutanixGuestToolsApiResponse updateNutanixGuestToolsApiResponse\ \ = esxiVmApi.updateNutanixGuestToolsById(UpdateNutanixGuestToolsByIdRequest.builder()\n\ \ .extId(extId)\n .build(), nutanixGuestTools,\ \ opts);\n\n System.out.println(updateNutanixGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, NutanixGuestTools } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let nutanixGuestTools = NutanixGuestTools.UNKNOWN;\n\n // NutanixGuestTools\ \ object initializations here...\n nutanixGuestTools = JSON.stringify(nutanixGuestTools);\n\ \n \n let extId = \"C5c8F1Aa-1DaD-bCeC-94C4-dDdAd44e11dA\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.updateNutanixGuestToolsById(extId,\ \ nutanixGuestTools, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n nutanixGuestTools\ \ = ntnx_vmm_py_client.NutanixGuestTools._UNKNOWN\n\n # NutanixGuestTools\ \ object initializations here...\n \n ext_id = \"BB9d4aBD-64bE-Cf5c-cC0a-9EEA9D2aEf3f\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = esxi_vm_api.update_nutanix_guest_tools_by_id(extId=ext_id,\ \ body=nutanixGuestTools, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n nutanixGuestTools := import1.NewNutanixGuestTools()\n\ \n // NutanixGuestTools object initializations here...\n\n \n extId\ \ := \"d61bB6d4-2dba-F36e-3CeE-348cdBC06eF2\"\n\n /*\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := esxivm.UpdateNutanixGuestToolsByIdRequest{ ExtId: &extId, Body:\ \ nutanixGuestTools }\n response, error := EsxiVmServiceApiInstance.UpdateNutanixGuestToolsById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/EaBCFddb-EdCe-CAdB-BCCF-f1D7EedCBeFb/nutanix-guest-tools" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string","$objectType":"common.v1.config.FQDN"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.esxi.config.GuestInfo"},"$objectType":"vmm.v4.esxi.config.NutanixGuestTools"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string","$objectType":"common.v1.config.FQDN"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.esxi.config.GuestInfo"},"$objectType":"vmm.v4.esxi.config.NutanixGuestTools"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/d5D3eF6c-dCDe-0Aec-F1e6-da5BbE2BE0C5/nutanix-guest-tools" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n NutanixGuestTools nutanixGuestTools\ \ = NutanixGuestTools.UNKNOWN;\n\n // NutanixGuestTools object initializations\ \ here...\n\n String extId = \"7bCEBDD6-3BFF-f0eA-4a68-Fa95d0b1cbDC\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new UpdateNutanixGuestToolsByIdRequest\ \ {\n ExtId = extId,\n Body = nutanixGuestTools,\n\ \ \n \n };\n try {\n UpdateNutanixGuestToolsApiResponse\ \ updateNutanixGuestToolsApiResponse = esxiVmApi.UpdateNutanixGuestToolsById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install: post: tags: - EsxiVm summary: Install NGT in a VM description: Installs Nutanix Guest Tools in a Virtual Machine by using the provided credentials. operationId: installNutanixGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b93743b2-109d-46aa-8ba0-31f97d9d842b - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f0398c81-bdeb-4ea3-9955-171a3e576798 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestToolsInstallConfig' required: true responses: "202": description: The request to install NGT VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install\ \ Post operation" x-permissions: operationName: Install ESXi Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.InstallNutanixGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixCredential;\nimport com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestToolsInstallConfig;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.InstallNutanixGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n NutanixGuestToolsInstallConfig\ \ nutanixGuestToolsInstallConfig = new NutanixGuestToolsInstallConfig();\n\ \n // NutanixGuestToolsInstallConfig object initializations here...\n\ \ nutanixGuestToolsInstallConfig.setCredential(new NutanixCredential());\ \ // required field\n \n String extId = \"FDb2dc3d-8Bc2-6f1b-eCdF-EcA87eCD1b50\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ InstallNutanixGuestToolsApiResponse installNutanixGuestToolsApiResponse\ \ = esxiVmApi.installNutanixGuestTools(InstallNutanixGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), nutanixGuestToolsInstallConfig,\ \ opts);\n\n System.out.println(installNutanixGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, NutanixCredential, NutanixGuestToolsInstallConfig\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let nutanixGuestToolsInstallConfig = new NutanixGuestToolsInstallConfig();\n\ \n // NutanixGuestToolsInstallConfig object initializations here...\n\ \ nutanixGuestToolsInstallConfig.setCredential(new NutanixCredential());\ \ // required field\n nutanixGuestToolsInstallConfig = JSON.stringify(nutanixGuestToolsInstallConfig);\n\ \n \n let extId = \"c5CDDF48-f39a-C1ef-EFCC-dD3DDEC6e8eD\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.installNutanixGuestTools(extId,\ \ nutanixGuestToolsInstallConfig, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n nutanixGuestToolsInstallConfig\ \ = ntnx_vmm_py_client.NutanixGuestToolsInstallConfig()\n\n # NutanixGuestToolsInstallConfig\ \ object initializations here...\n nutanixGuestToolsInstallConfig.credential\ \ = ntnx_vmm_py_client.NutanixCredential() # required field\n \n \ \ ext_id = \"F90788b2-d7F8-6f9B-57dD-Cb18Fe22afCa\"\n\n \"\"\"\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.install_nutanix_guest_tools(extId=ext_id,\ \ body=nutanixGuestToolsInstallConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n nutanixGuestToolsInstallConfig :=\ \ import1.NewNutanixGuestToolsInstallConfig()\n\n // NutanixGuestToolsInstallConfig\ \ object initializations here...\n\n \n extId := \"A5DFcc5F-86B9-afd3-dE7E-B2E0a7e219Ef\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.InstallNutanixGuestToolsRequest{ ExtId:\ \ &extId, Body: nutanixGuestToolsInstallConfig }\n response, error :=\ \ EsxiVmServiceApiInstance.InstallNutanixGuestTools(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/7b79Fb3c-9Da4-cCAF-7cD0-A37fEA4df1FE/nutanix-guest-tools/$actions/install" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"capabilities":["$UNKNOWN"],"credential":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.esxi.config.NutanixCredential"},"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.esxi.config.NutanixRebootPreferenceSchedule"},"$objectType":"vmm.v4.esxi.config.NutanixRebootPreference"},"$objectType":"vmm.v4.esxi.config.NutanixGuestToolsInstallConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"capabilities":["$UNKNOWN"],"credential":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.esxi.config.NutanixCredential"},"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.esxi.config.NutanixRebootPreferenceSchedule"},"$objectType":"vmm.v4.esxi.config.NutanixRebootPreference"},"$objectType":"vmm.v4.esxi.config.NutanixGuestToolsInstallConfig"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/Da3FA0de-f83e-32af-bAFc-7Fa1F6c861ff/nutanix-guest-tools/$actions/install" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n NutanixGuestToolsInstallConfig nutanixGuestToolsInstallConfig\ \ = new NutanixGuestToolsInstallConfig();\n\n // NutanixGuestToolsInstallConfig\ \ object initializations here...\n nutanixGuestToolsInstallConfig.Credential\ \ = new NutanixCredential(); // required field\n\n String extId =\ \ \"3086Eda6-8AE7-0EFF-8dF1-684bea4fAEcd\";\n\n /*\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.GetEtag(getResponse);\n \ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new InstallNutanixGuestToolsRequest\ \ {\n ExtId = extId,\n Body = nutanixGuestToolsInstallConfig,\n\ \ \n \n };\n try {\n InstallNutanixGuestToolsApiResponse\ \ installNutanixGuestToolsApiResponse = esxiVmApi.InstallNutanixGuestTools(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade: post: tags: - EsxiVm summary: Upgrade NGT inside a VM description: Trigger an in-guest upgrade of Nutanix Guest Tools. operationId: upgradeNutanixGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 21aae8f9-6761-4442-81e5-576c73ca1e60 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 575be625-02b6-451a-a4ce-89e72464eb02 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestToolsUpgradeConfig' required: true responses: "202": description: The request to upgrade NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade\ \ Post operation" x-permissions: operationName: Upgrade ESXi Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.UpgradeNutanixGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestToolsUpgradeConfig;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.UpgradeNutanixGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n NutanixGuestToolsUpgradeConfig\ \ nutanixGuestToolsUpgradeConfig = new NutanixGuestToolsUpgradeConfig();\n\ \n // NutanixGuestToolsUpgradeConfig object initializations here...\n\ \ \n String extId = \"bAFaacAb-09C7-fb06-b0EC-109F0FBB1BCa\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ UpgradeNutanixGuestToolsApiResponse upgradeNutanixGuestToolsApiResponse\ \ = esxiVmApi.upgradeNutanixGuestTools(UpgradeNutanixGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), nutanixGuestToolsUpgradeConfig,\ \ opts);\n\n System.out.println(upgradeNutanixGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, NutanixGuestToolsUpgradeConfig }\ \ from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let nutanixGuestToolsUpgradeConfig = new NutanixGuestToolsUpgradeConfig();\n\ \n // NutanixGuestToolsUpgradeConfig object initializations here...\n\ \ nutanixGuestToolsUpgradeConfig = JSON.stringify(nutanixGuestToolsUpgradeConfig);\n\ \n \n let extId = \"DC5b9aBB-6DEB-dc4C-aCba-31e50FcDeECF\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.upgradeNutanixGuestTools(extId,\ \ nutanixGuestToolsUpgradeConfig, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n nutanixGuestToolsUpgradeConfig\ \ = ntnx_vmm_py_client.NutanixGuestToolsUpgradeConfig()\n\n # NutanixGuestToolsUpgradeConfig\ \ object initializations here...\n \n ext_id = \"6FCc36AF-47Cc-7F7B-BaF4-6AC4FECC3E0f\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = esxi_vm_api.upgrade_nutanix_guest_tools(extId=ext_id,\ \ body=nutanixGuestToolsUpgradeConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n nutanixGuestToolsUpgradeConfig :=\ \ import1.NewNutanixGuestToolsUpgradeConfig()\n\n // NutanixGuestToolsUpgradeConfig\ \ object initializations here...\n\n \n extId := \"B2CedFbe-b2cd-90BF-e1DB-7f4FCF6eEbEf\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.UpgradeNutanixGuestToolsRequest{ ExtId:\ \ &extId, Body: nutanixGuestToolsUpgradeConfig }\n response, error :=\ \ EsxiVmServiceApiInstance.UpgradeNutanixGuestTools(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/A91FFD8A-5DDa-D170-eBba-CCdDD1e6aeA8/nutanix-guest-tools/$actions/upgrade" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.esxi.config.NutanixRebootPreferenceSchedule"},"$objectType":"vmm.v4.esxi.config.NutanixRebootPreference"},"$objectType":"vmm.v4.esxi.config.NutanixGuestToolsUpgradeConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.esxi.config.NutanixRebootPreferenceSchedule"},"$objectType":"vmm.v4.esxi.config.NutanixRebootPreference"},"$objectType":"vmm.v4.esxi.config.NutanixGuestToolsUpgradeConfig"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/E75a653c-BB2e-dBAe-B69A-bfcddbbdDccA/nutanix-guest-tools/$actions/upgrade" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n NutanixGuestToolsUpgradeConfig nutanixGuestToolsUpgradeConfig\ \ = new NutanixGuestToolsUpgradeConfig();\n\n // NutanixGuestToolsUpgradeConfig\ \ object initializations here...\n\n String extId = \"2CbDeAD1-B9D6-aCdC-0afC-AFBbefe9daDd\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new UpgradeNutanixGuestToolsRequest\ \ {\n ExtId = extId,\n Body = nutanixGuestToolsUpgradeConfig,\n\ \ \n \n };\n try {\n UpgradeNutanixGuestToolsApiResponse\ \ upgradeNutanixGuestToolsApiResponse = esxiVmApi.UpgradeNutanixGuestTools(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso: post: tags: - EsxiVm summary: Insert NGT ISO into an available CD-ROM for a VM description: Inserts the Nutanix Guest Tools installation and configuration ISO into a virtual machine. operationId: insertNutanixGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 611f18ad-b277-4889-bbde-43443d42715b - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 5eab8973-cd39-456e-af55-704abb6398c8 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestToolsInsertConfig' required: true responses: "202": description: The request to insert NGT ISO for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso\ \ Post operation" x-permissions: operationName: Insert ESXi Virtual Machine NGT ISO deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.InsertNutanixGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestToolsInsertConfig;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.InsertNutanixGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n NutanixGuestToolsInsertConfig\ \ nutanixGuestToolsInsertConfig = new NutanixGuestToolsInsertConfig();\n\ \n // NutanixGuestToolsInsertConfig object initializations here...\n\ \ \n String extId = \"EbcDDfD9-A2aF-C9D6-beb1-6Cbbd1BBF8DE\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ InsertNutanixGuestToolsApiResponse insertNutanixGuestToolsApiResponse\ \ = esxiVmApi.insertNutanixGuestTools(InsertNutanixGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), nutanixGuestToolsInsertConfig,\ \ opts);\n\n System.out.println(insertNutanixGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, NutanixGuestToolsInsertConfig }\ \ from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let nutanixGuestToolsInsertConfig = new NutanixGuestToolsInsertConfig();\n\ \n // NutanixGuestToolsInsertConfig object initializations here...\n\ \ nutanixGuestToolsInsertConfig = JSON.stringify(nutanixGuestToolsInsertConfig);\n\ \n \n let extId = \"d46B5FEe-9cAc-d5DE-e2db-8aCACaD0a763\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.insertNutanixGuestTools(extId,\ \ nutanixGuestToolsInsertConfig, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n nutanixGuestToolsInsertConfig\ \ = ntnx_vmm_py_client.NutanixGuestToolsInsertConfig()\n\n # NutanixGuestToolsInsertConfig\ \ object initializations here...\n \n ext_id = \"dfBc4612-1cEc-3FBA-DEF4-A73EbE6eF53d\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = esxi_vm_api.insert_nutanix_guest_tools(extId=ext_id,\ \ body=nutanixGuestToolsInsertConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n nutanixGuestToolsInsertConfig :=\ \ import1.NewNutanixGuestToolsInsertConfig()\n\n // NutanixGuestToolsInsertConfig\ \ object initializations here...\n\n \n extId := \"CdC7d9bD-7C1a-fBa4-b2Db-0fde4cd5bbf0\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.InsertNutanixGuestToolsRequest{ ExtId:\ \ &extId, Body: nutanixGuestToolsInsertConfig }\n response, error :=\ \ EsxiVmServiceApiInstance.InsertNutanixGuestTools(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/B2fb9Cf7-Ef47-BDD0-9E2D-daC006eDCDDD/nutanix-guest-tools/$actions/insert-iso" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"capabilities":["$UNKNOWN"],"$objectType":"vmm.v4.esxi.config.NutanixGuestToolsInsertConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"capabilities":["$UNKNOWN"],"$objectType":"vmm.v4.esxi.config.NutanixGuestToolsInsertConfig"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/29a8faBe-DFaF-75fD-92cb-CE4eBd2BAA9D/nutanix-guest-tools/$actions/insert-iso" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n NutanixGuestToolsInsertConfig nutanixGuestToolsInsertConfig\ \ = new NutanixGuestToolsInsertConfig();\n\n // NutanixGuestToolsInsertConfig\ \ object initializations here...\n\n String extId = \"fdaA1532-bD9D-eeC8-Eccf-0CfCCaaa3feA\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new InsertNutanixGuestToolsRequest\ \ {\n ExtId = extId,\n Body = nutanixGuestToolsInsertConfig,\n\ \ \n \n };\n try {\n InsertNutanixGuestToolsApiResponse\ \ insertNutanixGuestToolsApiResponse = esxiVmApi.InsertNutanixGuestTools(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall: post: tags: - EsxiVm summary: Uninstall NGT from a VM description: Trigger an in-guest uninstallation of Nutanix Guest Tools. operationId: uninstallNutanixGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ea08eed5-aaa6-47ee-92eb-59ccbd88817e - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 27a5967b-e277-4a34-9590-ddc7dedeeb20 responses: "202": description: The request to uninstall NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall\ \ Post operation" x-permissions: operationName: Uninstall ESXi Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.UninstallNutanixGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.UninstallNutanixGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"3EB4bcBB-a6fF-cDEb-D3cB-Be7f4eC2aFe1\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ UninstallNutanixGuestToolsApiResponse uninstallNutanixGuestToolsApiResponse\ \ = esxiVmApi.uninstallNutanixGuestTools(UninstallNutanixGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(uninstallNutanixGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"134BdbdC-abBb-Ab9e-1aA8-AdbBfff73fCF\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.uninstallNutanixGuestTools(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"CACAb5B6-608b-Cced-3EaB-C07A7a2AaCa3\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.uninstall_nutanix_guest_tools(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"6Ff1471E-6F74-Acef-4B6E-1aDEED56f65F\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.UninstallNutanixGuestToolsRequest{ ExtId:\ \ &extId }\n response, error := EsxiVmServiceApiInstance.UninstallNutanixGuestTools(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/E966d037-AE4F-cFDF-1AdA-DC1B2DE7a84c/nutanix-guest-tools/$actions/uninstall" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/1AcCef9F-50EE-2a6C-8e55-DAafc84F79df/nutanix-guest-tools/$actions/uninstall" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"02fB9cFb-dDc6-EcDA-A86d-DdFEEe9dcAB2\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new UninstallNutanixGuestToolsRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n UninstallNutanixGuestToolsApiResponse uninstallNutanixGuestToolsApiResponse\ \ = esxiVmApi.UninstallNutanixGuestTools(request, opts);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/assign-owner: post: tags: - EsxiVm summary: Assign owner of a VM description: Assign the owner of a virtual machine. operationId: assignVmOwner parameters: - name: extId in: path description: The globally unique identifier of an instance of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: cfd17366-77cb-4b2a-8ae4-197934436b59 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 9ce0c3cc-4349-4e99-9e03-0f8a674e120a requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.esxi.config.OwnershipInfo' required: true responses: "202": description: The request to assign an owner of a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/assign-owner\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/assign-owner\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/assign-owner\ \ Post operation" x-permissions: operationName: Assign ESXi Virtual Machine Owner deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.AssignVmOwnerRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.OwnerReference;\nimport com.nutanix.dp1.vmm.vmm.v4.esxi.config.OwnershipInfo;\n\ import com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssignVmOwnerApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n EsxiConfigOwnershipInfo\ \ esxiConfigOwnershipInfo = new EsxiConfigOwnershipInfo();\n\n //\ \ EsxiConfigOwnershipInfo object initializations here...\n esxiConfigOwnershipInfo.setOwner(new\ \ EsxiConfigOwnerReference()); // required field\n \n String\ \ extId = \"c3B9CDb7-E688-Bfbb-2F52-BEd4f0ECfCee\";\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header\ \ needs to be retrieved by performing a Read(Get) operation on the same\ \ resource.\n ETags can be retrieved by calling a static method of\ \ ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigAssignVmOwnerApiResponse esxiConfigAssignVmOwnerApiResponse\ \ = esxiVmApi.assignVmOwner(AssignVmOwnerRequest.builder()\n \ \ .extId(extId)\n .build(), esxiConfigOwnershipInfo,\ \ opts);\n\n System.out.println(esxiConfigAssignVmOwnerApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi, OwnerReference, OwnershipInfo }\ \ from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \ let esxiConfigOwnershipInfo = new EsxiConfigOwnershipInfo();\n\n \ \ // EsxiConfigOwnershipInfo object initializations here...\n esxiConfigOwnershipInfo.setOwner(new\ \ EsxiConfigOwnerReference()); // required field\n esxiConfigOwnershipInfo\ \ = JSON.stringify(esxiConfigOwnershipInfo);\n\n \n let extId = \"\ cb0C5ffb-9E1C-Cecc-Ceb9-4720CCf2fdC3\";\n\n\n /*\n Some Create, Update,\ \ and Delete operations generally require an If-Match header with a value\ \ to be passed in order to protect against concurrent updates.\n The\ \ value that needs to be sent in the If-Match header needs to be retrieved\ \ by performing a Read(Get) operation on the same resource.\n ETags can\ \ be retrieved by calling a static method of ApiClient as below:\n let\ \ etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\" : etagValue};\n\ \ */\n esxiVmApi.assignVmOwner(extId, esxiConfigOwnershipInfo, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n esxiConfigOwnershipInfo\ \ = ntnx_vmm_py_client.EsxiConfigOwnershipInfo()\n\n # EsxiConfigOwnershipInfo\ \ object initializations here...\n esxiConfigOwnershipInfo.owner = ntnx_vmm_py_client.EsxiConfigOwnerReference()\ \ # required field\n \n ext_id = \"e8ae1a9f-AC2D-5b9e-0B9a-b1C8fF8D9362\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = esxi_vm_api.assign_vm_owner(extId=ext_id,\ \ body=esxiConfigOwnershipInfo, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/esxi/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n esxiConfigOwnershipInfo := import1.NewEsxiConfigOwnershipInfo()\n\ \n // EsxiConfigOwnershipInfo object initializations here...\n\n \n\ \ extId := \"45CaDeae-0AEb-Ebcf-4cFc-fAdfb29E71ED\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := esxivm.AssignVmOwnerRequest{ ExtId: &extId, Body: esxiConfigOwnershipInfo\ \ }\n response, error := EsxiVmServiceApiInstance.AssignVmOwner(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/EA4fBeAB-f6d0-f5d6-aD4b-badbFeadD6Ed/$actions/assign-owner" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"owner":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.esxi.config.OwnerReference"},"$objectType":"vmm.v4.esxi.config.OwnershipInfo"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"owner":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.esxi.config.OwnerReference"},"$objectType":"vmm.v4.esxi.config.OwnershipInfo"} \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/eDfCC892-EeAD-d8EC-6CDf-ADFB7ECb0EDB/$actions/assign-owner" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n EsxiConfigOwnershipInfo esxiConfigOwnershipInfo\ \ = new EsxiConfigOwnershipInfo();\n\n // EsxiConfigOwnershipInfo object\ \ initializations here...\n esxiConfigOwnershipInfo.Owner = new EsxiConfigOwnerReference();\ \ // required field\n\n String extId = \"23Ea4f4e-cdab-DfE0-efad-F5120DBA9DbE\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new AssignVmOwnerRequest\ \ {\n ExtId = extId,\n Body = esxiConfigOwnershipInfo,\n\ \ \n \n };\n try {\n EsxiConfigAssignVmOwnerApiResponse\ \ esxiConfigAssignVmOwnerApiResponse = esxiVmApi.AssignVmOwner(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-on: post: tags: - EsxiVm summary: Power on or resume a VM description: Powers a Virtual Machine on or resumes it from the suspended state. operationId: powerOnVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d7fa16a0-cea1-4663-9a07-33e6744a24b9 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 07029756-fca6-42a0-84bc-7c780536c7ac responses: "202": description: The request to power on/resume a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-on\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-on\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-on\ \ Post operation" x-permissions: operationName: Power On ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.PowerOnVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.PowerOnVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"cfBEB6Ee-3CD3-eE70-E5c6-eA9EDebd3CE2\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigPowerOnVmApiResponse esxiConfigPowerOnVmApiResponse = esxiVmApi.powerOnVm(PowerOnVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(esxiConfigPowerOnVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"D5DB3cCC-dBe5-87eB-aB4F-bDFebF1FaBFD\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.powerOnVm(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"4bAAbA6F-1DA2-BB1a-c2f0-cD331fcD85fa\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.power_on_vm(extId=ext_id, if_match=etag_value)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"67Aa1B8e-0bAe-a5ea-c3C3-ACDEbdEFb01a\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.PowerOnVmRequest{ ExtId: &extId }\n \ \ response, error := EsxiVmServiceApiInstance.PowerOnVm(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/BEe9aacf-E66B-Ad9E-Dfb7-faCaad82AEbf/$actions/power-on" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/CF6B77fC-B7Cc-3490-852f-9FeFcf1cd7fA/$actions/power-on" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"d3B260B1-fbEF-E5ee-25FE-c3138A06BB87\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new PowerOnVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n EsxiConfigPowerOnVmApiResponse esxiConfigPowerOnVmApiResponse\ \ = esxiVmApi.PowerOnVm(request, opts);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-off: post: tags: - EsxiVm summary: Force power off a VM description: "Forceably shuts down a virtual machine which is equivalent to\ \ removing the power cable. Note: The forced shutdown may result in data loss\ \ if any operations are in progress during the shutdown." operationId: powerOffVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 250fb7d0-f2b4-4cb4-ab11-9156b2ae3abf - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 36656d3c-4140-4e99-995c-1ea01d89e941 responses: "202": description: The request to shut down a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-off\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-off\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-off\ \ Post operation" x-permissions: operationName: Power Off ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.PowerOffVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.PowerOffVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"FfCC50E9-ADB4-fDd9-8dDc-4Aed655DeAD0\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigPowerOffVmApiResponse esxiConfigPowerOffVmApiResponse = esxiVmApi.powerOffVm(PowerOffVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(esxiConfigPowerOffVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"fD0d7B0C-cDbB-710d-CCeD-1D4B937bffcc\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.powerOffVm(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"0BA10C7a-4ced-Df01-BBd7-2d09bdaADE33\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.power_off_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"8bF8F79a-d5bF-Ee43-4cDd-dfcAEaF1B89c\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.PowerOffVmRequest{ ExtId: &extId }\n \ \ response, error := EsxiVmServiceApiInstance.PowerOffVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/F08CA9d5-9fCc-1Ce7-FE7B-CDcfBb81Cd6f/$actions/power-off" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/1FA5B6eD-Fb32-EeFD-BdB9-De32fbffA9Df/$actions/power-off" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"0d7FC9c5-f544-AD08-fc8b-fC0EBa0Ace23\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new PowerOffVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n EsxiConfigPowerOffVmApiResponse esxiConfigPowerOffVmApiResponse\ \ = esxiVmApi.PowerOffVm(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/reset: post: tags: - EsxiVm summary: Reset an ESXi VM by sequentially powering it off and on description: Sequentially performs the power off and power on operations; any operation between these actions will fail. operationId: resetVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ddaba64a-1812-4bce-88b4-c3ebbe3f6ebf - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 4a4059f8-7eb1-4e3d-aabe-25fddede5aca responses: "202": description: The request to reset an ESXi VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/reset\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/reset\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/reset\ \ Post operation" x-permissions: operationName: Reset ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.ResetVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.ResetVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"CdcdCAfF-3Ac3-eAcb-2b5F-15d73BFbd3f7\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigResetVmApiResponse esxiConfigResetVmApiResponse = esxiVmApi.resetVm(ResetVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(esxiConfigResetVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"d92B6Eee-3e3E-CdAd-ff6a-AEc5EC5FaCC6\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.resetVm(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"08FdcBF6-9AbD-Fd5C-7E27-17880E2eD3Df\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.reset_vm(extId=ext_id, if_match=etag_value)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"bFAad4EE-Fb83-AE2E-fb08-Ff7AFF34eEEB\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.ResetVmRequest{ ExtId: &extId }\n response,\ \ error := EsxiVmServiceApiInstance.ResetVm(ctx, &request, args)\n if\ \ error != nil {\n fmt.Println(error)\n return\n }\n \ \ data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/fEA3C5b5-deD7-cC27-Abff-A51A0CbA6Ee0/$actions/reset" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/ebdCFEEe-D5E8-eB6e-d9c0-ecF2a1D3fB37/$actions/reset" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"bDfEd3a7-9ffC-FDBb-6eD7-eF2cc896FDB2\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ResetVmRequest {\n \ \ ExtId = extId,\n \n \n };\n \ \ try {\n EsxiConfigResetVmApiResponse esxiConfigResetVmApiResponse\ \ = esxiVmApi.ResetVm(request, opts);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/suspend: post: tags: - EsxiVm summary: Pause/Suspend virtual machine execution description: Pause/Suspend execution in an ESXi virtual machine. operationId: suspendVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 4220cbdf-6777-46dc-ae59-d5c54aa49e3d - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 90a59c40-b0ed-4ed8-a299-f6c55b220f48 responses: "202": description: The request to pause an execusion in VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/suspend\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/suspend\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/suspend\ \ Post operation" x-permissions: operationName: Suspend ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.SuspendVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.SuspendVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"Aca0b34a-9A6b-D7cA-ca1c-e4ecc9e9EeBa\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ SuspendVmApiResponse suspendVmApiResponse = esxiVmApi.suspendVm(SuspendVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(suspendVmApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"BE3EDBD4-beD3-Df49-ADdB-C05BBCdEceBC\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.suspendVm(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"bAdB0deb-AC4b-BBA3-425C-DBfA848F0Bd9\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.suspend_vm(extId=ext_id, if_match=etag_value)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"b4dc587C-F8d3-dC45-290c-bBb1f5afff77\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.SuspendVmRequest{ ExtId: &extId }\n \ \ response, error := EsxiVmServiceApiInstance.SuspendVm(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/f4aE7FEc-AFfC-5FEd-BEBa-fd6BcdA5fC66/$actions/suspend" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/16E6BA68-baDD-1fb5-C4Da-eDfDfD5EC7eB/$actions/suspend" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"7fAc06aa-D44c-FDeB-567c-ff9DbDBDaF68\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new SuspendVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n SuspendVmApiResponse suspendVmApiResponse = esxiVmApi.SuspendVm(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-shutdown: post: tags: - EsxiVm summary: Shut down services on ESXi guest OS description: Issues a command to the ESXi guest OS to perform a clean shut down of services running on it. This operation requires ESXi tools to be installed. operationId: shutdownGuestVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ae9d5314-1de9-4d30-aaa6-cdc6abbccfcc - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: e915eabe-0bdd-4691-a355-4a5cd8e720c2 responses: "202": description: The request to shut down services on ESXi guest OS is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" x-permissions: operationName: Guest Shutdown ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.ShutdownGuestVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.ShutdownVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"EFCEA0BB-8F7b-4661-b8B1-bcdF99CFa0a6\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EsxiConfigShutdownVmApiResponse esxiConfigShutdownVmApiResponse = esxiVmApi.shutdownGuestVm(ShutdownGuestVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(esxiConfigShutdownVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"CffEDdCE-4d2b-3Cad-140E-aeebAaBACdBA\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.shutdownGuestVm(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"4ce320d0-2bb7-dA9c-a4dF-D1ec82AeADcE\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.shutdown_guest_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"8B7EB2fb-1912-0Cdf-fCbd-eAea5EB3Ad8D\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.ShutdownGuestVmRequest{ ExtId: &extId }\n\ \ response, error := EsxiVmServiceApiInstance.ShutdownGuestVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/CEAA2AEa-2Fda-cCbA-AFcD-a72EB9CDb2bA/$actions/guest-shutdown" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/dda3fCCa-0117-cacB-B3aa-199cd448bf5E/$actions/guest-shutdown" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"4BBc6AbA-4eE2-cf46-254d-0bFaCdACafaE\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ShutdownGuestVmRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n EsxiConfigShutdownVmApiResponse esxiConfigShutdownVmApiResponse\ \ = esxiVmApi.ShutdownGuestVm(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-reboot: post: tags: - EsxiVm summary: Issue an ESXi guest OS reboot command description: Issues a command to reboot ESXi guest OS. This operation requires ESXi tools installed. operationId: rebootGuestVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 196c279a-dd89-484d-83ba-9ee118efa034 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 7217a33d-bc21-4bbc-b551-28fda52bac06 responses: "202": description: The request to reboot ESXi guest OS is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" x-permissions: operationName: Guest Reboot ESXi Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.EsxiVmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.EsxiVm.RebootGuestVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.esxi.config.RebootGuestOSApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ EsxiVmApi esxiVmApi = new EsxiVmApi(apiClient);\n\n \n \ \ String extId = \"cBFAFe65-02Bf-FC87-dFeE-c2ecbfaFCDfE\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ RebootGuestOSApiResponse rebootGuestOSApiResponse = esxiVmApi.rebootGuestVm(RebootGuestVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(rebootGuestOSApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, EsxiVmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let esxiVmApi = new EsxiVmApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"e21c2ECc-1F29-1cF8-8A4c-0ebBF4BbEaCd\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n esxiVmApi.rebootGuestVm(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n esxi_vm_api\ \ = ntnx_vmm_py_client.EsxiVmApi(api_client=client)\n \n ext_id =\ \ \"8Da9c6cb-cB0e-0EEd-86E6-BAe55EfeAf30\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = esxi_vm_api.reboot_guest_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/esxivm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n EsxiVmServiceApiInstance\ \ *api.EsxiVmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ EsxiVmServiceApiInstance = api.NewEsxiVmServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"E8e3aaca-C0a8-B4E2-fE9d-fA6dC3EfeA08\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := esxivm.RebootGuestVmRequest{ ExtId: &extId }\n\ \ response, error := EsxiVmServiceApiInstance.RebootGuestVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/esxi/config/vms/FEBfbA17-dB7d-FCfb-AD9b-5a1FDAE3BAE6/$actions/guest-reboot" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/esxi/config/vms/4AcADd4E-cfda-eaF8-0Ecf-5Df46Be8ae8A/$actions/guest-reboot" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Esxi;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n EsxiVmApi esxiVmApi\ \ = new EsxiVmApi(client);\n\n String extId = \"d9fC0e03-6eCf-7AA0-A130-0DcfEFEDF0df\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new RebootGuestVmRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n RebootGuestOSApiResponse rebootGuestOSApiResponse\ \ = esxiVmApi.RebootGuestVm(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/images/config/placement-policies: get: tags: - ImagePlacementPolicies summary: List image placement policies description: | Lists image placement policies created in Prism Central, along with details such as name, description, and so on. This API supports operations such as filtering, sorting, selection, and pagination. operationId: listPlacementPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$filter=description\ \ eq 'Distribute linux images to data centers'" - name: enforcementState example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$filter=enforcementState\ \ eq Vmm.Images.Config.EnforcementState'ACTIVE'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$filter=name\ \ eq 'Linux images placement policy'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$orderby=description" - name: enforcementState example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$orderby=enforcementState" - name: name example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$orderby=name" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=createTime" - name: description example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=description" - name: enforcementState example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=enforcementState" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=extId" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=lastUpdateTime" - name: links example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=links" - name: name example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=name" - name: ownerExtId example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=ownerExtId" - name: ownerName example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=ownerName" - name: placementType example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=placementType" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/images/config/placement-policies?$select=tenantId" responses: "200": description: Returns a list of image placement policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Get operation x-permissions: operationName: View Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Consumer - name: Developer - name: Project Manager - name: Project Admin - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.ListPlacementPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.ListPlacementPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListPlacementPoliciesApiResponse\ \ listPlacementPoliciesApiResponse = imagePlacementPoliciesApi.listPlacementPolicies(ListPlacementPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(listPlacementPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, ImagePlacementPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; imagePlacementPoliciesApi.listPlacementPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_placement_policies_api\ \ = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client)\n \ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = image_placement_policies_api.list_placement_policies(_page=page, _limit=limit)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagePlacementPoliciesServiceApiInstance\ \ *api.ImagePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := imageplacementpolicies.ListPlacementPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_:\ \ nil }\n response, error := ImagePlacementPoliciesServiceApiInstance.ListPlacementPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.PlacementPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagePlacementPoliciesApi\ \ imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\n\ \ int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n String select =\ \ \"string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListPlacementPoliciesRequest {\n Page\ \ = page,\n Limit = limit,\n Filter = filter,\n \ \ Orderby = orderby,\n Select = select\n };\n\ \ try {\n ListPlacementPoliciesApiResponse listPlacementPoliciesApiResponse\ \ = imagePlacementPoliciesApi.ListPlacementPolicies(request);\n }\ \ catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - ImagePlacementPolicies summary: Create an image placement policy description: | Creates an image placement policy using the provided request body. The name, placement type, cluster entity filter and image entity filter are mandatory fields for creating an image placement policy. operationId: createPlacementPolicy parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 95027e2d-6427-4579-a587-637f90497aee requestBody: description: Request to create an image placement policy. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementPolicy' required: true responses: "202": description: The request to create the image placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Post operation x-permissions: operationName: Create Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Consumer - name: Developer - name: Project Manager - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi; import com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.CreatePlacementPolicyRequest; import com.nutanix.dp1.vmm.vmm.v4.images.config.Filter; import com.nutanix.dp1.vmm.vmm.v4.images.config.PlacementType; import com.nutanix.dp1.vmm.vmm.v4.images.config.PlacementPolicy; import com.nutanix.dp1.vmm.vmm.v4.images.config.CreatePlacementPolicyApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient); PlacementPolicy placementPolicy = new PlacementPolicy(); // PlacementPolicy object initializations here... placementPolicy.setClusterEntityFilter(new Filter()); // required field placementPolicy.setImageEntityFilter(new Filter()); // required field placementPolicy.setName("Linux images placement policy"); // required field placementPolicy.setPlacementType(PlacementType.UNKNOWN); // required field try { // Pass in parameters using the request builder object associated with the operation. CreatePlacementPolicyApiResponse createPlacementPolicyApiResponse = imagePlacementPoliciesApi.createPlacementPolicy(CreatePlacementPolicyRequest.builder() .build(), placementPolicy); System.out.println(createPlacementPolicyApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, ImagePlacementPoliciesApi, Filter, PlacementType, PlacementPolicy } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance); function sample() { let placementPolicy = new PlacementPolicy(); // PlacementPolicy object initializations here... placementPolicy.setClusterEntityFilter(new Filter()); // required field placementPolicy.setImageEntityFilter(new Filter()); // required field placementPolicy.setName("Linux images placement policy"); // required field placementPolicy.setPlacementType(PlacementType.UNKNOWN); // required field placementPolicy = JSON.stringify(placementPolicy); imagePlacementPoliciesApi.createPlacementPolicy(placementPolicy).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) image_placement_policies_api = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client) placementPolicy = ntnx_vmm_py_client.PlacementPolicy() # PlacementPolicy object initializations here... placementPolicy.cluster_entity_filter = ntnx_vmm_py_client.Filter() # required field placementPolicy.image_entity_filter = ntnx_vmm_py_client.Filter() # required field placementPolicy.name = "Linux images placement policy" # required field placementPolicy.placement_type = ntnx_vmm_py_client.PlacementType._UNKNOWN # required field try: api_response = image_placement_policies_api.create_placement_policy(body=placementPolicy) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient ImagePlacementPoliciesServiceApiInstance *api.ImagePlacementPoliciesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance) ctx := context.Background() placementPolicy := import1.NewPlacementPolicy() // PlacementPolicy object initializations here... request := imageplacementpolicies.CreatePlacementPolicyRequest{ Body: placementPolicy } response, error := ImagePlacementPoliciesServiceApiInstance.CreatePlacementPolicy(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Linuximagesplacementpolicy","description":"Distributelinuximagestodatacenters","placementType":"$UNKNOWN","imageEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"enforcementState":"$UNKNOWN","createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","$objectType":"vmm.v4.images.config.PlacementPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Linuximagesplacementpolicy","description":"Distributelinuximagestodatacenters","placementType":"$UNKNOWN","imageEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"enforcementState":"$UNKNOWN","createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","$objectType":"vmm.v4.images.config.PlacementPolicy"} \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagePlacementPoliciesApi\ \ imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\n\ \ PlacementPolicy placementPolicy = new PlacementPolicy();\n\n \ \ // PlacementPolicy object initializations here...\n placementPolicy.ClusterEntityFilter\ \ = new Filter(); // required field\n placementPolicy.ImageEntityFilter\ \ = new Filter(); // required field\n placementPolicy.Name = \"Linux\ \ images placement policy\"; // required field\n placementPolicy.PlacementType\ \ = PlacementType.UNKNOWN; // required field\n\n\n // Create request\ \ object with parameters\n var request = new CreatePlacementPolicyRequest\ \ {\n Body = placementPolicy\n };\n try {\n \ \ CreatePlacementPolicyApiResponse createPlacementPolicyApiResponse\ \ = imagePlacementPoliciesApi.CreatePlacementPolicy(request);\n }\ \ catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/images/config/placement-policies/{extId}: get: tags: - ImagePlacementPolicies summary: Get an image placement policy description: Retrieves the image placement policy details for the provided external identifier. operationId: getPlacementPolicyById parameters: - name: extId in: path description: The external identifier of image placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 0d1e2403-84ec-473b-80b5-9e0ec6369e43 responses: "200": description: Returns the requested image placement policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementPolicy' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Get operation" x-permissions: operationName: View Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Consumer - name: Developer - name: Project Manager - name: Project Admin - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.GetPlacementPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.GetPlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient);\n\ \n \n String extId = \"8DFeA67d-1edb-ecAE-DFcd-4Ed0f6d0b1ea\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetPlacementPolicyApiResponse\ \ getPlacementPolicyApiResponse = imagePlacementPoliciesApi.getPlacementPolicyById(GetPlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getPlacementPolicyApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagePlacementPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"e22B12DA-BdAB-2d4A-e136-cd3cb37d3aCA\"\ ;\n\n\n\n\n\n imagePlacementPoliciesApi.getPlacementPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_placement_policies_api\ \ = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client)\n \ \ \n ext_id = \"F1FA1ffA-9d16-Dafa-ad0e-5d79EDC2b038\"\n\n\n try:\n\ \ api_response = image_placement_policies_api.get_placement_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagePlacementPoliciesServiceApiInstance\ \ *api.ImagePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"2FB0ceC2-62Da-Bcd7-A5Fe-AeECAbd9B0cA\"\ \n\n\n request := imageplacementpolicies.GetPlacementPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := ImagePlacementPoliciesServiceApiInstance.GetPlacementPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.PlacementPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies/5DCBE3e7-4Bd4-FBe0-e633-7eDA1ACB8eEF" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies/769eefBF-DF71-1C6a-9245-A378FaaBF45E" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagePlacementPoliciesApi\ \ imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\n\ \ String extId = \"d9eDaBCF-efad-BEFE-BbEb-EbC6CCbEBf3C\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetPlacementPolicyByIdRequest {\n ExtId = extId\n };\n\ \ try {\n GetPlacementPolicyApiResponse getPlacementPolicyApiResponse\ \ = imagePlacementPoliciesApi.GetPlacementPolicyById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - ImagePlacementPolicies summary: Update an image placement policy description: | Updates the image placement policy using the provided request body with the given external identifier. It is always recommended to perform a GET operation on a resource before performing a PUT operation to ensure the correct ETag is used. operationId: updatePlacementPolicyById parameters: - name: extId in: path description: The external identifier of image placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 711a87b1-2ebf-4f1f-92c3-f3f1cb1c0d1c - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 45fad4a2-e068-4804-bfc7-e180888c52d2 requestBody: description: Updated image placement policy request. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementPolicy' required: true responses: "202": description: The request to update the image placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Put operation" x-permissions: operationName: Update Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.UpdatePlacementPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.GetPlacementPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.images.config.Filter;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.PlacementType;\nimport com.nutanix.dp1.vmm.vmm.v4.images.config.PlacementPolicy;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.GetPlacementPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.UpdatePlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient);\n\ \n PlacementPolicy placementPolicy = new PlacementPolicy();\n\n \ \ // PlacementPolicy object initializations here...\n placementPolicy.setClusterEntityFilter(new\ \ Filter()); // required field\n placementPolicy.setImageEntityFilter(new\ \ Filter()); // required field\n placementPolicy.setName(\"Linux\ \ images placement policy\"); // required field\n placementPolicy.setPlacementType(PlacementType.UNKNOWN);\ \ // required field\n \n String extId = \"bfacBB3A-d524-1dfD-4D3f-a387E8c83BFD\"\ ;\n\n // perform GET call\n GetPlacementPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = imagePlacementPoliciesApi.getPlacementPolicyById(GetPlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdatePlacementPolicyApiResponse\ \ updatePlacementPolicyApiResponse = imagePlacementPoliciesApi.updatePlacementPolicyById(UpdatePlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), placementPolicy,\ \ opts);\n\n System.out.println(updatePlacementPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagePlacementPoliciesApi, Filter, PlacementType,\ \ PlacementPolicy, GetPlacementPolicyApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let placementPolicy = new PlacementPolicy();\n\ \n // PlacementPolicy object initializations here...\n placementPolicy.setClusterEntityFilter(new\ \ Filter()); // required field\n placementPolicy.setImageEntityFilter(new\ \ Filter()); // required field\n placementPolicy.setName(\"Linux images\ \ placement policy\"); // required field\n placementPolicy.setPlacementType(PlacementType.UNKNOWN);\ \ // required field\n placementPolicy = JSON.stringify(placementPolicy);\n\ \n \n let extId = \"EfCe5C4B-c0fE-EBCd-FbDa-bEb8Bbd9EAF3\";\n\n\n\ \ // Perform Get call\n imagePlacementPoliciesApi.getPlacementPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n imagePlacementPoliciesApi.updatePlacementPolicyById(extId,\ \ placementPolicy, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_placement_policies_api\ \ = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client)\n \ \ placementPolicy = ntnx_vmm_py_client.PlacementPolicy()\n\n # PlacementPolicy\ \ object initializations here...\n placementPolicy.cluster_entity_filter\ \ = ntnx_vmm_py_client.Filter() # required field\n placementPolicy.image_entity_filter\ \ = ntnx_vmm_py_client.Filter() # required field\n placementPolicy.name\ \ = \"Linux images placement policy\" # required field\n placementPolicy.placement_type\ \ = ntnx_vmm_py_client.PlacementType._UNKNOWN # required field\n \n\ \ ext_id = \"fCb1ED8A-cFAb-4DAe-DdC0-813095E8f187\"\n\n try:\n \ \ api_response = image_placement_policies_api.get_placement_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = image_placement_policies_api.update_placement_policy_by_id(extId=ext_id,\ \ body=placementPolicy, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagePlacementPoliciesServiceApiInstance\ \ *api.ImagePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n placementPolicy := import1.NewPlacementPolicy()\n\ \n // PlacementPolicy object initializations here...\n\n \n extId\ \ := \"AdDCfBCb-1Dbb-6ceB-DB14-a0A9c81268cc\"\n\n getRequest := imageplacementpolicies.GetPlacementPolicyByIdRequest{\ \ extId: &extId }\n getResponse, err := ImagePlacementPoliciesServiceApiInstance.GetPlacementPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := imageplacementpolicies.UpdatePlacementPolicyByIdRequest{\ \ ExtId: &extId, Body: placementPolicy }\n response, error := ImagePlacementPoliciesServiceApiInstance.UpdatePlacementPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies/cDAFcBea-AFfE-B7eE-2B7C-F4cf845aa6D6" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Linuximagesplacementpolicy","description":"Distributelinuximagestodatacenters","placementType":"$UNKNOWN","imageEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"enforcementState":"$UNKNOWN","createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","$objectType":"vmm.v4.images.config.PlacementPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Linuximagesplacementpolicy","description":"Distributelinuximagestodatacenters","placementType":"$UNKNOWN","imageEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"enforcementState":"$UNKNOWN","createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","$objectType":"vmm.v4.images.config.PlacementPolicy"} \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies/5FaFd298-8DdF-FeDe-A2bB-CA48EFe0EdeA" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Images.Config;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\ \n PlacementPolicy placementPolicy = new PlacementPolicy();\n\n \ \ // PlacementPolicy object initializations here...\n placementPolicy.ClusterEntityFilter\ \ = new Filter(); // required field\n placementPolicy.ImageEntityFilter\ \ = new Filter(); // required field\n placementPolicy.Name = \"Linux\ \ images placement policy\"; // required field\n placementPolicy.PlacementType\ \ = PlacementType.UNKNOWN; // required field\n\n String extId = \"\ EDC3Cd36-CFcc-2FfC-Bef5-EcEFEAe17966\";\n\n // perform GET call\n\ \ var getRequest = new GetPlacementPolicyByIdRequest {\n \ \ ExtId = extId\n };\n try {\n GetPlacementPolicyApiResponse\ \ getResponse = imagePlacementPoliciesApi.GetPlacementPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdatePlacementPolicyByIdRequest {\n ExtId =\ \ extId,\n Body = placementPolicy,\n \n \ \ \n };\n try {\n UpdatePlacementPolicyApiResponse\ \ updatePlacementPolicyApiResponse = imagePlacementPoliciesApi.UpdatePlacementPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - ImagePlacementPolicies summary: Delete an image placement policy description: Deletes the image placement policy with the given external identifier. operationId: deletePlacementPolicyById parameters: - name: extId in: path description: The external identifier of image placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2004b807-9067-4c24-83cc-52c5d98b24b9 responses: "202": description: The request to delete the image placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.DeletePlacementPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.DeletePlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient);\n\ \n \n String extId = \"4B63eBdf-ffC9-FEFA-4C85-AbC5B8F7c13A\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeletePlacementPolicyApiResponse\ \ deletePlacementPolicyApiResponse = imagePlacementPoliciesApi.deletePlacementPolicyById(DeletePlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(deletePlacementPolicyApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagePlacementPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"e5236EAE-57ec-5aEF-fBa5-B5fAbaDeD4db\"\ ;\n\n\n\n\n\n imagePlacementPoliciesApi.deletePlacementPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_placement_policies_api\ \ = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client)\n \ \ \n ext_id = \"eCCeb994-dc9C-dFdA-13D9-CB8CE3cd64ee\"\n\n\n try:\n\ \ api_response = image_placement_policies_api.delete_placement_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagePlacementPoliciesServiceApiInstance\ \ *api.ImagePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"8dDF4dad-aACA-7130-1eC6-e6c31eEc3AAE\"\ \n\n\n request := imageplacementpolicies.DeletePlacementPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := ImagePlacementPoliciesServiceApiInstance.DeletePlacementPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies/e6B92d7f-feae-39ca-a7C0-cBCDaDAEbb5C" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies/35fFfEFa-F8BC-BEcC-3acD-BACDcE14cEbE" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagePlacementPoliciesApi\ \ imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\n\ \ String extId = \"EFE1bacD-D9BE-4DBA-C2f3-7FfdcBbacc16\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeletePlacementPolicyByIdRequest {\n ExtId = extId\n \ \ };\n try {\n DeletePlacementPolicyApiResponse deletePlacementPolicyApiResponse\ \ = imagePlacementPoliciesApi.DeletePlacementPolicyById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/images/config/placement-policies/{extId}/$actions/suspend: post: tags: - ImagePlacementPolicies summary: Suspend an image placement policy description: | Suspends an active image placement policy. An active image placement policy is considered for enforcement. operationId: suspendPlacementPolicy parameters: - name: extId in: path description: The external identifier of image placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 85e85013-e3a9-4de6-b233-7a20a60a4227 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 5c2bc0dc-eb02-440d-b0fd-37cc971b02b0 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.images.config.SuspendPlacementPolicyConfig' required: true responses: "202": description: The request to suspend an image placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/suspend\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/suspend\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/suspend\ \ Post operation" x-permissions: operationName: Suspend Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.SuspendPlacementPolicyRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.images.config.SuspendPlacementPolicyConfig;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.SuspendPlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient);\n\ \n SuspendPlacementPolicyConfig suspendPlacementPolicyConfig = new\ \ SuspendPlacementPolicyConfig();\n\n // SuspendPlacementPolicyConfig\ \ object initializations here...\n \n String extId = \"FEbA95AB-cCb8-dbEa-1B30-C4eb27DBeBEC\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ SuspendPlacementPolicyApiResponse suspendPlacementPolicyApiResponse =\ \ imagePlacementPoliciesApi.suspendPlacementPolicy(SuspendPlacementPolicyRequest.builder()\n\ \ .extId(extId)\n .build(), suspendPlacementPolicyConfig,\ \ opts);\n\n System.out.println(suspendPlacementPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagePlacementPoliciesApi, SuspendPlacementPolicyConfig\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let suspendPlacementPolicyConfig = new SuspendPlacementPolicyConfig();\n\ \n // SuspendPlacementPolicyConfig object initializations here...\n \ \ suspendPlacementPolicyConfig = JSON.stringify(suspendPlacementPolicyConfig);\n\ \n \n let extId = \"94bd0Ec8-D9dA-CbEC-dA2b-3cf7BEb60eFE\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n imagePlacementPoliciesApi.suspendPlacementPolicy(extId,\ \ suspendPlacementPolicyConfig, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_placement_policies_api\ \ = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client)\n \ \ suspendPlacementPolicyConfig = ntnx_vmm_py_client.SuspendPlacementPolicyConfig()\n\ \n # SuspendPlacementPolicyConfig object initializations here...\n \ \ \n ext_id = \"b1Ebb931-7CcA-be1f-7aa5-099CDE28DdEB\"\n\n \"\"\"\ \n Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = image_placement_policies_api.suspend_placement_policy(extId=ext_id,\ \ body=suspendPlacementPolicyConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagePlacementPoliciesServiceApiInstance\ \ *api.ImagePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n suspendPlacementPolicyConfig :=\ \ import1.NewSuspendPlacementPolicyConfig()\n\n // SuspendPlacementPolicyConfig\ \ object initializations here...\n\n \n extId := \"cbfEFdcb-729b-92De-9Bd8-e4FD5FE2AC7f\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := imageplacementpolicies.SuspendPlacementPolicyRequest{\ \ ExtId: &extId, Body: suspendPlacementPolicyConfig }\n response, error\ \ := ImagePlacementPoliciesServiceApiInstance.SuspendPlacementPolicy(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies/6fC9c4C6-fAC1-6D2C-2d2C-f4D628F491Db/$actions/suspend" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"shouldCancelRunningTasks":false,"$objectType":"vmm.v4.images.config.SuspendPlacementPolicyConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"shouldCancelRunningTasks":false,"$objectType":"vmm.v4.images.config.SuspendPlacementPolicyConfig"} \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies/c11dEA5e-bfeC-c5d3-Da5b-Cf6bC8FBec4f/$actions/suspend" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagePlacementPoliciesApi\ \ imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\n\ \ SuspendPlacementPolicyConfig suspendPlacementPolicyConfig = new SuspendPlacementPolicyConfig();\n\ \n // SuspendPlacementPolicyConfig object initializations here...\n\ \n String extId = \"B3DbCeDD-EabC-CdCf-9af0-ffcf0FdfbB3C\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new SuspendPlacementPolicyRequest\ \ {\n ExtId = extId,\n Body = suspendPlacementPolicyConfig,\n\ \ \n \n };\n try {\n SuspendPlacementPolicyApiResponse\ \ suspendPlacementPolicyApiResponse = imagePlacementPoliciesApi.SuspendPlacementPolicy(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/images/config/placement-policies/{extId}/$actions/resume: post: tags: - ImagePlacementPolicies summary: Resume an image placement policy description: | Resumes a suspended image placement policy. A suspended image placement policy is one that is not being considered for enforcement. operationId: resumePlacementPolicy parameters: - name: extId in: path description: The external identifier of image placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1d1fd35f-710c-46a4-9299-ce5318454828 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: ad3d2de8-9c78-45c1-ae05-fc006a06c715 responses: "202": description: The request to resume a suspended image placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/resume\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/resume\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/resume\ \ Post operation" x-permissions: operationName: Resume Image Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImagePlacementPolicies.ResumePlacementPolicyRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.images.config.ResumePlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagePlacementPoliciesApi imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClient);\n\ \n \n String extId = \"d5ffAFdc-Eee7-E2Cd-91FD-97a78112Cde0\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ ResumePlacementPolicyApiResponse resumePlacementPolicyApiResponse = imagePlacementPoliciesApi.resumePlacementPolicy(ResumePlacementPolicyRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(resumePlacementPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagePlacementPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"aA1f134A-Ec6A-EaF0-e3CB-b5f08B9E5D84\"\ ;\n\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n imagePlacementPoliciesApi.resumePlacementPolicy(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_placement_policies_api\ \ = ntnx_vmm_py_client.ImagePlacementPoliciesApi(api_client=client)\n \ \ \n ext_id = \"9f3AC3d2-aF16-dbB7-CcBb-eaACa4BdaF3f\"\n\n \"\"\"\ \n Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = image_placement_policies_api.resume_placement_policy(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagePlacementPoliciesServiceApiInstance\ \ *api.ImagePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImagePlacementPoliciesServiceApiInstance = api.NewImagePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"cA7c8eFa-ed87-7CCf-BADb-85d9DBEDCfcF\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := imageplacementpolicies.ResumePlacementPolicyRequest{\ \ ExtId: &extId }\n response, error := ImagePlacementPoliciesServiceApiInstance.ResumePlacementPolicy(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/images/config/placement-policies/1098FFeD-dca9-bD1C-950B-BC4DbF9F3B7B/$actions/resume" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/placement-policies/EFCCCEac-deae-DebE-5DA4-EEE1dF5ff9Aa/$actions/resume" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagePlacementPoliciesApi\ \ imagePlacementPoliciesApi = new ImagePlacementPoliciesApi(client);\n\n\ \ String extId = \"bAD94BfD-cAC1-aaaB-4F3A-CE2A39EA25Fa\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ResumePlacementPolicyRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n ResumePlacementPolicyApiResponse resumePlacementPolicyApiResponse\ \ = imagePlacementPoliciesApi.ResumePlacementPolicy(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/images/config/rate-limit-policies: get: tags: - ImageRateLimitPolicies summary: List image rate limit policies description: | Lists image rate limit policies created on Prism Central along with other details such as, name, description and so on. This API supports operations such as filtering, sorting, selection, and pagination. operationId: listRateLimitPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$filter=description\ \ eq 'Bandwidth throttling for image operations'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$filter=name\ \ eq 'Data center rate limit policy'" - name: rateLimitKbps example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$filter=rateLimitKbps\ \ eq 60" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$orderby=description" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$orderby=lastUpdateTime" - name: name example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$orderby=name" - name: rateLimitKbps example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$orderby=rateLimitKbps" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=createTime" - name: description example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=description" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=extId" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=lastUpdateTime" - name: links example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=links" - name: name example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=name" - name: ownerExtId example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=ownerExtId" - name: ownerName example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=ownerName" - name: rateLimitKbps example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=rateLimitKbps" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/images/config/rate-limit-policies?$select=tenantId" responses: "200": description: Returns a list of image rate limit policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.images.config.RateLimitPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Get operation x-permissions: operationName: View Image BW Throttling Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImageRateLimitPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.ListRateLimitPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.ListRateLimitPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListRateLimitPoliciesApiResponse\ \ listRateLimitPoliciesApiResponse = imageRateLimitPoliciesApi.listRateLimitPolicies(ListRateLimitPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(listRateLimitPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, ImageRateLimitPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; imageRateLimitPoliciesApi.listRateLimitPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_rate_limit_policies_api\ \ = ntnx_vmm_py_client.ImageRateLimitPoliciesApi(api_client=client)\n \ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = image_rate_limit_policies_api.list_rate_limit_policies(_page=page, _limit=limit)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageratelimitpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImageRateLimitPoliciesServiceApiInstance\ \ *api.ImageRateLimitPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImageRateLimitPoliciesServiceApiInstance = api.NewImageRateLimitPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := imageratelimitpolicies.ListRateLimitPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_:\ \ nil }\n response, error := ImageRateLimitPoliciesServiceApiInstance.ListRateLimitPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.RateLimitPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImageRateLimitPoliciesApi\ \ imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(client);\n\n\ \ int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n String select =\ \ \"string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListRateLimitPoliciesRequest {\n Page\ \ = page,\n Limit = limit,\n Filter = filter,\n \ \ Orderby = orderby,\n Select = select\n };\n\ \ try {\n ListRateLimitPoliciesApiResponse listRateLimitPoliciesApiResponse\ \ = imageRateLimitPoliciesApi.ListRateLimitPolicies(request);\n }\ \ catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - ImageRateLimitPolicies summary: Create an image rate limit policy description: | Creates an image rate limit policy using the provided request body. The name, rate limit Kbps and cluster entity filter are mandatory fields for creating an image rate limit. operationId: createRateLimitPolicy parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: e2e3fced-f1a8-4c9b-841b-f7e42931dd19 requestBody: description: Request to create an image rate limit policy. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.images.config.RateLimitPolicy' required: true responses: "202": description: The request to create an image rate limit policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Post operation x-permissions: operationName: Create Image BW Throttling Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.ImageRateLimitPoliciesApi; import com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.CreateRateLimitPolicyRequest; import com.nutanix.dp1.vmm.vmm.v4.images.config.Filter; import com.nutanix.dp1.vmm.vmm.v4.images.config.RateLimitPolicy; import com.nutanix.dp1.vmm.vmm.v4.images.config.CreateRateLimitPolicyApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClient); RateLimitPolicy rateLimitPolicy = new RateLimitPolicy(); // RateLimitPolicy object initializations here... rateLimitPolicy.setClusterEntityFilter(new Filter()); // required field rateLimitPolicy.setName("Data center rate limit policy"); // required field rateLimitPolicy.setRateLimitKbps(1); // required field try { // Pass in parameters using the request builder object associated with the operation. CreateRateLimitPolicyApiResponse createRateLimitPolicyApiResponse = imageRateLimitPoliciesApi.createRateLimitPolicy(CreateRateLimitPolicyRequest.builder() .build(), rateLimitPolicy); System.out.println(createRateLimitPolicyApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, ImageRateLimitPoliciesApi, Filter, RateLimitPolicy } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClientInstance); function sample() { let rateLimitPolicy = new RateLimitPolicy(); // RateLimitPolicy object initializations here... rateLimitPolicy.setClusterEntityFilter(new Filter()); // required field rateLimitPolicy.setName("Data center rate limit policy"); // required field rateLimitPolicy.setRateLimitKbps(1); // required field rateLimitPolicy = JSON.stringify(rateLimitPolicy); imageRateLimitPoliciesApi.createRateLimitPolicy(rateLimitPolicy).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) image_rate_limit_policies_api = ntnx_vmm_py_client.ImageRateLimitPoliciesApi(api_client=client) rateLimitPolicy = ntnx_vmm_py_client.RateLimitPolicy() # RateLimitPolicy object initializations here... rateLimitPolicy.cluster_entity_filter = ntnx_vmm_py_client.Filter() # required field rateLimitPolicy.name = "Data center rate limit policy" # required field rateLimitPolicy.rate_limit_kbps = 1 # required field try: api_response = image_rate_limit_policies_api.create_rate_limit_policy(body=rateLimitPolicy) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageratelimitpolicies" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient ImageRateLimitPoliciesServiceApiInstance *api.ImageRateLimitPoliciesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. ImageRateLimitPoliciesServiceApiInstance = api.NewImageRateLimitPoliciesServiceApi(ApiClientInstance) ctx := context.Background() rateLimitPolicy := import1.NewRateLimitPolicy() // RateLimitPolicy object initializations here... request := imageratelimitpolicies.CreateRateLimitPolicyRequest{ Body: rateLimitPolicy } response, error := ImageRateLimitPoliciesServiceApiInstance.CreateRateLimitPolicy(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Datacenterratelimitpolicy","description":"Bandwidththrottlingforimageoperations","rateLimitKbps":0,"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","matchingClusterExtIds":["string"],"$objectType":"vmm.v4.images.config.RateLimitPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Datacenterratelimitpolicy","description":"Bandwidththrottlingforimageoperations","rateLimitKbps":0,"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","matchingClusterExtIds":["string"],"$objectType":"vmm.v4.images.config.RateLimitPolicy"} \ - "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImageRateLimitPoliciesApi\ \ imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(client);\n\n\ \ RateLimitPolicy rateLimitPolicy = new RateLimitPolicy();\n\n \ \ // RateLimitPolicy object initializations here...\n rateLimitPolicy.ClusterEntityFilter\ \ = new Filter(); // required field\n rateLimitPolicy.Name = \"Data\ \ center rate limit policy\"; // required field\n rateLimitPolicy.RateLimitKbps\ \ = 1; // required field\n\n\n // Create request object with parameters\n\ \ var request = new CreateRateLimitPolicyRequest {\n Body\ \ = rateLimitPolicy\n };\n try {\n CreateRateLimitPolicyApiResponse\ \ createRateLimitPolicyApiResponse = imageRateLimitPoliciesApi.CreateRateLimitPolicy(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/images/config/rate-limit-policies/{extId}: get: tags: - ImageRateLimitPolicies summary: Get an image rate limit policy description: Retrieves an image rate limit policy details for the provided external identifier. operationId: getRateLimitPolicyById parameters: - name: extId in: path description: The external identifier of image rate limit policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b31e690c-bb65-4a4b-a49b-da87daaf89d9 responses: "200": description: Returns the requested image rate limit policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.images.config.RateLimitPolicy' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Get operation" x-permissions: operationName: View Image BW Throttling Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImageRateLimitPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.GetRateLimitPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.GetRateLimitPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClient);\n\ \n \n String extId = \"DEAdB6C6-2E0D-FAbf-09BE-bcEA6D9a2fCD\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetRateLimitPolicyApiResponse\ \ getRateLimitPolicyApiResponse = imageRateLimitPoliciesApi.getRateLimitPolicyById(GetRateLimitPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getRateLimitPolicyApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImageRateLimitPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"0BfFFAB6-cE5C-EE5F-CbfD-faA4E6b5acCE\"\ ;\n\n\n\n\n\n imageRateLimitPoliciesApi.getRateLimitPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_rate_limit_policies_api\ \ = ntnx_vmm_py_client.ImageRateLimitPoliciesApi(api_client=client)\n \ \ \n ext_id = \"FD54C1ce-a2aC-fab1-da3F-BEe6DBef6a98\"\n\n\n try:\n\ \ api_response = image_rate_limit_policies_api.get_rate_limit_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageratelimitpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImageRateLimitPoliciesServiceApiInstance\ \ *api.ImageRateLimitPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImageRateLimitPoliciesServiceApiInstance = api.NewImageRateLimitPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"c5E12df7-cBAB-61EE-E3bC-F3d16AaeBC9b\"\ \n\n\n request := imageratelimitpolicies.GetRateLimitPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := ImageRateLimitPoliciesServiceApiInstance.GetRateLimitPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.RateLimitPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies/BabDB8dB-bBfF-fa28-e41e-Ab96EaED3fDC" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies/c21Cdc9C-3963-E01f-eC9a-3c1f9Bcff467" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImageRateLimitPoliciesApi\ \ imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(client);\n\n\ \ String extId = \"1e02a16e-FeBa-AfBc-7Ed5-3C95FEbc80Ec\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetRateLimitPolicyByIdRequest {\n ExtId = extId\n };\n\ \ try {\n GetRateLimitPolicyApiResponse getRateLimitPolicyApiResponse\ \ = imageRateLimitPoliciesApi.GetRateLimitPolicyById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - ImageRateLimitPolicies summary: Update the image rate limit policy description: | Updates the image rate limit policy using the provided request body with the given external identifier. It is always recommended to perform a GET operation on a resource before performing a PUT operation to ensure the correct ETag is used. operationId: updateRateLimitPolicyById parameters: - name: extId in: path description: The external identifier of image rate limit policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2ddb588f-70e8-4606-ba7e-5700b413a354 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 731f3c0b-5a0d-4ddf-91da-96a9fbc8dfd6 requestBody: description: Updated image rate limit policy request. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.images.config.RateLimitPolicy' required: true responses: "202": description: The request to update the image rate limit policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Put operation" x-permissions: operationName: Update Image BW Throttling Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImageRateLimitPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.UpdateRateLimitPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.GetRateLimitPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.images.config.Filter;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.RateLimitPolicy;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.images.config.GetRateLimitPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.UpdateRateLimitPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClient);\n\ \n RateLimitPolicy rateLimitPolicy = new RateLimitPolicy();\n\n \ \ // RateLimitPolicy object initializations here...\n rateLimitPolicy.setClusterEntityFilter(new\ \ Filter()); // required field\n rateLimitPolicy.setName(\"Data\ \ center rate limit policy\"); // required field\n rateLimitPolicy.setRateLimitKbps(1);\ \ // required field\n \n String extId = \"0aC8aBDb-df2F-D0aB-4BfD-FcEdF66C2cdE\"\ ;\n\n // perform GET call\n GetRateLimitPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = imageRateLimitPoliciesApi.getRateLimitPolicyById(GetRateLimitPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateRateLimitPolicyApiResponse\ \ updateRateLimitPolicyApiResponse = imageRateLimitPoliciesApi.updateRateLimitPolicyById(UpdateRateLimitPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), rateLimitPolicy,\ \ opts);\n\n System.out.println(updateRateLimitPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImageRateLimitPoliciesApi, Filter, RateLimitPolicy,\ \ GetRateLimitPolicyApiResponse } from \"@nutanix-api/vmm-js-client\";\n\ \n// Configure the client\nlet apiClientInstance = new ApiClient();\n//\ \ IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let rateLimitPolicy = new RateLimitPolicy();\n\ \n // RateLimitPolicy object initializations here...\n rateLimitPolicy.setClusterEntityFilter(new\ \ Filter()); // required field\n rateLimitPolicy.setName(\"Data center\ \ rate limit policy\"); // required field\n rateLimitPolicy.setRateLimitKbps(1);\ \ // required field\n rateLimitPolicy = JSON.stringify(rateLimitPolicy);\n\ \n \n let extId = \"93eF5FCd-aEBe-bffD-BBA4-4A3BFDfdcacF\";\n\n\n\ \ // Perform Get call\n imageRateLimitPoliciesApi.getRateLimitPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n imageRateLimitPoliciesApi.updateRateLimitPolicyById(extId,\ \ rateLimitPolicy, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_rate_limit_policies_api\ \ = ntnx_vmm_py_client.ImageRateLimitPoliciesApi(api_client=client)\n \ \ rateLimitPolicy = ntnx_vmm_py_client.RateLimitPolicy()\n\n # RateLimitPolicy\ \ object initializations here...\n rateLimitPolicy.cluster_entity_filter\ \ = ntnx_vmm_py_client.Filter() # required field\n rateLimitPolicy.name\ \ = \"Data center rate limit policy\" # required field\n rateLimitPolicy.rate_limit_kbps\ \ = 1 # required field\n \n ext_id = \"5c8cc008-bbdA-25a3-bB69-e3EF62D3b90D\"\ \n\n try:\n api_response = image_rate_limit_policies_api.get_rate_limit_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = image_rate_limit_policies_api.update_rate_limit_policy_by_id(extId=ext_id,\ \ body=rateLimitPolicy, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageratelimitpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImageRateLimitPoliciesServiceApiInstance\ \ *api.ImageRateLimitPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImageRateLimitPoliciesServiceApiInstance = api.NewImageRateLimitPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n rateLimitPolicy := import1.NewRateLimitPolicy()\n\ \n // RateLimitPolicy object initializations here...\n\n \n extId\ \ := \"D9bfFfaF-1CFF-Beeb-adeD-0cEEd0A8bDAa\"\n\n getRequest := imageratelimitpolicies.GetRateLimitPolicyByIdRequest{\ \ extId: &extId }\n getResponse, err := ImageRateLimitPoliciesServiceApiInstance.GetRateLimitPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := imageratelimitpolicies.UpdateRateLimitPolicyByIdRequest{\ \ ExtId: &extId, Body: rateLimitPolicy }\n response, error := ImageRateLimitPoliciesServiceApiInstance.UpdateRateLimitPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies/FFFbCe6D-F63e-6c18-FB0b-c0bB5cDdaa9A" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Datacenterratelimitpolicy","description":"Bandwidththrottlingforimageoperations","rateLimitKbps":0,"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","matchingClusterExtIds":["string"],"$objectType":"vmm.v4.images.config.RateLimitPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"Datacenterratelimitpolicy","description":"Bandwidththrottlingforimageoperations","rateLimitKbps":0,"clusterEntityFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"vmm.v4.images.config.Filter"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","matchingClusterExtIds":["string"],"$objectType":"vmm.v4.images.config.RateLimitPolicy"} \ - "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies/DFa48EA0-46DC-FC3F-Ad2a-dfaAcDD0dF7A" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Images.Config;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(client);\n\ \n RateLimitPolicy rateLimitPolicy = new RateLimitPolicy();\n\n \ \ // RateLimitPolicy object initializations here...\n rateLimitPolicy.ClusterEntityFilter\ \ = new Filter(); // required field\n rateLimitPolicy.Name = \"Data\ \ center rate limit policy\"; // required field\n rateLimitPolicy.RateLimitKbps\ \ = 1; // required field\n\n String extId = \"Adfeabd4-BfFc-a1dE-0ba7-F4A543daBfcd\"\ ;\n\n // perform GET call\n var getRequest = new GetRateLimitPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetRateLimitPolicyApiResponse\ \ getResponse = imageRateLimitPoliciesApi.GetRateLimitPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateRateLimitPolicyByIdRequest {\n ExtId =\ \ extId,\n Body = rateLimitPolicy,\n \n \ \ \n };\n try {\n UpdateRateLimitPolicyApiResponse\ \ updateRateLimitPolicyApiResponse = imageRateLimitPoliciesApi.UpdateRateLimitPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - ImageRateLimitPolicies summary: Delete an image rate limit policy description: Deletes the image rate limit policy with the given external identifier. operationId: deleteRateLimitPolicyById parameters: - name: extId in: path description: The external identifier of image rate limit policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 657e8149-ca50-44fb-a852-a27a8a33f11a responses: "202": description: The request to delete image rate limit policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete Image BW Throttling Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImageRateLimitPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.DeleteRateLimitPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.DeleteRateLimitPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClient);\n\ \n \n String extId = \"cC7BCBfB-E8bb-aCCE-D4Ee-91FCcAFaD0b4\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteRateLimitPolicyApiResponse\ \ deleteRateLimitPolicyApiResponse = imageRateLimitPoliciesApi.deleteRateLimitPolicyById(DeleteRateLimitPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(deleteRateLimitPolicyApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImageRateLimitPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"aa0BC2A4-4e86-7bDf-f3bF-b2d1c46AaeB9\"\ ;\n\n\n\n\n\n imageRateLimitPoliciesApi.deleteRateLimitPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_rate_limit_policies_api\ \ = ntnx_vmm_py_client.ImageRateLimitPoliciesApi(api_client=client)\n \ \ \n ext_id = \"CEd5cf32-fcAa-EFeB-C9C7-9ecBAD8FD8d0\"\n\n\n try:\n\ \ api_response = image_rate_limit_policies_api.delete_rate_limit_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageratelimitpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImageRateLimitPoliciesServiceApiInstance\ \ *api.ImageRateLimitPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImageRateLimitPoliciesServiceApiInstance = api.NewImageRateLimitPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"16c7aadc-bDfa-6B70-9BFE-E5Fef4A8dCfb\"\ \n\n\n request := imageratelimitpolicies.DeleteRateLimitPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := ImageRateLimitPoliciesServiceApiInstance.DeleteRateLimitPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies/eDfeF2AA-CdDa-Fa0d-aCa1-8C468FeE17e2" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/rate-limit-policies/8CB4bbfB-Edbd-Fd4b-4bEF-2EEaFfcBFfc9" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImageRateLimitPoliciesApi\ \ imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(client);\n\n\ \ String extId = \"Fe6EBFeC-2cDb-1Fb2-A74d-BAe8d4e8Cafb\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteRateLimitPolicyByIdRequest {\n ExtId = extId\n \ \ };\n try {\n DeleteRateLimitPolicyApiResponse deleteRateLimitPolicyApiResponse\ \ = imageRateLimitPoliciesApi.DeleteRateLimitPolicyById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/images/config/effective-rate-limit-policies: get: tags: - ImageRateLimitPolicies summary: Resolve the effective rate limit for Prism Elements description: | The effective rate limit for the Prism Elements. If no rate limit applies to a particular cluster, no entry is returned for that cluster. The API supports operations such as filtering, sorting, selection, and pagination. operationId: listEffectiveRateLimitPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: clusterExtId example: "https://{host}:{port}/api/vmm/v4.2/images/config/effective-rate-limit-policies?$filter=clusterExtId\ \ eq '3498f2c3-7b0d-4851-8b35-6d8ffe64f1c6'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: clusterExtId example: "https://{host}:{port}/api/vmm/v4.2/images/config/effective-rate-limit-policies?$orderby=clusterExtId" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: clusterExtId example: "https://{host}:{port}/api/vmm/v4.2/images/config/effective-rate-limit-policies?$select=clusterExtId" - name: links example: "https://{host}:{port}/api/vmm/v4.2/images/config/effective-rate-limit-policies?$select=links" - name: rateLimitExtId example: "https://{host}:{port}/api/vmm/v4.2/images/config/effective-rate-limit-policies?$select=rateLimitExtId" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/images/config/effective-rate-limit-policies?$select=tenantId" responses: "200": description: Returns the effective rate limit for Prism Elements. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.images.config.EffectiveRateLimitPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/effective-rate-limit-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/effective-rate-limit-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/effective-rate-limit-policies Get operation x-permissions: operationName: View Effective Image BW Throttling Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 15 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImageRateLimitPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.ImageRateLimitPolicies.ListEffectiveRateLimitPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.images.config.ListEffectiveRateLimitPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImageRateLimitPoliciesApi imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListEffectiveRateLimitPoliciesApiResponse\ \ listEffectiveRateLimitPoliciesApiResponse = imageRateLimitPoliciesApi.listEffectiveRateLimitPolicies(ListEffectiveRateLimitPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(listEffectiveRateLimitPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, ImageRateLimitPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; imageRateLimitPoliciesApi.listEffectiveRateLimitPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n image_rate_limit_policies_api\ \ = ntnx_vmm_py_client.ImageRateLimitPoliciesApi(api_client=client)\n \ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = image_rate_limit_policies_api.list_effective_rate_limit_policies(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/imageratelimitpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/images/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImageRateLimitPoliciesServiceApiInstance\ \ *api.ImageRateLimitPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ ImageRateLimitPoliciesServiceApiInstance = api.NewImageRateLimitPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := imageratelimitpolicies.ListEffectiveRateLimitPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_:\ \ nil }\n response, error := ImageRateLimitPoliciesServiceApiInstance.ListEffectiveRateLimitPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.EffectiveRateLimitPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/images/config/effective-rate-limit-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/images/config/effective-rate-limit-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Images;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImageRateLimitPoliciesApi\ \ imageRateLimitPoliciesApi = new ImageRateLimitPoliciesApi(client);\n\n\ \ int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n String select =\ \ \"string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListEffectiveRateLimitPoliciesRequest {\n \ \ Page = page,\n Limit = limit,\n Filter =\ \ filter,\n Orderby = orderby,\n Select = select\n\ \ };\n try {\n ListEffectiveRateLimitPoliciesApiResponse\ \ listEffectiveRateLimitPoliciesApiResponse = imageRateLimitPoliciesApi.ListEffectiveRateLimitPolicies(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/content/images: get: tags: - Images summary: List images description: | Lists images owned by Prism Central, along with image details such as name, description, type, and so on. This API supports operation such as filtering, sorting, selection, and pagination. operationId: listImages parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/content/images?$filter=description\ \ eq 'Installer with updated kernel'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/content/images?$filter=name\ \ eq 'LinuxInstaller.iso'" - name: sizeBytes example: "https://{host}:{port}/api/vmm/v4.2/content/images?$filter=sizeBytes\ \ eq 66" - name: type example: "https://{host}:{port}/api/vmm/v4.2/content/images?$filter=type\ \ eq Vmm.Content.ImageType'DISK_IMAGE'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/content/images?$orderby=description" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/content/images?$orderby=lastUpdateTime" - name: name example: "https://{host}:{port}/api/vmm/v4.2/content/images?$orderby=name" - name: sizeBytes example: "https://{host}:{port}/api/vmm/v4.2/content/images?$orderby=sizeBytes" - name: type example: "https://{host}:{port}/api/vmm/v4.2/content/images?$orderby=type" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: categoryExtIds example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=categoryExtIds" - name: clusterLocationExtIds example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=clusterLocationExtIds" - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=createTime" - name: description example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=description" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=extId" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=lastUpdateTime" - name: links example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=links" - name: name example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=name" - name: ownerExtId example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=ownerExtId" - name: ownerName example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=ownerName" - name: sizeBytes example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=sizeBytes" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=tenantId" - name: type example: "https://{host}:{port}/api/vmm/v4.2/content/images?$select=type" responses: "200": description: Returns a list of images. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.content.Image' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Get operation x-permissions: operationName: View Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Backup Admin - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: CSI System - name: Kubernetes Data Services System - name: Kubernetes Infrastructure Provision - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 15 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Images.ListImagesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.ListImagesApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagesApi imagesApi = new ImagesApi(apiClient);\n\n \n \ \ int page = 0;\n \n int limit = 50;\n\n try {\n\ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n ListImagesApiResponse listImagesApiResponse\ \ = imagesApi.listImages(ListImagesRequest.builder()\n .$page(page)\n\ \ .$limit(limit)\n .$filter(null)\n \ \ .$orderby(null)\n .$select(null)\n \ \ .build());\n\n System.out.println(listImagesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, ImagesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imagesApi = new ImagesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; imagesApi.listImages(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n images_api\ \ = ntnx_vmm_py_client.ImagesApi(api_client=client)\n \n page = 0\n\ \ \n limit = 50\n\n\n try:\n api_response = images_api.list_images(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/images\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagesServiceApiInstance\ \ *api.ImagesServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ ImagesServiceApiInstance = api.NewImagesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := images.ListImagesRequest{ Page_: &page_, Limit_:\ \ &limit_, Filter_: nil, Orderby_: nil, Select_: nil }\n response, error\ \ := ImagesServiceApiInstance.ListImages(ctx, &request)\n if error !=\ \ nil {\n fmt.Println(error)\n return\n }\n data, _\ \ := response.GetData().([]import1.Image)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/images?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/images?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagesApi imagesApi\ \ = new ImagesApi(client);\n\n int page = 0;\n int limit = 50;\n\ \ String filter = \"string_sample_data\";\n String orderby = \"\ string_sample_data\";\n String select = \"string_sample_data\";\n\n\ \ // Create request object with parameters\n var request =\ \ new ListImagesRequest {\n Page = page,\n Limit =\ \ limit,\n Filter = filter,\n Orderby = orderby,\n\ \ Select = select\n };\n try {\n ListImagesApiResponse\ \ listImagesApiResponse = imagesApi.ListImages(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - Images summary: Create an image description: | Creates an image using the provided request body. The name, type and source are mandatory fields to create an image. operationId: createImage parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 386d54cd-1886-448f-9950-aa8ea0559188 requestBody: description: Request to create an image. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.Image' required: true responses: "202": description: The request to create an image is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Post operation x-permissions: operationName: Create Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Project Manager - deprecated: true name: Self-Service Admin - name: CSI System - name: Kubernetes Data Services System - name: Kubernetes Infrastructure Provision - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.7" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.ImagesApi; import com.nutanix.dp1.vmm.vmm.v4.request.Images.CreateImageRequest; import com.nutanix.dp1.vmm.vmm.v4.content.ImageType; import com.nutanix.dp1.vmm.vmm.v4.content.Image; import com.nutanix.dp1.vmm.vmm.v4.content.CreateImageApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. ImagesApi imagesApi = new ImagesApi(apiClient); Image image = new Image(); // Image object initializations here... image.setName("LinuxInstaller.iso"); // required field image.setType(ImageType.UNKNOWN); // required field try { // Pass in parameters using the request builder object associated with the operation. CreateImageApiResponse createImageApiResponse = imagesApi.createImage(CreateImageRequest.builder() .build(), image); System.out.println(createImageApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, ImagesApi, ImageType, Image } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imagesApi = new ImagesApi(apiClientInstance); function sample() { let image = new Image(); // Image object initializations here... image.setName("LinuxInstaller.iso"); // required field image.setType(ImageType.UNKNOWN); // required field image = JSON.stringify(image); imagesApi.createImage(image).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) images_api = ntnx_vmm_py_client.ImagesApi(api_client=client) image = ntnx_vmm_py_client.Image() # Image object initializations here... image.name = "LinuxInstaller.iso" # required field image.type = ntnx_vmm_py_client.ImageType._UNKNOWN # required field try: api_response = images_api.create_image(body=image) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/images" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient ImagesServiceApiInstance *api.ImagesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. ImagesServiceApiInstance = api.NewImagesServiceApi(ApiClientInstance) ctx := context.Background() image := import1.NewImage() // Image object initializations here... request := images.CreateImageRequest{ Body: image } response, error := ImagesServiceApiInstance.CreateImage(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/images" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxInstaller.iso","description":"Installerwithupdatedkernel","type":"$UNKNOWN","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.ImageSha1Checksum"},"sizeBytes":0,"source":{"url":"https://example.com/images/linux_installer.iso","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.UrlSource"},"categoryExtIds":["string"],"clusterLocationExtIds":["string"],"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","placementPolicyStatus":[{"placementPolicyExtId":"string","complianceStatus":"$UNKNOWN","enforcementMode":"$UNKNOWN","policyClusterExtIds":["string"],"enforcedClusterExtIds":["string"],"conflictingPolicyExtIds":["string"],"$objectType":"vmm.v4.content.ImagePlacementStatus"}],"$objectType":"vmm.v4.content.Image"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxInstaller.iso","description":"Installerwithupdatedkernel","type":"$UNKNOWN","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.ImageSha1Checksum"},"sizeBytes":0,"source":{"url":"https://example.com/images/linux_installer.iso","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.UrlSource"},"categoryExtIds":["string"],"clusterLocationExtIds":["string"],"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","placementPolicyStatus":[{"placementPolicyExtId":"string","complianceStatus":"$UNKNOWN","enforcementMode":"$UNKNOWN","policyClusterExtIds":["string"],"enforcedClusterExtIds":["string"],"conflictingPolicyExtIds":["string"],"$objectType":"vmm.v4.content.ImagePlacementStatus"}],"$objectType":"vmm.v4.content.Image"} \ - "https://host:port/api/vmm/v4.2/content/images" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagesApi imagesApi\ \ = new ImagesApi(client);\n\n Image image = new Image();\n\n \ \ // Image object initializations here...\n image.Name = \"LinuxInstaller.iso\"\ ; // required field\n image.Type = ImageType.UNKNOWN; // required\ \ field\n\n\n // Create request object with parameters\n var\ \ request = new CreateImageRequest {\n Body = image\n \ \ };\n try {\n CreateImageApiResponse createImageApiResponse\ \ = imagesApi.CreateImage(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/content/images/{extId}: get: tags: - Images summary: Get an image description: Retrieves the image details for the provided external identifier. operationId: getImageById parameters: - name: extId in: path description: The external identifier of an image. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8a719210-82fa-4ec6-9d64-242f136f23a7 responses: "200": description: Returns the requested image. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.content.Image' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Get operation" x-permissions: operationName: View Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Backup Admin - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: CSI System - name: Kubernetes Data Services System - name: Kubernetes Infrastructure Provision - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Images.GetImageByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.GetImageApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagesApi imagesApi = new ImagesApi(apiClient);\n\n \n \ \ String extId = \"AFB7d4B2-bE8c-0Ac8-aDbD-F3cEEF9f8AdD\";\n\n \ \ try {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n GetImageApiResponse getImageApiResponse\ \ = imagesApi.getImageById(GetImageByIdRequest.builder()\n \ \ .extId(extId)\n .build());\n\n System.out.println(getImageApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagesApi = new ImagesApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"dfaBbd95-1eA6-d4ee-fba2-C0dDd1ffACae\";\n\n\n\n\ \n\n imagesApi.getImageById(extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n images_api\ \ = ntnx_vmm_py_client.ImagesApi(api_client=client)\n \n ext_id =\ \ \"d73F7f9d-3Ccd-CBfA-CBf6-ddBCfaDF3F74\"\n\n\n try:\n api_response\ \ = images_api.get_image_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/images\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagesServiceApiInstance\ \ *api.ImagesServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ ImagesServiceApiInstance = api.NewImagesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"DD03b1c7-72bf-c6bD-4fcb-daEdDfFceEd0\"\ \n\n\n request := images.GetImageByIdRequest{ ExtId: &extId }\n response,\ \ error := ImagesServiceApiInstance.GetImageById(ctx, &request)\n if\ \ error != nil {\n fmt.Println(error)\n return\n }\n \ \ data, _ := response.GetData().(import1.Image)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/images/D1Dac7Be-4FDd-BA5c-92Bc-eaDe3A23Ac06" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/images/Ebc0DFDD-7f8B-FfBa-EbD0-842dA543Af9D" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagesApi imagesApi\ \ = new ImagesApi(client);\n\n String extId = \"BEEfafDd-ee2D-F2FE-11ec-85b5Cd0D1A13\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetImageByIdRequest {\n ExtId = extId\n };\n \ \ try {\n GetImageApiResponse getImageApiResponse = imagesApi.GetImageById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - Images summary: Update an image description: | Updates the image with the given external identifier. It is always recommended to perform a GET operation on a resource before performing a PUT operation to ensure that the correct ETag is used. operationId: updateImageById parameters: - name: extId in: path description: The external identifier of an image. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: bf28e577-1d5d-4491-a015-7d010bf50c21 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: dcd87076-1b95-4c1c-a151-b00f53e69fdd requestBody: description: Updated image request. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.Image' required: true responses: "202": description: The request to update an image is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Put operation" x-permissions: operationName: Update Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Account Owner - name: Administrator - name: Project Manager - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Images.UpdateImageByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Images.GetImageByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.content.ImageType;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.Image;\nimport com.nutanix.dp1.vmm.vmm.v4.content.GetImageApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.UpdateImageApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagesApi imagesApi = new ImagesApi(apiClient);\n\n Image image\ \ = new Image();\n\n // Image object initializations here...\n \ \ image.setName(\"LinuxInstaller.iso\"); // required field\n \ \ image.setType(ImageType.UNKNOWN); // required field\n \n \ \ String extId = \"FadFdB2f-1F4a-499e-A06F-acCF4f7DFaB0\";\n\n \ \ // perform GET call\n GetImageApiResponse getResponse = null;\n\ \ try {\n getResponse = imagesApi.getImageById(GetImageByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateImageApiResponse\ \ updateImageApiResponse = imagesApi.updateImageById(UpdateImageByIdRequest.builder()\n\ \ .extId(extId)\n .build(), image, opts);\n\ \n System.out.println(updateImageApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagesApi, ImageType, Image, GetImageApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagesApi = new ImagesApi(apiClientInstance);\n\nfunction sample() {\n\ \ let image = new Image();\n\n // Image object initializations here...\n\ \ image.setName(\"LinuxInstaller.iso\"); // required field\n image.setType(ImageType.UNKNOWN);\ \ // required field\n image = JSON.stringify(image);\n\n \n let\ \ extId = \"9beDeE4C-AE79-C78C-8EFe-ae11CA90DcEB\";\n\n\n // Perform\ \ Get call\n imagesApi.getImageById(extId).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ // Extract E-Tag Header\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n\n imagesApi.updateImageById(extId,\ \ image, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n images_api\ \ = ntnx_vmm_py_client.ImagesApi(api_client=client)\n image = ntnx_vmm_py_client.Image()\n\ \n # Image object initializations here...\n image.name = \"LinuxInstaller.iso\"\ \ # required field\n image.type = ntnx_vmm_py_client.ImageType._UNKNOWN\ \ # required field\n \n ext_id = \"a4E5fcdB-9fd2-deBD-BDC8-d3BeDCc1ABEC\"\ \n\n try:\n api_response = images_api.get_image_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = images_api.update_image_by_id(extId=ext_id,\ \ body=image, if_match=etag_value)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/images\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagesServiceApiInstance\ \ *api.ImagesServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ ImagesServiceApiInstance = api.NewImagesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n image := import1.NewImage()\n\n\ \ // Image object initializations here...\n\n \n extId := \"B7aa5aCA-FE57-7DcF-20f3-6264ac8d6Dfb\"\ \n\n getRequest := images.GetImageByIdRequest{ extId: &extId }\n getResponse,\ \ err := ImagesServiceApiInstance.GetImageById(ctx, &getRequest)\n if\ \ err != nil {\n fmt.Println(err)\n return\n }\n\n //\ \ Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := images.UpdateImageByIdRequest{ ExtId: &extId, Body: image\ \ }\n response, error := ImagesServiceApiInstance.UpdateImageById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/content/images/AFDdDfF9-ADBB-14ea-B8Eb-EB4BaCdbDAa0" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxInstaller.iso","description":"Installerwithupdatedkernel","type":"$UNKNOWN","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.ImageSha1Checksum"},"sizeBytes":0,"source":{"url":"https://example.com/images/linux_installer.iso","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.UrlSource"},"categoryExtIds":["string"],"clusterLocationExtIds":["string"],"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","placementPolicyStatus":[{"placementPolicyExtId":"string","complianceStatus":"$UNKNOWN","enforcementMode":"$UNKNOWN","policyClusterExtIds":["string"],"enforcedClusterExtIds":["string"],"conflictingPolicyExtIds":["string"],"$objectType":"vmm.v4.content.ImagePlacementStatus"}],"$objectType":"vmm.v4.content.Image"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxInstaller.iso","description":"Installerwithupdatedkernel","type":"$UNKNOWN","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.ImageSha1Checksum"},"sizeBytes":0,"source":{"url":"https://example.com/images/linux_installer.iso","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.UrlSource"},"categoryExtIds":["string"],"clusterLocationExtIds":["string"],"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","ownerExtId":"string","ownerName":"string","placementPolicyStatus":[{"placementPolicyExtId":"string","complianceStatus":"$UNKNOWN","enforcementMode":"$UNKNOWN","policyClusterExtIds":["string"],"enforcedClusterExtIds":["string"],"conflictingPolicyExtIds":["string"],"$objectType":"vmm.v4.content.ImagePlacementStatus"}],"$objectType":"vmm.v4.content.Image"} \ - "https://host:port/api/vmm/v4.2/content/images/B5f1a0D5-7C57-AABC-efEE-ccDffcDBEbeA" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagesApi imagesApi\ \ = new ImagesApi(client);\n\n Image image = new Image();\n\n \ \ // Image object initializations here...\n image.Name = \"LinuxInstaller.iso\"\ ; // required field\n image.Type = ImageType.UNKNOWN; // required\ \ field\n\n String extId = \"4EcaEabd-d8fA-5Ddb-aeB5-ceceA5e1f9CA\"\ ;\n\n // perform GET call\n var getRequest = new GetImageByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetImageApiResponse\ \ getResponse = imagesApi.GetImageById(getRequest);\n } catch(ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n \ \ // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateImageByIdRequest {\n ExtId = extId,\n \ \ Body = image,\n \n \n };\n \ \ try {\n UpdateImageApiResponse updateImageApiResponse =\ \ imagesApi.UpdateImageById(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" delete: tags: - Images summary: Delete an image description: Deletes the image with the given external identifier. operationId: deleteImageById parameters: - name: extId in: path description: The external identifier of an image. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 995c64a9-f45d-486c-b1e7-0fd11fb75013 responses: "202": description: The request to delete an image is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Delete operation" x-permissions: operationName: Delete Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Account Owner - name: Administrator - name: Project Manager - deprecated: true name: Self-Service Admin - name: CSI System - name: Kubernetes Data Services System - name: Kubernetes Infrastructure Provision - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.ImagesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Images.DeleteImageByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.DeleteImageApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ ImagesApi imagesApi = new ImagesApi(apiClient);\n\n \n \ \ String extId = \"bFfEEA9c-7a7c-B038-82BE-f81b8628DF9F\";\n\n \ \ try {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n DeleteImageApiResponse deleteImageApiResponse\ \ = imagesApi.deleteImageById(DeleteImageByIdRequest.builder()\n \ \ .extId(extId)\n .build());\n\n System.out.println(deleteImageApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, ImagesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let imagesApi = new ImagesApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"E6Bee8EB-9eDa-4dbC-1AaE-b3B0AD45aDbE\";\n\n\n\n\ \n\n imagesApi.deleteImageById(extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n images_api\ \ = ntnx_vmm_py_client.ImagesApi(api_client=client)\n \n ext_id =\ \ \"f8CbadDF-CDbf-E26A-DE4B-bB20DFa14abA\"\n\n\n try:\n api_response\ \ = images_api.delete_image_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/images\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n ImagesServiceApiInstance\ \ *api.ImagesServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ ImagesServiceApiInstance = api.NewImagesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"0EebF4ab-A27b-09ab-cd73-Ee7E0FFFFCF3\"\ \n\n\n request := images.DeleteImageByIdRequest{ ExtId: &extId }\n \ \ response, error := ImagesServiceApiInstance.DeleteImageById(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/content/images/FAcAAC74-AE4e-b0e4-cfBB-BcbDBA1C05De" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/images/aE07465d-e73E-68a2-Fc5D-cbFbaa4CF8D1" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagesApi imagesApi\ \ = new ImagesApi(client);\n\n String extId = \"7caaCbea-B9D6-7D5d-CDC3-F4cDfA5d5cd2\"\ ;\n\n // Create request object with parameters\n var request\ \ = new DeleteImageByIdRequest {\n ExtId = extId\n };\n\ \ try {\n DeleteImageApiResponse deleteImageApiResponse\ \ = imagesApi.DeleteImageById(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/content/images/$actions/import: post: tags: - Images summary: Import images from Prism Element description: Imports images owned by a registered Prism Element cluster into the current Prism Central. operationId: importImage parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 9d845bd1-1c98-4065-ad62-c888931e7ce6 requestBody: description: Reference to the Prism Element cluster and its images to be imported. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.ImageImportConfig' required: true responses: "202": description: The request to import image is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images/$actions/import Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images/$actions/import Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images/$actions/import Post operation x-permissions: operationName: Migrate Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.ImagesApi; import com.nutanix.dp1.vmm.vmm.v4.request.Images.ImportImageRequest; import com.nutanix.dp1.vmm.vmm.v4.content.ImageImportConfig; import com.nutanix.dp1.vmm.vmm.v4.content.ImportImageApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. ImagesApi imagesApi = new ImagesApi(apiClient); ImageImportConfig imageImportConfig = new ImageImportConfig(); // ImageImportConfig object initializations here... imageImportConfig.setClusterExtId("B4FcFbaC-E36f-9Ec8-AC1a-FDCC75dc9BAc"); // required field imageImportConfig.setImagesExtIds(new ArrayList<>()); // required field try { // Pass in parameters using the request builder object associated with the operation. ImportImageApiResponse importImageApiResponse = imagesApi.importImage(ImportImageRequest.builder() .build(), imageImportConfig); System.out.println(importImageApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, ImagesApi, ImageImportConfig } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let imagesApi = new ImagesApi(apiClientInstance); function sample() { let imageImportConfig = new ImageImportConfig(); // ImageImportConfig object initializations here... imageImportConfig.setClusterExtId("5fdEeb8f-D7Aa-8bdb-Dd23-1dCdC9aAC0B9"); // required field imageImportConfig.setImagesExtIds([]); // required field imageImportConfig = JSON.stringify(imageImportConfig); imagesApi.importImage(imageImportConfig).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) images_api = ntnx_vmm_py_client.ImagesApi(api_client=client) imageImportConfig = ntnx_vmm_py_client.ImageImportConfig() # ImageImportConfig object initializations here... imageImportConfig.cluster_ext_id = "DEc68F3C-6C1A-68ae-d8B8-13eB1f1Efd6f" # required field imageImportConfig.images_ext_ids = [] # required field try: api_response = images_api.import_image(body=imageImportConfig) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/images" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient ImagesServiceApiInstance *api.ImagesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. ImagesServiceApiInstance = api.NewImagesServiceApi(ApiClientInstance) ctx := context.Background() imageImportConfig := import1.NewImageImportConfig() // ImageImportConfig object initializations here... request := images.ImportImageRequest{ Body: imageImportConfig } response, error := ImagesServiceApiInstance.ImportImage(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/images/$actions/import" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"clusterExtId":"string","imagesExtIds":["string"],"$objectType":"vmm.v4.content.ImageImportConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"clusterExtId":"string","imagesExtIds":["string"],"$objectType":"vmm.v4.content.ImageImportConfig"} \ - "https://host:port/api/vmm/v4.2/content/images/$actions/import" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n ImagesApi imagesApi\ \ = new ImagesApi(client);\n\n ImageImportConfig imageImportConfig\ \ = new ImageImportConfig();\n\n // ImageImportConfig object initializations\ \ here...\n imageImportConfig.ClusterExtId = \"da993fbb-27ef-4B85-f8AA-fcbBAA57a5dD\"\ ; // required field\n imageImportConfig.ImagesExtIds = new ArrayList();\ \ // required field\n\n\n // Create request object with parameters\n\ \ var request = new ImportImageRequest {\n Body = imageImportConfig\n\ \ };\n try {\n ImportImageApiResponse importImageApiResponse\ \ = imagesApi.ImportImage(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/content/images/{imageExtId}/file: get: tags: - Images summary: Download an image description: Downloads the image with the given external identifier. operationId: getFileByImageId parameters: - name: imageExtId in: path description: The external identifier of an image. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 059086ad-f174-4991-83a5-9c28ba62271d responses: "302": description: Returns the requested image file. headers: Location: description: The redirect download URL for the image. style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?([^:\\/\\s]*)((\\/\\w+)*(:[0-9]+)*?\\\ /)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$" type: string X-Redirect-Token: description: The cookie to be used along with the redirect download URL for downloading the image. style: simple explode: false schema: type: string example: NTNX_IGW_SESSION=eyJmb28iOiJiYXIifQ content: application/octet-stream: schema: type: string format: binary "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{imageExtId}/file\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{imageExtId}/file\ \ Get operation" x-permissions: operationName: Download Image deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 3 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" /vmm/v4.2/content/ovas: get: tags: - Ovas summary: List OVAs description: "This lists all accessible OVAs using the default pagination, which\ \ can be customized." operationId: listOvas parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: diskFormat example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$filter=diskFormat\ \ eq Vmm.Content.OvaDiskFormat'QCOW2'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$filter=name eq\ \ 'LinuxServer_2.1_OVA'" - name: parentVm example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$filter=parentVm\ \ eq 'LinuxServer_VM'" - name: sizeBytes example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$filter=sizeBytes\ \ eq 31" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$orderby=createTime" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$orderby=lastUpdateTime" - name: name example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$orderby=name" - name: sizeBytes example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$orderby=sizeBytes" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: clusterLocationExtIds example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=clusterLocationExtIds" - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=createTime" - name: createdBy example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=createdBy" - name: diskFormat example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=diskFormat" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=extId" - name: lastUpdateTime example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=lastUpdateTime" - name: links example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=links" - name: name example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=name" - name: parentVm example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=parentVm" - name: sizeBytes example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=sizeBytes" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=tenantId" - name: vmConfig example: "https://{host}:{port}/api/vmm/v4.2/content/ovas?$select=vmConfig" responses: "200": description: List of OVAs. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.content.Ova' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Get operation x-permissions: operationName: View Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 30 timeUnit: seconds - type: Small count: 30 timeUnit: seconds - type: Large count: 30 timeUnit: seconds - type: XLarge count: 30 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.OvasApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Ovas.ListOvasRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.ListOvasApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ OvasApi ovasApi = new OvasApi(apiClient);\n\n \n int\ \ page = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n ListOvasApiResponse listOvasApiResponse\ \ = ovasApi.listOvas(ListOvasRequest.builder()\n .$page(page)\n\ \ .$limit(limit)\n .$filter(null)\n \ \ .$orderby(null)\n .$select(null)\n \ \ .build());\n\n System.out.println(listOvasApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, OvasApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let ovasApi = new OvasApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; ovasApi.listOvas(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n ovas_api\ \ = ntnx_vmm_py_client.OvasApi(api_client=client)\n \n page = 0\n\ \ \n limit = 50\n\n\n try:\n api_response = ovas_api.list_ovas(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/ovas\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n OvasServiceApiInstance\ \ *api.OvasServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ OvasServiceApiInstance = api.NewOvasServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := ovas.ListOvasRequest{ Page_: &page_, Limit_:\ \ &limit_, Filter_: nil, Orderby_: nil, Select_: nil }\n response, error\ \ := OvasServiceApiInstance.ListOvas(ctx, &request)\n if error != nil\ \ {\n fmt.Println(error)\n return\n }\n data, _ := response.GetData().([]import1.Ova)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/ovas?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/ovas?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n OvasApi ovasApi\ \ = new OvasApi(client);\n\n int page = 0;\n int limit = 50;\n\ \ String filter = \"string_sample_data\";\n String orderby = \"\ string_sample_data\";\n String select = \"string_sample_data\";\n\n\ \ // Create request object with parameters\n var request =\ \ new ListOvasRequest {\n Page = page,\n Limit = limit,\n\ \ Filter = filter,\n Orderby = orderby,\n \ \ Select = select\n };\n try {\n ListOvasApiResponse\ \ listOvasApiResponse = ovasApi.ListOvas(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" post: tags: - Ovas summary: Create OVA description: Creates an OVA using the provided request body. The name and source are mandatory fields to create an OVA. operationId: createOva parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 9b5c369d-75a1-4a83-b739-91006a9ce54d requestBody: description: Parameters to create an OVA request. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.Ova' required: true responses: "202": description: The create OVA request has been accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Post operation x-permissions: operationName: Create Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 30 timeUnit: seconds - type: Small count: 30 timeUnit: seconds - type: Large count: 30 timeUnit: seconds - type: XLarge count: 30 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.OvasApi; import com.nutanix.dp1.vmm.vmm.v4.request.Ovas.CreateOvaRequest; import com.nutanix.dp1.vmm.vmm.v4.content.Ova; import com.nutanix.dp1.vmm.vmm.v4.content.CreateOvaApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. OvasApi ovasApi = new OvasApi(apiClient); Ova ova = new Ova(); // Ova object initializations here... ova.setName("LinuxServer_2.1_OVA"); // required field try { // Pass in parameters using the request builder object associated with the operation. CreateOvaApiResponse createOvaApiResponse = ovasApi.createOva(CreateOvaRequest.builder() .build(), ova); System.out.println(createOvaApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, OvasApi, Ova } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let ovasApi = new OvasApi(apiClientInstance); function sample() { let ova = new Ova(); // Ova object initializations here... ova.setName("LinuxServer_2.1_OVA"); // required field ova = JSON.stringify(ova); ovasApi.createOva(ova).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) ovas_api = ntnx_vmm_py_client.OvasApi(api_client=client) ova = ntnx_vmm_py_client.Ova() # Ova object initializations here... ova.name = "LinuxServer_2.1_OVA" # required field try: api_response = ovas_api.create_ova(body=ova) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/ovas" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient OvasServiceApiInstance *api.OvasServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. OvasServiceApiInstance = api.NewOvasServiceApi(ApiClientInstance) ctx := context.Background() ova := import1.NewOva() // Ova object initializations here... request := ovas.CreateOvaRequest{ Body: ova } response, error := OvasServiceApiInstance.CreateOva(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/ovas" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxServer_2.1_OVA","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.OvaSha1Checksum"},"sizeBytes":0,"source":{"url":"string","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.OvaUrlSource"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"iam.v4.authn.User"},"clusterLocationExtIds":["string"],"parentVm":"LinuxServer_VM","vmConfig":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"diskFormat":"$UNKNOWN","$objectType":"vmm.v4.content.Ova"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxServer_2.1_OVA","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.OvaSha1Checksum"},"sizeBytes":0,"source":{"url":"string","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.OvaUrlSource"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"iam.v4.authn.User"},"clusterLocationExtIds":["string"],"parentVm":"LinuxServer_VM","vmConfig":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"diskFormat":"$UNKNOWN","$objectType":"vmm.v4.content.Ova"} \ - "https://host:port/api/vmm/v4.2/content/ovas" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n OvasApi ovasApi\ \ = new OvasApi(client);\n\n Ova ova = new Ova();\n\n // Ova object\ \ initializations here...\n ova.Name = \"LinuxServer_2.1_OVA\"; //\ \ required field\n\n\n // Create request object with parameters\n\ \ var request = new CreateOvaRequest {\n Body = ova\n\ \ };\n try {\n CreateOvaApiResponse createOvaApiResponse\ \ = ovasApi.CreateOva(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" /vmm/v4.2/content/ovas/{extId}: get: tags: - Ovas summary: Get an OVA description: Retrieves the OVA details for the provided external identifier. operationId: getOvaById parameters: - name: extId in: path description: The external identifier for an OVA. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 6e3e5679-b356-42fb-b2f7-1601a61656c8 responses: "200": description: Returns the requested OVA. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.content.Ova' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Get operation" x-permissions: operationName: View Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 30 timeUnit: seconds - type: Small count: 30 timeUnit: seconds - type: Large count: 30 timeUnit: seconds - type: XLarge count: 30 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.OvasApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Ovas.GetOvaByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.GetOvaApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ OvasApi ovasApi = new OvasApi(apiClient);\n\n \n String\ \ extId = \"66Ab62FF-c0f9-8EdC-cc4A-fA629bcDd4dD\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetOvaApiResponse getOvaApiResponse =\ \ ovasApi.getOvaById(GetOvaByIdRequest.builder()\n .extId(extId)\n\ \ .build());\n\n System.out.println(getOvaApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, OvasApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let ovasApi = new OvasApi(apiClientInstance);\n\nfunction sample() {\n\n\ \ \n let extId = \"B9adCBCD-E8cB-d2bA-C34d-d7DEdEbc0BEF\";\n\n\n\n\ \n\n ovasApi.getOvaById(extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n ovas_api\ \ = ntnx_vmm_py_client.OvasApi(api_client=client)\n \n ext_id = \"\ 2A7C34ee-E3ad-1EcF-aCEF-7A2C0C753CBf\"\n\n\n try:\n api_response\ \ = ovas_api.get_ova_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/ovas\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n OvasServiceApiInstance\ \ *api.OvasServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ OvasServiceApiInstance = api.NewOvasServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"B321b104-6c31-2c5F-C931-d03f4FC585cB\"\ \n\n\n request := ovas.GetOvaByIdRequest{ ExtId: &extId }\n response,\ \ error := OvasServiceApiInstance.GetOvaById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.Ova)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/ovas/c0A6eCCF-caBa-82f7-aD2D-2d3dd4DbDCcF" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/ovas/2c4EfAAC-DfaD-eF7B-eEEe-df56A6d45fd7" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n OvasApi ovasApi\ \ = new OvasApi(client);\n\n String extId = \"b4BBeBFE-d4C9-BaCb-91fe-2DceA7FcDbD3\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetOvaByIdRequest {\n ExtId = extId\n };\n \ \ try {\n GetOvaApiResponse getOvaApiResponse = ovasApi.GetOvaById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - Ovas summary: Update an OVA description: | Updates an OVA with the given external identifier. It is always recommended to do a GET operation on a resource before a PUT operation to ensure the correct ETag is used. operationId: updateOvaById parameters: - name: extId in: path description: The external identifier for an OVA. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 3ca64804-7524-471f-a05b-0061fb4d6607 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 0ecd15ad-c39a-4b6f-9d61-eccd96596c88 requestBody: description: | Update the OVA entity. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.Ova' required: true responses: "202": description: The update OVA request has been accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Put operation" x-permissions: operationName: Update Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 30 timeUnit: seconds - type: Small count: 30 timeUnit: seconds - type: Large count: 30 timeUnit: seconds - type: XLarge count: 30 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.OvasApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Ovas.UpdateOvaByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Ovas.GetOvaByIdRequest;\nimport\ \ java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.content.Ova;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.GetOvaApiResponse;\nimport com.nutanix.dp1.vmm.vmm.v4.content.UpdateOvaApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ OvasApi ovasApi = new OvasApi(apiClient);\n\n Ova ova = new\ \ Ova();\n\n // Ova object initializations here...\n ova.setName(\"\ LinuxServer_2.1_OVA\"); // required field\n \n String extId\ \ = \"c2e1cc2A-Cdc5-4dbB-a4AA-CEAE3Da11E44\";\n\n // perform GET\ \ call\n GetOvaApiResponse getResponse = null;\n try {\n \ \ getResponse = ovasApi.getOvaById(GetOvaByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateOvaApiResponse\ \ updateOvaApiResponse = ovasApi.updateOvaById(UpdateOvaByIdRequest.builder()\n\ \ .extId(extId)\n .build(), ova, opts);\n\n\ \ System.out.println(updateOvaApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, OvasApi, Ova, GetOvaApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let ovasApi = new OvasApi(apiClientInstance);\n\nfunction sample() {\n \ \ let ova = new Ova();\n\n // Ova object initializations here...\n\ \ ova.setName(\"LinuxServer_2.1_OVA\"); // required field\n ova =\ \ JSON.stringify(ova);\n\n \n let extId = \"e537a4ca-dC03-0Ca5-C1b6-13CF7eE2bda3\"\ ;\n\n\n // Perform Get call\n ovasApi.getOvaById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n ovasApi.updateOvaById(extId, ova, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n ovas_api\ \ = ntnx_vmm_py_client.OvasApi(api_client=client)\n ova = ntnx_vmm_py_client.Ova()\n\ \n # Ova object initializations here...\n ova.name = \"LinuxServer_2.1_OVA\"\ \ # required field\n \n ext_id = \"cf6fab0a-bfF0-EFD5-DFc9-cd37c55A47d2\"\ \n\n try:\n api_response = ovas_api.get_ova_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = ovas_api.update_ova_by_id(extId=ext_id,\ \ body=ova, if_match=etag_value)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/ovas\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n OvasServiceApiInstance\ \ *api.OvasServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ OvasServiceApiInstance = api.NewOvasServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n ova := import1.NewOva()\n\n //\ \ Ova object initializations here...\n\n \n extId := \"fCF5deDf-FBFa-E9FD-eC39-77BafDe0eEEc\"\ \n\n getRequest := ovas.GetOvaByIdRequest{ extId: &extId }\n getResponse,\ \ err := OvasServiceApiInstance.GetOvaById(ctx, &getRequest)\n if err\ \ != nil {\n fmt.Println(err)\n return\n }\n\n // Extract\ \ E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := ovas.UpdateOvaByIdRequest{ ExtId: &extId, Body: ova }\n\ \ response, error := OvasServiceApiInstance.UpdateOvaById(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/content/ovas/0bd7Abdd-cB6D-aa1b-f050-45ECda7dccA7" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxServer_2.1_OVA","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.OvaSha1Checksum"},"sizeBytes":0,"source":{"url":"string","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.OvaUrlSource"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"iam.v4.authn.User"},"clusterLocationExtIds":["string"],"parentVm":"LinuxServer_VM","vmConfig":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"diskFormat":"$UNKNOWN","$objectType":"vmm.v4.content.Ova"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"LinuxServer_2.1_OVA","checksum":{"hexDigest":"string","$objectType":"vmm.v4.content.OvaSha1Checksum"},"sizeBytes":0,"source":{"url":"string","shouldAllowInsecureUrl":false,"basicAuth":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.content.UrlBasicAuth"},"$objectType":"vmm.v4.content.OvaUrlSource"},"createTime":"2015-07-20T15:49:04-07:00","lastUpdateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"iam.v4.authn.User"},"clusterLocationExtIds":["string"],"parentVm":"LinuxServer_VM","vmConfig":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"diskFormat":"$UNKNOWN","$objectType":"vmm.v4.content.Ova"} \ - "https://host:port/api/vmm/v4.2/content/ovas/ba9A5cdE-6efF-DFcA-ECD0-fAaBAaC6EfAc" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n OvasApi ovasApi\ \ = new OvasApi(client);\n\n Ova ova = new Ova();\n\n // Ova object\ \ initializations here...\n ova.Name = \"LinuxServer_2.1_OVA\"; //\ \ required field\n\n String extId = \"B5aFAb7D-a5Db-FC9d-2aA7-7E4835D0dDCE\"\ ;\n\n // perform GET call\n var getRequest = new GetOvaByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetOvaApiResponse\ \ getResponse = ovasApi.GetOvaById(getRequest);\n } catch(ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n \ \ // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateOvaByIdRequest {\n ExtId = extId,\n \ \ Body = ova,\n \n \n };\n try\ \ {\n UpdateOvaApiResponse updateOvaApiResponse = ovasApi.UpdateOvaById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Ovas summary: Delete an OVA description: Deletes the OVA based on the given external identifier. operationId: deleteOvaById parameters: - name: extId in: path description: The external identifier for an OVA. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 4c41eafe-82cc-44b3-93ff-cb5c6cf40150 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 7c89c7c6-2f0a-4aff-82b6-89ecd7e3ae38 responses: "202": description: The delete OVA request has been accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Delete operation" x-permissions: operationName: Delete Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 30 timeUnit: seconds - type: Small count: 30 timeUnit: seconds - type: Large count: 30 timeUnit: seconds - type: XLarge count: 30 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.OvasApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Ovas.DeleteOvaByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.DeleteOvaApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ OvasApi ovasApi = new OvasApi(apiClient);\n\n \n String\ \ extId = \"ceBbF81a-9aCF-E5F0-cFBc-FaFBBD9e2D84\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteOvaApiResponse deleteOvaApiResponse\ \ = ovasApi.deleteOvaById(DeleteOvaByIdRequest.builder()\n \ \ .extId(extId)\n .build());\n\n System.out.println(deleteOvaApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, OvasApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let ovasApi = new OvasApi(apiClientInstance);\n\nfunction sample() {\n\n\ \ \n let extId = \"CbBfdA65-DCC4-A5a3-DbbD-FC4FaBdAa829\";\n\n\n\n\ \n\n ovasApi.deleteOvaById(extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n ovas_api\ \ = ntnx_vmm_py_client.OvasApi(api_client=client)\n \n ext_id = \"\ cf08fc9b-180B-CcED-dbB5-CADfCBC9fC8f\"\n\n\n try:\n api_response\ \ = ovas_api.delete_ova_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/ovas\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n OvasServiceApiInstance\ \ *api.OvasServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ OvasServiceApiInstance = api.NewOvasServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"5F1aaFB1-a18E-8F8B-eB8d-ceFEcbDcDeF0\"\ \n\n\n request := ovas.DeleteOvaByIdRequest{ ExtId: &extId }\n response,\ \ error := OvasServiceApiInstance.DeleteOvaById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/content/ovas/eb8FAabd-dcf2-cEAA-AbC9-aFCd4AD89E29" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/ovas/5aDc53F0-a359-eBdf-AE9f-ec43BFA0a6b8" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n OvasApi ovasApi\ \ = new OvasApi(client);\n\n String extId = \"9d9A7EFe-ddF9-FA0d-FC0c-F389ab4eeA08\"\ ;\n\n // Create request object with parameters\n var request\ \ = new DeleteOvaByIdRequest {\n ExtId = extId\n };\n\ \ try {\n DeleteOvaApiResponse deleteOvaApiResponse =\ \ ovasApi.DeleteOvaById(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" /vmm/v4.2/content/ovas/{ovaExtId}/file: get: tags: - Ovas summary: Download an OVA description: | Downloads an OVA based on the given external identifier. This is a stream download of the OVA file. operationId: getFileByOvaId parameters: - name: ovaExtId in: path description: The external identifier for an OVA. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 4886b652-32fb-4896-bf97-30583d18a76e responses: "302": description: Downloaded the requested OVA file. headers: Location: description: The redirect download URL for the OVA. style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?([^:\\/\\s]*)((\\/\\w+)*(:[0-9]+)*?\\\ /)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$" type: string X-Redirect-Token: description: The cookie to be used along with the redirect download URL for downloading the OVA. style: simple explode: false schema: type: string example: NTNX_IGW_SESSION=eyJmb28iOiJiYXIifQ content: application/octet-stream: schema: type: string format: binary "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{ovaExtId}/file\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{ovaExtId}/file\ \ Get operation" x-permissions: operationName: Download Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 30 timeUnit: seconds - type: Small count: 30 timeUnit: seconds - type: Large count: 30 timeUnit: seconds - type: XLarge count: 30 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" /vmm/v4.2/content/ovas/{extId}/$actions/deploy: post: tags: - Ovas summary: Deploy VMs from an OVA description: | Deploys a VM from an OVA, allowing you to override the VM configuration if needed. operationId: deployOva parameters: - name: extId in: path description: The external identifier for an OVA. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 48b02500-d41d-44a0-848b-78bab00381cf - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 6de07846-6389-4f7a-87d1-e6f0999f16ff requestBody: description: Request to deploy a VM from an OVA. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.OvaDeploymentSpec' required: true responses: "202": description: The request to deploy an OVA is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}/$actions/deploy\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}/$actions/deploy\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}/$actions/deploy\ \ Post operation" x-permissions: operationName: Deploy Ova deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.OvasApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Ovas.DeployOvaRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.OvaVmConfigOverrideSpec;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.OvaDeploymentSpec;\nimport com.nutanix.dp1.vmm.vmm.v4.content.DeployOvaApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ OvasApi ovasApi = new OvasApi(apiClient);\n\n OvaDeploymentSpec\ \ ovaDeploymentSpec = new OvaDeploymentSpec();\n\n // OvaDeploymentSpec\ \ object initializations here...\n ovaDeploymentSpec.setClusterLocationExtId(\"\ d5f2BfB3-70c4-Fc42-E3bE-D4Dc1fCe1CCd\"); // required field\n ovaDeploymentSpec.setOverrideVmConfig(new\ \ OvaVmConfigOverrideSpec()); // required field\n \n String\ \ extId = \"4c3cDDdb-7BBF-1BCB-Be65-dd39Ad7bAd61\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeployOvaApiResponse deployOvaApiResponse\ \ = ovasApi.deployOva(DeployOvaRequest.builder()\n .extId(extId)\n\ \ .build(), ovaDeploymentSpec);\n\n System.out.println(deployOvaApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, OvasApi, OvaVmConfigOverrideSpec, OvaDeploymentSpec\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let ovasApi = new OvasApi(apiClientInstance);\n\nfunction sample() {\n \ \ let ovaDeploymentSpec = new OvaDeploymentSpec();\n\n // OvaDeploymentSpec\ \ object initializations here...\n ovaDeploymentSpec.setClusterLocationExtId(\"\ b4BcaD5E-DCd7-F18c-f659-7Ff04dC9EEFC\"); // required field\n ovaDeploymentSpec.setOverrideVmConfig(new\ \ OvaVmConfigOverrideSpec()); // required field\n ovaDeploymentSpec\ \ = JSON.stringify(ovaDeploymentSpec);\n\n \n let extId = \"e80E9BD2-43ff-35E3-2b20-EFABCc6EB5d0\"\ ;\n\n\n\n\n\n ovasApi.deployOva(extId, ovaDeploymentSpec).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n ovas_api\ \ = ntnx_vmm_py_client.OvasApi(api_client=client)\n ovaDeploymentSpec\ \ = ntnx_vmm_py_client.OvaDeploymentSpec()\n\n # OvaDeploymentSpec object\ \ initializations here...\n ovaDeploymentSpec.cluster_location_ext_id\ \ = \"8f1edBEB-1fC6-d51f-cfD4-FaAaa4fe13DE\" # required field\n ovaDeploymentSpec.override_vm_config\ \ = ntnx_vmm_py_client.OvaVmConfigOverrideSpec() # required field\n \ \ \n ext_id = \"DfafdeAA-f5e8-AEd6-bB25-7e5Bf5ca9dfA\"\n\n\n try:\n\ \ api_response = ovas_api.deploy_ova(extId=ext_id, body=ovaDeploymentSpec)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/ovas\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n OvasServiceApiInstance\ \ *api.OvasServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ OvasServiceApiInstance = api.NewOvasServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n ovaDeploymentSpec := import1.NewOvaDeploymentSpec()\n\ \n // OvaDeploymentSpec object initializations here...\n\n \n extId\ \ := \"c2CFb7C6-AcDC-Beff-84bB-c2Bf394c91e9\"\n\n\n request := ovas.DeployOvaRequest{\ \ ExtId: &extId, Body: ovaDeploymentSpec }\n response, error := OvasServiceApiInstance.DeployOva(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/ovas/a5aEdD83-9A7E-E59C-B3DA-CB2C7c2fe4D6/$actions/deploy" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"overrideVmConfig":{"name":"string","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"$objectType":"vmm.v4.ahv.config.OvaVmConfigOverrideSpec"},"clusterLocationExtId":"string","$objectType":"vmm.v4.content.OvaDeploymentSpec"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"overrideVmConfig":{"name":"string","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"$objectType":"vmm.v4.ahv.config.OvaVmConfigOverrideSpec"},"clusterLocationExtId":"string","$objectType":"vmm.v4.content.OvaDeploymentSpec"} \ - "https://host:port/api/vmm/v4.2/content/ovas/BdCE9cC1-89DA-62F9-CdeB-C1a0eBafAFde/$actions/deploy" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ OvasApi ovasApi = new OvasApi(client);\n\n OvaDeploymentSpec\ \ ovaDeploymentSpec = new OvaDeploymentSpec();\n\n // OvaDeploymentSpec\ \ object initializations here...\n ovaDeploymentSpec.ClusterLocationExtId\ \ = \"ef32da63-4D0D-DBED-6eAb-dCBAcb53FE25\"; // required field\n \ \ ovaDeploymentSpec.OverrideVmConfig = new OvaVmConfigOverrideSpec(); //\ \ required field\n\n String extId = \"032fD865-Fccf-1cCe-cEEf-A7d8A6EF4eFf\"\ ;\n\n // Create request object with parameters\n var request\ \ = new DeployOvaRequest {\n ExtId = extId,\n Body\ \ = ovaDeploymentSpec\n };\n try {\n DeployOvaApiResponse\ \ deployOvaApiResponse = ovasApi.DeployOva(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/stats/vms: get: tags: - Stats summary: List VM stats for all VMs description: "List VM stats for all VMs. Users can fetch the stats by specifying\ \ the following params in the request query: 1) '$select': comma-separated\ \ attributes with the prefix 'stats/', e.g. 'stats/controllerNumIo,stats/hypervisorNumIo'.\ \ 2) '$startTime': the start time for which stats should be reported, e.g.\ \ '2023-01-01T12:00:00.000-08:00'; 3) '$endTime': the end time for which stats\ \ should be reported; 4) '$samplingInterval': the sampling interval in seconds\ \ at which statistical data should be collected; 5) '$statType': the down-sampling\ \ operator to use while performing down-sampling on stats data; 6) '$orderby';\ \ 7) '$page'; 8) '$limit'; and 9) '$filter': the OData filter to use, e.g.\ \ 'stats/hypervisorCpuUsagePpm gt 100000 and stats/guestMemoryUsagePpm lt\ \ 2000000.'" operationId: listVmStats parameters: - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 34 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: stats/checkScore example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/checkScore\ \ eq 90)" - name: stats/cluster example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/cluster\ \ eq 'string')" - name: stats/controllerAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerAvgIoLatencyMicros\ \ eq 80)" - name: stats/controllerAvgReadIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerAvgReadIoLatencyMicros\ \ eq 79)" - name: stats/controllerAvgReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerAvgReadIoSizeKb\ \ eq 80)" - name: stats/controllerAvgWriteIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerAvgWriteIoLatencyMicros\ \ eq 43)" - name: stats/controllerAvgWriteIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerAvgWriteIoSizeKb\ \ eq 45)" - name: stats/controllerIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerIoBandwidthKbps\ \ eq 44)" - name: stats/controllerNumIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumIo\ \ eq 66)" - name: stats/controllerNumIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumIops\ \ eq 48)" - name: stats/controllerNumRandomIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumRandomIo\ \ eq 3)" - name: stats/controllerNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumReadIo\ \ eq 52)" - name: stats/controllerNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumReadIops\ \ eq 93)" - name: stats/controllerNumSeqIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumSeqIo\ \ eq 68)" - name: stats/controllerNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumWriteIo\ \ eq 38)" - name: stats/controllerNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerNumWriteIops\ \ eq 71)" - name: stats/controllerOplogDrainDestHddBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerOplogDrainDestHddBytes\ \ eq 96)" - name: stats/controllerOplogDrainDestSsdBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerOplogDrainDestSsdBytes\ \ eq 25)" - name: stats/controllerRandomIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerRandomIoPpm\ \ eq 55)" - name: stats/controllerReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadIoBandwidthKbps\ \ eq 71)" - name: stats/controllerReadIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadIoPpm\ \ eq 97)" - name: stats/controllerReadSourceEstoreHddLocalBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadSourceEstoreHddLocalBytes\ \ eq 71)" - name: stats/controllerReadSourceEstoreHddRemoteBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadSourceEstoreHddRemoteBytes\ \ eq 3)" - name: stats/controllerReadSourceEstoreSsdLocalBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadSourceEstoreSsdLocalBytes\ \ eq 62)" - name: stats/controllerReadSourceEstoreSsdRemoteBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadSourceEstoreSsdRemoteBytes\ \ eq 75)" - name: stats/controllerReadSourceOplogBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerReadSourceOplogBytes\ \ eq 92)" - name: stats/controllerSeqIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerSeqIoPpm\ \ eq 67)" - name: stats/controllerSharedUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerSharedUsageBytes\ \ eq 75)" - name: stats/controllerSnapshotUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerSnapshotUsageBytes\ \ eq 54)" - name: stats/controllerStorageTierSsdUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerStorageTierSsdUsageBytes\ \ eq 29)" - name: stats/controllerTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerTimespanMicros\ \ eq 36)" - name: stats/controllerTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerTotalIoSizeKb\ \ eq 61)" - name: stats/controllerTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerTotalIoTimeMicros\ \ eq 82)" - name: stats/controllerTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerTotalReadIoSizeKb\ \ eq 80)" - name: stats/controllerTotalReadIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerTotalReadIoTimeMicros\ \ eq 22)" - name: stats/controllerTotalTransformedUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerTotalTransformedUsageBytes\ \ eq 50)" - name: stats/controllerUserBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerUserBytes\ \ eq 98)" - name: stats/controllerWriteDestEstoreHddBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWriteDestEstoreHddBytes\ \ eq 35)" - name: stats/controllerWriteDestEstoreSsdBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWriteDestEstoreSsdBytes\ \ eq 22)" - name: stats/controllerWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWriteIoBandwidthKbps\ \ eq 64)" - name: stats/controllerWriteIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWriteIoPpm\ \ eq 29)" - name: stats/controllerWss120SecondReadMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWss120SecondReadMb\ \ eq 50)" - name: stats/controllerWss120SecondUnionMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWss120SecondUnionMb\ \ eq 80)" - name: stats/controllerWss120SecondWriteMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWss120SecondWriteMb\ \ eq 70)" - name: stats/controllerWss3600SecondReadMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWss3600SecondReadMb\ \ eq 1)" - name: stats/controllerWss3600SecondUnionMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWss3600SecondUnionMb\ \ eq 60)" - name: stats/controllerWss3600SecondWriteMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/controllerWss3600SecondWriteMb\ \ eq 81)" - name: stats/diskCapacityBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/diskCapacityBytes\ \ eq 86)" - name: stats/diskUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/diskUsagePpm\ \ eq 30)" - name: stats/frameBufferUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/frameBufferUsagePpm\ \ eq 24)" - name: stats/gpuUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/gpuUsagePpm\ \ eq 22)" - name: stats/guestMemoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/guestMemoryUsagePpm\ \ eq 30)" - name: stats/hypervisorAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorAvgIoLatencyMicros\ \ eq 97)" - name: stats/hypervisorCpuReadyTimePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorCpuReadyTimePpm\ \ eq 95)" - name: stats/hypervisorCpuUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorCpuUsagePpm\ \ eq 82)" - name: stats/hypervisorIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorIoBandwidthKbps\ \ eq 54)" - name: stats/hypervisorMemoryBalloonReclaimTargetBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorMemoryBalloonReclaimTargetBytes\ \ eq 27)" - name: stats/hypervisorMemoryBalloonReclaimedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorMemoryBalloonReclaimedBytes\ \ eq 78)" - name: stats/hypervisorMemoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorMemoryUsagePpm\ \ eq 97)" - name: stats/hypervisorNumIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumIo\ \ eq 1)" - name: stats/hypervisorNumIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumIops\ \ eq 1)" - name: stats/hypervisorNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumReadIo\ \ eq 92)" - name: stats/hypervisorNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumReadIops\ \ eq 29)" - name: stats/hypervisorNumReceivePacketsDropped example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumReceivePacketsDropped\ \ eq 16)" - name: stats/hypervisorNumReceivedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumReceivedBytes\ \ eq 97)" - name: stats/hypervisorNumTransmitPacketsDropped example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumTransmitPacketsDropped\ \ eq 20)" - name: stats/hypervisorNumTransmittedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumTransmittedBytes\ \ eq 90)" - name: stats/hypervisorNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumWriteIo\ \ eq 66)" - name: stats/hypervisorNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorNumWriteIops\ \ eq 30)" - name: stats/hypervisorReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorReadIoBandwidthKbps\ \ eq 44)" - name: stats/hypervisorSwapInRateKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorSwapInRateKbps\ \ eq 45)" - name: stats/hypervisorSwapOutRateKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorSwapOutRateKbps\ \ eq 70)" - name: stats/hypervisorTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorTimespanMicros\ \ eq 67)" - name: stats/hypervisorTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorTotalIoSizeKb\ \ eq 98)" - name: stats/hypervisorTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorTotalIoTimeMicros\ \ eq 38)" - name: stats/hypervisorTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorTotalReadIoSizeKb\ \ eq 44)" - name: stats/hypervisorType example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorType\ \ eq 'string')" - name: stats/hypervisorVmRunningTimeUsecs example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorVmRunningTimeUsecs\ \ eq 85)" - name: stats/hypervisorWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/hypervisorWriteIoBandwidthKbps\ \ eq 17)" - name: stats/memoryReservedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/memoryReservedBytes\ \ eq 0)" - name: stats/memoryUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/memoryUsageBytes\ \ eq 62)" - name: stats/memoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/memoryUsagePpm\ \ eq 27)" - name: stats/numVcpusUsedPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/numVcpusUsedPpm\ \ eq 1)" - name: stats/physicalMemoryAllocatedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$filter=stats/any(a:a/physicalMemoryAllocatedBytes\ \ eq 12)" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: stats/checkScore example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/checkScore" - name: stats/controllerAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerAvgIoLatencyMicros" - name: stats/controllerAvgReadIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerAvgReadIoLatencyMicros" - name: stats/controllerAvgReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerAvgReadIoSizeKb" - name: stats/controllerAvgWriteIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerAvgWriteIoLatencyMicros" - name: stats/controllerAvgWriteIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerAvgWriteIoSizeKb" - name: stats/controllerIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerIoBandwidthKbps" - name: stats/controllerNumIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumIo" - name: stats/controllerNumIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumIops" - name: stats/controllerNumRandomIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumRandomIo" - name: stats/controllerNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumReadIo" - name: stats/controllerNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumReadIops" - name: stats/controllerNumSeqIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumSeqIo" - name: stats/controllerNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumWriteIo" - name: stats/controllerNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerNumWriteIops" - name: stats/controllerOplogDrainDestHddBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerOplogDrainDestHddBytes" - name: stats/controllerOplogDrainDestSsdBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerOplogDrainDestSsdBytes" - name: stats/controllerRandomIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerRandomIoPpm" - name: stats/controllerReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadIoBandwidthKbps" - name: stats/controllerReadIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadIoPpm" - name: stats/controllerReadSourceEstoreHddLocalBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadSourceEstoreHddLocalBytes" - name: stats/controllerReadSourceEstoreHddRemoteBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadSourceEstoreHddRemoteBytes" - name: stats/controllerReadSourceEstoreSsdLocalBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadSourceEstoreSsdLocalBytes" - name: stats/controllerReadSourceEstoreSsdRemoteBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadSourceEstoreSsdRemoteBytes" - name: stats/controllerReadSourceOplogBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerReadSourceOplogBytes" - name: stats/controllerSeqIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerSeqIoPpm" - name: stats/controllerSharedUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerSharedUsageBytes" - name: stats/controllerSnapshotUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerSnapshotUsageBytes" - name: stats/controllerStorageTierSsdUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerStorageTierSsdUsageBytes" - name: stats/controllerTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerTimespanMicros" - name: stats/controllerTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerTotalIoSizeKb" - name: stats/controllerTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerTotalIoTimeMicros" - name: stats/controllerTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerTotalReadIoSizeKb" - name: stats/controllerTotalReadIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerTotalReadIoTimeMicros" - name: stats/controllerTotalTransformedUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerTotalTransformedUsageBytes" - name: stats/controllerUserBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerUserBytes" - name: stats/controllerWriteDestEstoreHddBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWriteDestEstoreHddBytes" - name: stats/controllerWriteDestEstoreSsdBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWriteDestEstoreSsdBytes" - name: stats/controllerWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWriteIoBandwidthKbps" - name: stats/controllerWriteIoPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWriteIoPpm" - name: stats/controllerWss120SecondReadMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWss120SecondReadMb" - name: stats/controllerWss120SecondUnionMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWss120SecondUnionMb" - name: stats/controllerWss120SecondWriteMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWss120SecondWriteMb" - name: stats/controllerWss3600SecondReadMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWss3600SecondReadMb" - name: stats/controllerWss3600SecondUnionMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWss3600SecondUnionMb" - name: stats/controllerWss3600SecondWriteMb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/controllerWss3600SecondWriteMb" - name: stats/diskCapacityBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/diskCapacityBytes" - name: stats/diskUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/diskUsagePpm" - name: stats/frameBufferUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/frameBufferUsagePpm" - name: stats/gpuUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/gpuUsagePpm" - name: stats/guestMemoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/guestMemoryUsagePpm" - name: stats/hypervisorAvgIoLatencyMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorAvgIoLatencyMicros" - name: stats/hypervisorCpuReadyTimePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorCpuReadyTimePpm" - name: stats/hypervisorCpuUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorCpuUsagePpm" - name: stats/hypervisorIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorIoBandwidthKbps" - name: stats/hypervisorMemoryBalloonReclaimTargetBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorMemoryBalloonReclaimTargetBytes" - name: stats/hypervisorMemoryBalloonReclaimedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorMemoryBalloonReclaimedBytes" - name: stats/hypervisorMemoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorMemoryUsagePpm" - name: stats/hypervisorNumIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumIo" - name: stats/hypervisorNumIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumIops" - name: stats/hypervisorNumReadIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumReadIo" - name: stats/hypervisorNumReadIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumReadIops" - name: stats/hypervisorNumReceivePacketsDropped example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumReceivePacketsDropped" - name: stats/hypervisorNumReceivedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumReceivedBytes" - name: stats/hypervisorNumTransmitPacketsDropped example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumTransmitPacketsDropped" - name: stats/hypervisorNumTransmittedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumTransmittedBytes" - name: stats/hypervisorNumWriteIo example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumWriteIo" - name: stats/hypervisorNumWriteIops example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorNumWriteIops" - name: stats/hypervisorReadIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorReadIoBandwidthKbps" - name: stats/hypervisorSwapInRateKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorSwapInRateKbps" - name: stats/hypervisorSwapOutRateKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorSwapOutRateKbps" - name: stats/hypervisorTimespanMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorTimespanMicros" - name: stats/hypervisorTotalIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorTotalIoSizeKb" - name: stats/hypervisorTotalIoTimeMicros example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorTotalIoTimeMicros" - name: stats/hypervisorTotalReadIoSizeKb example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorTotalReadIoSizeKb" - name: stats/hypervisorVmRunningTimeUsecs example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorVmRunningTimeUsecs" - name: stats/hypervisorWriteIoBandwidthKbps example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/hypervisorWriteIoBandwidthKbps" - name: stats/memoryReservedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/memoryReservedBytes" - name: stats/memoryUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/memoryUsageBytes" - name: stats/memoryUsagePpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/memoryUsagePpm" - name: stats/numVcpusUsedPpm example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/numVcpusUsedPpm" - name: stats/physicalMemoryAllocatedBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$orderby=stats/physicalMemoryAllocatedBytes" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$select=extId" - name: links example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$select=links" - name: stats example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$select=stats" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/ahv/stats/vms?$select=tenantId" responses: "200": description: Returns the list of VM stats for all VMs. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmStats' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms Get operation x-permissions: operationName: View Virtual Machine Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 2 timeUnit: seconds - type: XLarge count: 2 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.StatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Stats.ListVmStatsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.stats.ListVmStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ StatsApi statsApi = new StatsApi(apiClient);\n\n // Datetime\ \ needs to be in RFC3339 format\n OffsetDateTime startTime = OffsetDateTime.now();\n\ \ // Datetime needs to be in RFC3339 format\n OffsetDateTime\ \ endTime = OffsetDateTime.now();\n \n int samplingInterval\ \ = 1;\n \n Object statType = SOME_RAW_DATA;\n \n \ \ int page = 0;\n \n int limit = 50;\n\n try\ \ {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n AhvStatsListVmStatsApiResponse\ \ ahvStatsListVmStatsApiResponse = statsApi.listVmStats(ListVmStatsRequest.builder()\n\ \ .$startTime(startTime)\n .$endTime(endTime)\n\ \ .$samplingInterval(samplingInterval)\n .$statType(statType)\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(ahvStatsListVmStatsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, StatsApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let statsApi = new StatsApi(apiClientInstance); function sample() { //Datetime needs to be in RFC3339 format let $startTime = "2021-01-01T00:00:00-08:00"; //Datetime needs to be in RFC3339 format let $endTime = "2021-01-01T00:00:00-08:00"; // Construct Optional Parameters var opts = {}; opts["$samplingInterval"] = 1; opts["$statType"] = SOME_RAW_DATA; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; statsApi.listVmStats($startTime, $endTime, opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n stats_api\ \ = ntnx_vmm_py_client.StatsApi(api_client=client)\n # Datetime needs\ \ to be in RFC3339 format\n start_time = datetime.datetime.Now()\n \ \ # Datetime needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = stats_api.list_vm_stats(_startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type, _page=page, _limit=limit)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/stats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n StatsServiceApiInstance\ \ *api.StatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ StatsServiceApiInstance = api.NewStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n // Datetime needs to be in RFC3339\ \ format\n startTime_ := time.Now()\n // Datetime needs to be in RFC3339\ \ format\n endTime_ := time.Now()\n \n samplingInterval_ := 1\n\ \ \n statType_ := SOME_RAW_DATA\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := stats.ListVmStatsRequest{ StartTime_: &startTime_,\ \ EndTime_: &endTime_, SamplingInterval_: &samplingInterval_, StatType_:\ \ &statType_, Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil,\ \ Select_: nil }\n response, error := StatsServiceApiInstance.ListVmStats(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmStats)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/stats/vms?$startTime=2021-01-01T00:00:00-08:00&$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$page=0&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/stats/vms?$startTime=2021-01-01T00:00:00-08:00&$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$page=0&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n StatsApi statsApi\ \ = new StatsApi(client);\n\n String startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n String endTime = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval\ \ = 1;\n Object statType = SOME_RAW_DATA;\n int page = 0;\n \ \ int limit = 50;\n String filter = \"string_sample_data\";\n \ \ String orderby = \"string_sample_data\";\n String select = \"\ string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListVmStatsRequest {\n StartTime =\ \ startTime,\n EndTime = endTime,\n SamplingInterval\ \ = samplingInterval,\n StatType = statType,\n Page\ \ = page,\n Limit = limit,\n Filter = filter,\n \ \ Orderby = orderby,\n Select = select\n };\n\ \ try {\n AhvStatsListVmStatsApiResponse ahvStatsListVmStatsApiResponse\ \ = statsApi.ListVmStats(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/stats/vms/{extId}: get: tags: - Stats summary: Get VM stats for a given VM description: "Get VM stats for a given VM. Users can fetch the stats by specifying\ \ the following params in the request query: 1) '$select': comma-separated\ \ attributes with the prefix 'stats/', e.g. 'stats/checkScore'. 2) '$startTime':\ \ the start time for which stats should be reported, e.g. '2023-01-01T12:00:00.000-08:00';\ \ 3) '$endTime': the end time for which stats should be reported; 4) '$samplingInterval':\ \ the sampling interval in seconds at which statistical data should be collected;\ \ 5) '$statType': the down-sampling operator to use while performing down-sampling\ \ on stats data" operationId: getVmStatsById parameters: - name: extId in: path description: Retrieve statistics for the VM with the specified external ID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1e5379f8-92d2-4334-ab3f-25bda62912c4 - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 36 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId - name: links - name: stats - name: tenantId responses: "200": description: Returns the stats for a requested VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmStats' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.StatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Stats.GetVmStatsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.stats.GetVmStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ StatsApi statsApi = new StatsApi(apiClient);\n\n \n String\ \ extId = \"A1F0C7Cf-A75D-bfAA-e293-5C4DDEA73C2B\";\n // Datetime\ \ needs to be in RFC3339 format\n OffsetDateTime startTime = OffsetDateTime.now();\n\ \ // Datetime needs to be in RFC3339 format\n OffsetDateTime\ \ endTime = OffsetDateTime.now();\n \n int samplingInterval\ \ = 1;\n \n Object statType = SOME_RAW_DATA;\n\n try\ \ {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n AhvStatsGetVmStatsApiResponse\ \ ahvStatsGetVmStatsApiResponse = statsApi.getVmStatsById(GetVmStatsByIdRequest.builder()\n\ \ .extId(extId)\n .$startTime(startTime)\n\ \ .$endTime(endTime)\n .$samplingInterval(samplingInterval)\n\ \ .$statType(statType)\n .$select(null)\n\ \ .build());\n\n System.out.println(ahvStatsGetVmStatsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, StatsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let statsApi = new StatsApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let extId = \"05EeBFBe-5aeb-7dc0-bDD5-DD18DD0bdBDb\";\n //Datetime\ \ needs to be in RFC3339 format\n let $startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n //Datetime needs to be in RFC3339 format\n let $endTime = \"2021-01-01T00:00:00-08:00\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $samplingInterval\"] = 1;\n opts[\"$statType\"] = SOME_RAW_DATA;\n \ \ opts[\"$select\"] = \"string_sample_data\";\n\n\n\n\n statsApi.getVmStatsById(extId,\ \ $startTime, $endTime, opts).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n stats_api\ \ = ntnx_vmm_py_client.StatsApi(api_client=client)\n \n ext_id = \"\ FbF8d8dc-BcEa-dCeA-9D5f-CCbBDcC6ADDB\"\n # Datetime needs to be in RFC3339\ \ format\n start_time = datetime.datetime.Now()\n # Datetime needs\ \ to be in RFC3339 format\n end_time = datetime.datetime.Now()\n \n\ \ sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\n\n \ \ try:\n api_response = stats_api.get_vm_stats_by_id(extId=ext_id,\ \ _startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/stats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n StatsServiceApiInstance\ \ *api.StatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ StatsServiceApiInstance = api.NewStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"5aC47Dfd-c3F5-aDaA-Ce8D-FC4CdfBB1e1B\"\ \n // Datetime needs to be in RFC3339 format\n startTime_ := time.Now()\n\ \ // Datetime needs to be in RFC3339 format\n endTime_ := time.Now()\n\ \ \n samplingInterval_ := 1\n \n statType_ := SOME_RAW_DATA\n\ \n\n request := stats.GetVmStatsByIdRequest{ ExtId: &extId, StartTime_:\ \ &startTime_, EndTime_: &endTime_, SamplingInterval_: &samplingInterval_,\ \ StatType_: &statType_, Select_: nil }\n response, error := StatsServiceApiInstance.GetVmStatsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmStats)\n \ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/stats/vms/50EE6CDE-9b5E-CcAd-C3CE-fecDD7caaDCd?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/stats/vms/f3C8C18b-AACc-Af1a-F4b2-12CF3db94eB8?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n StatsApi statsApi\ \ = new StatsApi(client);\n\n String extId = \"EcE75EE3-0acB-9Aab-df21-5aa1eb16BEBC\"\ ;\n String startTime = \"2021-01-01T00:00:00-08:00\";\n String\ \ endTime = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval =\ \ 1;\n Object statType = SOME_RAW_DATA;\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetVmStatsByIdRequest {\n ExtId = extId,\n \ \ StartTime = startTime,\n EndTime = endTime,\n SamplingInterval\ \ = samplingInterval,\n StatType = statType,\n Select\ \ = select\n };\n try {\n AhvStatsGetVmStatsApiResponse\ \ ahvStatsGetVmStatsApiResponse = statsApi.GetVmStatsById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/stats/vms/{vmExtId}/disks/{extId}: get: tags: - Stats summary: Get the stats for the specified VM disk description: "Fetches the stats for the specified VM disk. Users can fetch the\ \ stats by specifying the following params in the request query: 1) '$select':\ \ comma-separated attributes with the prefix 'stats/', e.g. 'stats/checkScore'.\ \ 2) '$startTime': the start time for which stats should be reported, e.g.\ \ '2023-01-01T12:00:00.000-08:00'; 3) '$endTime': the end time for which stats\ \ should be reported; 4) '$samplingInterval': the sampling interval in seconds\ \ at which statistical data should be collected; 5) '$statType': the down-sampling\ \ operator to use while performing down-sampling on stats data" operationId: getDiskStatsById parameters: - name: vmExtId in: path description: This field specifies the VM external ID when retrieving the stats for a given VM Disk. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ca118110-eec6-4276-830e-05fcbd2aa770 - name: extId in: path description: This field specifies the VM external ID when retrieving the stats for a given VM Disk. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2421ebf9-631a-4a8e-b3bd-6ffa1ce4f306 - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 94 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId - name: links - name: stats - name: tenantId - name: vmExtId responses: "200": description: Returns the requested stats. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmDiskStats' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine Disk Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.StatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Stats.GetDiskStatsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.stats.GetDiskStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ StatsApi statsApi = new StatsApi(apiClient);\n\n \n String\ \ vmExtId = \"0AbD9Fc9-E94c-b0e5-e4f1-43BE7F409402\";\n \n \ \ String extId = \"8d2fb39D-FC1f-0aBd-7E1e-Ed6De37cacE0\";\n //\ \ Datetime needs to be in RFC3339 format\n OffsetDateTime startTime\ \ = OffsetDateTime.now();\n // Datetime needs to be in RFC3339 format\n\ \ OffsetDateTime endTime = OffsetDateTime.now();\n \n \ \ int samplingInterval = 1;\n \n Object statType = SOME_RAW_DATA;\n\ \n try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n AhvStatsGetDiskStatsApiResponse\ \ ahvStatsGetDiskStatsApiResponse = statsApi.getDiskStatsById(GetDiskStatsByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .$startTime(startTime)\n .$endTime(endTime)\n\ \ .$samplingInterval(samplingInterval)\n .$statType(statType)\n\ \ .$select(null)\n .build());\n\n \ \ System.out.println(ahvStatsGetDiskStatsApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, StatsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let statsApi = new StatsApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let vmExtId = \"CC9983bb-Fc7c-DACB-ffEb-BB29efe2Ae1c\";\n \ \ \n let extId = \"A8036D40-cdF2-5A4f-6f0B-71d6D7aBAcdb\";\n //Datetime\ \ needs to be in RFC3339 format\n let $startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n //Datetime needs to be in RFC3339 format\n let $endTime = \"2021-01-01T00:00:00-08:00\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $samplingInterval\"] = 1;\n opts[\"$statType\"] = SOME_RAW_DATA;\n \ \ opts[\"$select\"] = \"string_sample_data\";\n\n\n\n\n statsApi.getDiskStatsById(vmExtId,\ \ extId, $startTime, $endTime, opts).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n stats_api\ \ = ntnx_vmm_py_client.StatsApi(api_client=client)\n \n vm_ext_id\ \ = \"798e1fd6-5f1f-c99B-cf4E-fDea34ABfbCc\"\n \n ext_id = \"fDecdCca-8DB4-AaCC-61ED-AE4aDCeBD1ba\"\ \n # Datetime needs to be in RFC3339 format\n start_time = datetime.datetime.Now()\n\ \ # Datetime needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\n\ \n try:\n api_response = stats_api.get_disk_stats_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, _startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/stats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n StatsServiceApiInstance\ \ *api.StatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ StatsServiceApiInstance = api.NewStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmExtId := \"2E6b8efe-DBbd-1AC5-B2D3-cEFAaEAcc0df\"\ \n \n extId := \"cFEBf6E2-ef9D-2Eca-44Ec-8DDf7BF3edDD\"\n // Datetime\ \ needs to be in RFC3339 format\n startTime_ := time.Now()\n // Datetime\ \ needs to be in RFC3339 format\n endTime_ := time.Now()\n \n samplingInterval_\ \ := 1\n \n statType_ := SOME_RAW_DATA\n\n\n request := stats.GetDiskStatsByIdRequest{\ \ VmExtId: &vmExtId, ExtId: &extId, StartTime_: &startTime_, EndTime_: &endTime_,\ \ SamplingInterval_: &samplingInterval_, StatType_: &statType_, Select_:\ \ nil }\n response, error := StatsServiceApiInstance.GetDiskStatsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmDiskStats)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/stats/vms/df2f5BDA-1E22-EeA4-d0cB-fDAbeC4a8CeC/disks/ed4498ce-DC9c-AAfE-5CaB-fDa3ebEC13F5?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/stats/vms/Ac9B5Ca2-CE1f-2eed-cDdE-d7FCf14fCF7A/disks/15179D5B-a5CF-1fdC-Cfbf-DdFBd33bcBcC?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n StatsApi statsApi\ \ = new StatsApi(client);\n\n String vmExtId = \"2DdE7C00-b6dF-DC80-0de9-DA6f443a1d2C\"\ ;\n String extId = \"d1dc01Fa-0bDC-cbac-cbAd-abCBD12CcCFd\";\n \ \ String startTime = \"2021-01-01T00:00:00-08:00\";\n String endTime\ \ = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval = 1;\n \ \ Object statType = SOME_RAW_DATA;\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetDiskStatsByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId,\n StartTime = startTime,\n \ \ EndTime = endTime,\n SamplingInterval = samplingInterval,\n\ \ StatType = statType,\n Select = select\n \ \ };\n try {\n AhvStatsGetDiskStatsApiResponse ahvStatsGetDiskStatsApiResponse\ \ = statsApi.GetDiskStatsById(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/ahv/stats/vms/{vmExtId}/nics/{extId}: get: tags: - Stats summary: Get the stats for the specified VM NIC description: "Fetches the stats for the specified VM NIC. Users can fetch the\ \ stats by specifying the following params in the request query: 1) '$select':\ \ comma-separated attributes with the prefix 'stats/', e.g. 'stats/checkScore'.\ \ 2) '$startTime': the start time for which stats should be reported, e.g.\ \ '2023-01-01T12:00:00.000-08:00'; 3) '$endTime': the end time for which stats\ \ should be reported; 4) '$samplingInterval': the sampling interval in seconds\ \ at which statistical data should be collected; 5) '$statType': the down-sampling\ \ operator to use while performing down-sampling on stats data" operationId: getNicStatsById parameters: - name: vmExtId in: path description: This field specifies the VM external ID when retrieving the stats for a given VM NIC. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d5859693-f417-4dce-85bc-8ac117d4de0e - name: extId in: path description: This field specifies the external ID of the VM NIC when retrieving stats for a given VM NIC. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: f75905f6-6d05-4e29-a12b-68a5f1d28bfe - name: $startTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $endTime in: query description: | 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 required: true style: form explode: false schema: type: string description: | 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 format: date-time example: 2009-09-23T14:30:00-07:00 - name: $samplingInterval in: query description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. required: false style: form explode: false schema: minimum: 1 type: integer description: | The sampling interval in seconds at which statistical data should be collected. For example, if you want performance statistics every 30 seconds, then provide the value as 30. example: 42 - name: $statType in: query required: false style: form explode: false schema: $ref: '#/components/schemas/common.v1.0.stats.DownSamplingOperator' - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId - name: links - name: stats - name: tenantId - name: vmExtId responses: "200": description: Returns the requested stats. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmNicStats' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine NIC Stats deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.StatsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Stats.GetNicStatsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.stats.GetNicStatsApiResponse;\nimport\ \ java.time.OffsetDateTime;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ StatsApi statsApi = new StatsApi(apiClient);\n\n \n String\ \ vmExtId = \"C7fe58d1-AAdB-6bbC-0c4A-eE8cAd0ACCea\";\n \n \ \ String extId = \"f2ecA4eb-B0Ca-bEbb-D79D-f1BCeae951dc\";\n //\ \ Datetime needs to be in RFC3339 format\n OffsetDateTime startTime\ \ = OffsetDateTime.now();\n // Datetime needs to be in RFC3339 format\n\ \ OffsetDateTime endTime = OffsetDateTime.now();\n \n \ \ int samplingInterval = 1;\n \n Object statType = SOME_RAW_DATA;\n\ \n try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n AhvStatsGetNicStatsApiResponse\ \ ahvStatsGetNicStatsApiResponse = statsApi.getNicStatsById(GetNicStatsByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .$startTime(startTime)\n .$endTime(endTime)\n\ \ .$samplingInterval(samplingInterval)\n .$statType(statType)\n\ \ .$select(null)\n .build());\n\n \ \ System.out.println(ahvStatsGetNicStatsApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, StatsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let statsApi = new StatsApi(apiClientInstance);\n\nfunction sample() {\n\ \n \n let vmExtId = \"1423EaE2-3CB7-CcA7-EaCC-bcDAeae8ee9E\";\n \ \ \n let extId = \"eA15F2D5-D5fD-FeBF-cDd9-E9D6601E7Ab5\";\n //Datetime\ \ needs to be in RFC3339 format\n let $startTime = \"2021-01-01T00:00:00-08:00\"\ ;\n //Datetime needs to be in RFC3339 format\n let $endTime = \"2021-01-01T00:00:00-08:00\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $samplingInterval\"] = 1;\n opts[\"$statType\"] = SOME_RAW_DATA;\n \ \ opts[\"$select\"] = \"string_sample_data\";\n\n\n\n\n statsApi.getNicStatsById(vmExtId,\ \ extId, $startTime, $endTime, opts).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\nimport datetime\n\nif __name__ == \"\ __main__\":\n # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n stats_api\ \ = ntnx_vmm_py_client.StatsApi(api_client=client)\n \n vm_ext_id\ \ = \"dadc8fDF-2Be7-bF9E-DCD8-e807Eff1ea86\"\n \n ext_id = \"AbF03e6c-4AA2-ebBA-e1Fe-bEFc598cAdbA\"\ \n # Datetime needs to be in RFC3339 format\n start_time = datetime.datetime.Now()\n\ \ # Datetime needs to be in RFC3339 format\n end_time = datetime.datetime.Now()\n\ \ \n sampling_interval = 1\n \n stat_type = SOME_RAW_DATA\n\n\ \n try:\n api_response = stats_api.get_nic_stats_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, _startTime=start_time, _endTime=end_time, _samplingInterval=sampling_interval,\ \ _statType=stat_type)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"time\"\n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/stats\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/stats\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n StatsServiceApiInstance\ \ *api.StatsServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ StatsServiceApiInstance = api.NewStatsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmExtId := \"fAf8Bc5B-F81d-64Ca-FBA8-Dd655A3B782C\"\ \n \n extId := \"CaddbBc3-f4fB-9A96-f1ce-Db1Eef1Ed4da\"\n // Datetime\ \ needs to be in RFC3339 format\n startTime_ := time.Now()\n // Datetime\ \ needs to be in RFC3339 format\n endTime_ := time.Now()\n \n samplingInterval_\ \ := 1\n \n statType_ := SOME_RAW_DATA\n\n\n request := stats.GetNicStatsByIdRequest{\ \ VmExtId: &vmExtId, ExtId: &extId, StartTime_: &startTime_, EndTime_: &endTime_,\ \ SamplingInterval_: &samplingInterval_, StatType_: &statType_, Select_:\ \ nil }\n response, error := StatsServiceApiInstance.GetNicStatsById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmNicStats)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/stats/vms/f4cFcEa1-eEae-1AA3-ADF8-a3e73A32eb2B/nics/6C2Be3F5-dbFa-cdE3-8BdA-8ea4CF9cCcea?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/stats/vms/AbbaB7Aa-e80E-F8d9-891D-3E2bABF5b7BF/nics/CE7EE0cC-C1Dc-42af-B0fF-a827F65eBAB6?$startTime=2021-01-01T00:00:00-08:00&$statType=SOME_RAW_DATA&$endTime=2021-01-01T00:00:00-08:00&$samplingInterval=1&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n StatsApi statsApi\ \ = new StatsApi(client);\n\n String vmExtId = \"ECDa8f7A-ADcb-C9aa-ec08-76bB1aDcec8f\"\ ;\n String extId = \"8F4CaFED-eAeA-a663-CBb4-cC1D0e5d731D\";\n \ \ String startTime = \"2021-01-01T00:00:00-08:00\";\n String endTime\ \ = \"2021-01-01T00:00:00-08:00\";\n int samplingInterval = 1;\n \ \ Object statType = SOME_RAW_DATA;\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetNicStatsByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId,\n StartTime = startTime,\n \ \ EndTime = endTime,\n SamplingInterval = samplingInterval,\n\ \ StatType = statType,\n Select = select\n \ \ };\n try {\n AhvStatsGetNicStatsApiResponse ahvStatsGetNicStatsApiResponse\ \ = statsApi.GetNicStatsById(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/config/template-placement-policies: get: tags: - TemplatePlacementPolicies summary: List template placement policies description: | Lists the template placement policies created on Prism Central, including details such as name, description and more. The API supports operations like filtering, sorting, selection and pagination. operationId: listTemplatePlacementPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: description example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$filter=description\ \ eq 'string'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$filter=name\ \ eq 'string'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$orderby=createTime" - name: name example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$orderby=name" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=createTime" - name: createdBy example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=createdBy" - name: description example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=description" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=extId" - name: name example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=name" - name: placementType example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=placementType" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/config/template-placement-policies?$select=updateTime" responses: "200": description: Returns the list of template placement policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.config.TemplatePlacementPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Get operation x-permissions: operationName: View Template Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 15 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2025.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.TemplatePlacementPolicies.ListTemplatePlacementPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.config.ListTemplatePlacementPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatePlacementPoliciesApi templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListTemplatePlacementPoliciesApiResponse\ \ listTemplatePlacementPoliciesApiResponse = templatePlacementPoliciesApi.listTemplatePlacementPolicies(ListTemplatePlacementPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(listTemplatePlacementPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, TemplatePlacementPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; templatePlacementPoliciesApi.listTemplatePlacementPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n template_placement_policies_api\ \ = ntnx_vmm_py_client.TemplatePlacementPoliciesApi(api_client=client)\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = template_placement_policies_api.list_template_placement_policies(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templateplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatePlacementPoliciesServiceApiInstance\ \ *api.TemplatePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatePlacementPoliciesServiceApiInstance = api.NewTemplatePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := templateplacementpolicies.ListTemplatePlacementPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_:\ \ nil }\n response, error := TemplatePlacementPoliciesServiceApiInstance.ListTemplatePlacementPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.TemplatePlacementPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/config/template-placement-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/config/template-placement-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Config;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatePlacementPoliciesApi\ \ templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(client);\n\ \n int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n String select =\ \ \"string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListTemplatePlacementPoliciesRequest {\n \ \ Page = page,\n Limit = limit,\n Filter =\ \ filter,\n Orderby = orderby,\n Select = select\n\ \ };\n try {\n ListTemplatePlacementPoliciesApiResponse\ \ listTemplatePlacementPoliciesApiResponse = templatePlacementPoliciesApi.ListTemplatePlacementPolicies(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - TemplatePlacementPolicies summary: Create a template placement policy description: | Creates a template placement policy based on the provided request body. operationId: createTemplatePlacementPolicy parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 9746f1b1-7f21-49c3-8877-5643263fe9ae requestBody: description: The following parameters are required to create a template placement policy. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.config.TemplatePlacementPolicy' required: true responses: "202": description: The request to create a template placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Post operation x-permissions: operationName: Create Template Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2025.1" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.TemplatePlacementPoliciesApi; import com.nutanix.dp1.vmm.vmm.v4.request.TemplatePlacementPolicies.CreateTemplatePlacementPolicyRequest; import com.nutanix.dp1.vmm.vmm.v4.config.TemplatePlacementPolicy; import com.nutanix.dp1.vmm.vmm.v4.config.CreateTemplatePlacementPolicyApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. TemplatePlacementPoliciesApi templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClient); TemplatePlacementPolicy templatePlacementPolicy = new TemplatePlacementPolicy(); // TemplatePlacementPolicy object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateTemplatePlacementPolicyApiResponse createTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.createTemplatePlacementPolicy(CreateTemplatePlacementPolicyRequest.builder() .build(), templatePlacementPolicy); System.out.println(createTemplatePlacementPolicyApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, TemplatePlacementPoliciesApi, TemplatePlacementPolicy } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClientInstance); function sample() { let templatePlacementPolicy = new TemplatePlacementPolicy(); // TemplatePlacementPolicy object initializations here... templatePlacementPolicy = JSON.stringify(templatePlacementPolicy); templatePlacementPoliciesApi.createTemplatePlacementPolicy(templatePlacementPolicy).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) template_placement_policies_api = ntnx_vmm_py_client.TemplatePlacementPoliciesApi(api_client=client) templatePlacementPolicy = ntnx_vmm_py_client.TemplatePlacementPolicy() # TemplatePlacementPolicy object initializations here... try: api_response = template_placement_policies_api.create_template_placement_policy(body=templatePlacementPolicy) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templateplacementpolicies" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/config" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient TemplatePlacementPoliciesServiceApiInstance *api.TemplatePlacementPoliciesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. TemplatePlacementPoliciesServiceApiInstance = api.NewTemplatePlacementPoliciesServiceApi(ApiClientInstance) ctx := context.Background() templatePlacementPolicy := import1.NewTemplatePlacementPolicy() // TemplatePlacementPolicy object initializations here... request := templateplacementpolicies.CreateTemplatePlacementPolicyRequest{ Body: templatePlacementPolicy } response, error := TemplatePlacementPoliciesServiceApiInstance.CreateTemplatePlacementPolicy(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/config/template-placement-policies" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"string","description":"string","placementType":"$UNKNOWN","contentFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"clusterFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":"string","updatedBy":"string","phony":"string","$objectType":"vmm.v4.config.TemplatePlacementPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"string","description":"string","placementType":"$UNKNOWN","contentFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"clusterFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":"string","updatedBy":"string","phony":"string","$objectType":"vmm.v4.config.TemplatePlacementPolicy"} \ - "https://host:port/api/vmm/v4.2/config/template-placement-policies" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Config;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatePlacementPoliciesApi\ \ templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(client);\n\ \n TemplatePlacementPolicy templatePlacementPolicy = new TemplatePlacementPolicy();\n\ \n // TemplatePlacementPolicy object initializations here...\n\n\n\ \ // Create request object with parameters\n var request =\ \ new CreateTemplatePlacementPolicyRequest {\n Body = templatePlacementPolicy\n\ \ };\n try {\n CreateTemplatePlacementPolicyApiResponse\ \ createTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.CreateTemplatePlacementPolicy(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/config/template-placement-policies/{extId}: get: tags: - TemplatePlacementPolicies summary: Get a template placement policy description: Retrieves the details of the template placement policy for the provided external identifier. operationId: getTemplatePlacementPolicyById parameters: - name: extId in: path description: The external identifier of the template placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: fd17cc76-4128-460d-8ed4-f86d7e39e5e9 responses: "200": description: Returns the details of the requested template placement policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.config.TemplatePlacementPolicy' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Get operation" x-permissions: operationName: View Template Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2025.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.TemplatePlacementPolicies.GetTemplatePlacementPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.config.GetTemplatePlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatePlacementPoliciesApi templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClient);\n\ \n \n String extId = \"6aFDc0Fe-Bc0e-0fD3-F8Be-DBfAF73D50ac\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetTemplatePlacementPolicyApiResponse\ \ getTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.getTemplatePlacementPolicyById(GetTemplatePlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getTemplatePlacementPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatePlacementPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"3b5Ae606-8Ca6-aDB4-2B4E-C575deba4Efa\"\ ;\n\n\n\n\n\n templatePlacementPoliciesApi.getTemplatePlacementPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n template_placement_policies_api\ \ = ntnx_vmm_py_client.TemplatePlacementPoliciesApi(api_client=client)\n\ \ \n ext_id = \"E3D7ec35-3BBA-AE0c-B4fB-ABae6A97eDc9\"\n\n\n try:\n\ \ api_response = template_placement_policies_api.get_template_placement_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templateplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatePlacementPoliciesServiceApiInstance\ \ *api.TemplatePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatePlacementPoliciesServiceApiInstance = api.NewTemplatePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"ACbfecDc-9Caa-C05f-c71A-ACFfd1bEfeDE\"\ \n\n\n request := templateplacementpolicies.GetTemplatePlacementPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := TemplatePlacementPoliciesServiceApiInstance.GetTemplatePlacementPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TemplatePlacementPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/config/template-placement-policies/8BCbC2Df-8dC5-AC5A-44AC-0AEEedaDCA4a" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/config/template-placement-policies/A7FcC6DC-Df5d-d094-315B-f1d3CefcfBC5" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Config;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatePlacementPoliciesApi\ \ templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(client);\n\ \n String extId = \"ECA1dFFc-c1c7-11ad-64fF-EBfeeeDfaCcF\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetTemplatePlacementPolicyByIdRequest {\n ExtId = extId\n \ \ };\n try {\n GetTemplatePlacementPolicyApiResponse\ \ getTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.GetTemplatePlacementPolicyById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - TemplatePlacementPolicies summary: Update a template placement policy description: | Revise the template placement policy using the specified external identifier and the provided request body. It is highly recommended to perform a GET operation on a resource prior to executing the PUT operation to ensure the correct ETag is utilized. operationId: updateTemplatePlacementPolicyById parameters: - name: extId in: path description: The external identifier of the template placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: c65f15c3-24ee-416f-b1e1-9c87ecdb7e2b - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 7ce6e2b9-4b41-4f13-be53-53cea79906e2 requestBody: description: The following parameters are required to update a template placement policy. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.config.TemplatePlacementPolicy' required: true responses: "202": description: The request to update a template placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Put operation" x-permissions: operationName: Update Template Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2025.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.TemplatePlacementPolicies.UpdateTemplatePlacementPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.TemplatePlacementPolicies.GetTemplatePlacementPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.config.TemplatePlacementPolicy;\n\ import com.nutanix.dp1.vmm.vmm.v4.config.GetTemplatePlacementPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.config.UpdateTemplatePlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatePlacementPoliciesApi templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClient);\n\ \n TemplatePlacementPolicy templatePlacementPolicy = new TemplatePlacementPolicy();\n\ \n // TemplatePlacementPolicy object initializations here...\n \ \ \n String extId = \"eCEc6f0C-FDd8-719c-316C-B837f736DdAf\"\ ;\n\n // perform GET call\n GetTemplatePlacementPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = templatePlacementPoliciesApi.getTemplatePlacementPolicyById(GetTemplatePlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateTemplatePlacementPolicyApiResponse\ \ updateTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.updateTemplatePlacementPolicyById(UpdateTemplatePlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), templatePlacementPolicy,\ \ opts);\n\n System.out.println(updateTemplatePlacementPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatePlacementPoliciesApi, TemplatePlacementPolicy,\ \ GetTemplatePlacementPolicyApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let templatePlacementPolicy = new TemplatePlacementPolicy();\n\ \n // TemplatePlacementPolicy object initializations here...\n templatePlacementPolicy\ \ = JSON.stringify(templatePlacementPolicy);\n\n \n let extId = \"\ A7fECaE1-fA4D-1EdA-7DEB-3CbbBdebcae3\";\n\n\n // Perform Get call\n \ \ templatePlacementPoliciesApi.getTemplatePlacementPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n templatePlacementPoliciesApi.updateTemplatePlacementPolicyById(extId,\ \ templatePlacementPolicy, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n\ \ console.log(`Error is: ${error}`);\n });\n });\n\n\ }\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n template_placement_policies_api\ \ = ntnx_vmm_py_client.TemplatePlacementPoliciesApi(api_client=client)\n\ \ templatePlacementPolicy = ntnx_vmm_py_client.TemplatePlacementPolicy()\n\ \n # TemplatePlacementPolicy object initializations here...\n \n \ \ ext_id = \"bB4ccFbC-8b01-b536-E6Ed-befCbbb7e4FE\"\n\n try:\n \ \ api_response = template_placement_policies_api.get_template_placement_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = template_placement_policies_api.update_template_placement_policy_by_id(extId=ext_id,\ \ body=templatePlacementPolicy, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templateplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatePlacementPoliciesServiceApiInstance\ \ *api.TemplatePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatePlacementPoliciesServiceApiInstance = api.NewTemplatePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n templatePlacementPolicy := import1.NewTemplatePlacementPolicy()\n\ \n // TemplatePlacementPolicy object initializations here...\n\n \n\ \ extId := \"a41a8DF7-Bcff-FCAa-2bB3-fcDbfFcFdCFE\"\n\n getRequest\ \ := templateplacementpolicies.GetTemplatePlacementPolicyByIdRequest{ extId:\ \ &extId }\n getResponse, err := TemplatePlacementPoliciesServiceApiInstance.GetTemplatePlacementPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := templateplacementpolicies.UpdateTemplatePlacementPolicyByIdRequest{\ \ ExtId: &extId, Body: templatePlacementPolicy }\n response, error :=\ \ TemplatePlacementPoliciesServiceApiInstance.UpdateTemplatePlacementPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/config/template-placement-policies/FD5eEFFa-f0d0-fcf1-B19d-6BDb42ddaF9F" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"string","description":"string","placementType":"$UNKNOWN","contentFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"clusterFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":"string","updatedBy":"string","phony":"string","$objectType":"vmm.v4.config.TemplatePlacementPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"string","description":"string","placementType":"$UNKNOWN","contentFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"clusterFilter":{"type":"$UNKNOWN","categoryExtIds":["string"],"$objectType":"catalogCommon.v1.config.CategoriesFilter"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":"string","updatedBy":"string","phony":"string","$objectType":"vmm.v4.config.TemplatePlacementPolicy"} \ - "https://host:port/api/vmm/v4.2/config/template-placement-policies/EF8DfDE7-BcA5-dD07-7853-adFEf00828bA" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Config;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatePlacementPoliciesApi\ \ templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(client);\n\ \n TemplatePlacementPolicy templatePlacementPolicy = new TemplatePlacementPolicy();\n\ \n // TemplatePlacementPolicy object initializations here...\n\n \ \ String extId = \"efB0DdEc-a1da-cEad-c4E7-AdDBafFbEa3A\";\n\n \ \ // perform GET call\n var getRequest = new GetTemplatePlacementPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetTemplatePlacementPolicyApiResponse\ \ getResponse = templatePlacementPoliciesApi.GetTemplatePlacementPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateTemplatePlacementPolicyByIdRequest {\n \ \ ExtId = extId,\n Body = templatePlacementPolicy,\n \ \ \n \n };\n try {\n UpdateTemplatePlacementPolicyApiResponse\ \ updateTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.UpdateTemplatePlacementPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - TemplatePlacementPolicies summary: Delete a template placement policy description: Deletes the template placement policy associated with the given external identifier. operationId: deleteTemplatePlacementPolicyById parameters: - name: extId in: path description: The external identifier of the template placement policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a59dd0b6-004e-497f-9ee5-0a8557d90a0b - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: db414726-e677-4fe2-bd6e-150235cf03f8 responses: "202": description: The request to delete a template placement policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete Template Placement Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2025.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatePlacementPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.TemplatePlacementPolicies.DeleteTemplatePlacementPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.config.DeleteTemplatePlacementPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatePlacementPoliciesApi templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClient);\n\ \n \n String extId = \"3Bcf73FE-Eea1-4FBf-b747-DDed8e852ea6\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteTemplatePlacementPolicyApiResponse\ \ deleteTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.deleteTemplatePlacementPolicyById(DeleteTemplatePlacementPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(deleteTemplatePlacementPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatePlacementPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"DC0d299D-F1Dd-107C-5DDf-D21c42abbE1D\"\ ;\n\n\n\n\n\n templatePlacementPoliciesApi.deleteTemplatePlacementPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n template_placement_policies_api\ \ = ntnx_vmm_py_client.TemplatePlacementPoliciesApi(api_client=client)\n\ \ \n ext_id = \"aBBBBB76-D7FF-EeEc-5BD6-0bCfC47De7dA\"\n\n\n try:\n\ \ api_response = template_placement_policies_api.delete_template_placement_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templateplacementpolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatePlacementPoliciesServiceApiInstance\ \ *api.TemplatePlacementPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatePlacementPoliciesServiceApiInstance = api.NewTemplatePlacementPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"73b5af7B-ef52-CdCa-B1f1-FEaBEBBEEC03\"\ \n\n\n request := templateplacementpolicies.DeleteTemplatePlacementPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := TemplatePlacementPoliciesServiceApiInstance.DeleteTemplatePlacementPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/config/template-placement-policies/6FB5f5ad-8f8E-BDBA-a1A0-C7dcde7DCBE8" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/config/template-placement-policies/2a3D1d2D-add2-ab8f-be0b-09FFF8ccebeC" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Config;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatePlacementPoliciesApi\ \ templatePlacementPoliciesApi = new TemplatePlacementPoliciesApi(client);\n\ \n String extId = \"cfc9aA9a-4b8b-6b7b-9Fcb-AbCA83AfC3cC\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteTemplatePlacementPolicyByIdRequest {\n ExtId = extId\n\ \ };\n try {\n DeleteTemplatePlacementPolicyApiResponse\ \ deleteTemplatePlacementPolicyApiResponse = templatePlacementPoliciesApi.DeleteTemplatePlacementPolicyById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/content/templates: get: tags: - Templates summary: List all templates description: | Lists templates with details such as name, description, VM configuration and so on. This operation supports filtering, sorting and pagination. operationId: listTemplates parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: templateName example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$filter=templateName\ \ eq 'LinuxServer_VM_Template'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: templateName example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$orderby=templateName" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$orderby=updateTime" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: categoryExtIds example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=categoryExtIds" - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=createTime" - name: createdBy example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=createdBy" - name: guestUpdateStatus example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=guestUpdateStatus" - name: templateDescription example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=templateDescription" - name: templateName example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=templateName" - name: templateVersionSpec example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=templateVersionSpec" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=updateTime" - name: updatedBy example: "https://{host}:{port}/api/vmm/v4.2/content/templates?$select=updatedBy" responses: "200": description: Returns a list of templates. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.content.Template' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Get operation x-permissions: operationName: View VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.ListTemplatesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.ListTemplatesApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n int page = 0;\n \n int limit = 50;\n\n \ \ try {\n // Pass in parameters using the request builder object\ \ associated with the operation.\n ListTemplatesApiResponse listTemplatesApiResponse\ \ = templatesApi.listTemplates(ListTemplatesRequest.builder()\n \ \ .$page(page)\n .$limit(limit)\n .$filter(null)\n\ \ .$orderby(null)\n .$select(null)\n \ \ .build());\n\n System.out.println(listTemplatesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, TemplatesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let templatesApi = new TemplatesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; templatesApi.listTemplates(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n page =\ \ 0\n \n limit = 50\n\n\n try:\n api_response = templates_api.list_templates(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := templates.ListTemplatesRequest{ Page_: &page_,\ \ Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_: nil }\n response,\ \ error := TemplatesServiceApiInstance.ListTemplates(ctx, &request)\n \ \ if error != nil {\n fmt.Println(error)\n return\n }\n\ \ data, _ := response.GetData().([]import1.Template)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/templates?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n int page = 0;\n int limit =\ \ 50;\n String filter = \"string_sample_data\";\n String orderby\ \ = \"string_sample_data\";\n String select = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new ListTemplatesRequest {\n Page = page,\n Limit\ \ = limit,\n Filter = filter,\n Orderby = orderby,\n\ \ Select = select\n };\n try {\n ListTemplatesApiResponse\ \ listTemplatesApiResponse = templatesApi.ListTemplates(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - Templates summary: Create template from a VM description: | Creates a template from the given VM identifier. A template stores the VM configuration and disks from the source VM. operationId: createTemplate parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 7195f4d1-6ba4-44cf-8fcb-1c3e707240de requestBody: description: Request to create a template. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.Template' required: true responses: "202": description: The request to create a template is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Post operation x-permissions: operationName: Create VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.TemplatesApi; import com.nutanix.dp1.vmm.vmm.v4.request.Templates.CreateTemplateRequest; import com.nutanix.dp1.vmm.vmm.v4.content.Template; import com.nutanix.dp1.vmm.vmm.v4.content.CreateTemplateApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. TemplatesApi templatesApi = new TemplatesApi(apiClient); Template template = new Template(); // Template object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateTemplateApiResponse createTemplateApiResponse = templatesApi.createTemplate(CreateTemplateRequest.builder() .build(), template); System.out.println(createTemplateApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, TemplatesApi, Template } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let templatesApi = new TemplatesApi(apiClientInstance); function sample() { let template = new Template(); // Template object initializations here... template = JSON.stringify(template); templatesApi.createTemplate(template).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) templates_api = ntnx_vmm_py_client.TemplatesApi(api_client=client) template = ntnx_vmm_py_client.Template() # Template object initializations here... try: api_response = templates_api.create_template(body=template) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient TemplatesServiceApiInstance *api.TemplatesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance) ctx := context.Background() template := import1.NewTemplate() // Template object initializations here... request := templates.CreateTemplateRequest{ Body: template } response, error := TemplatesServiceApiInstance.CreateTemplate(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/templates" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"templateName":"LinuxServer_VM_Template","templateDescription":"TemplatefordeployingLinuxServervirtualmachines.","templateVersionSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"versionName":"v2.1","versionDescription":"Updatedversionwith8GBmemory.","vmSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"createTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"versionSource":{"extId":"string","guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"$objectType":"vmm.v4.content.TemplateVmReference"},"versionSourceDiscriminator":"vmm.v4.content.TemplateVersionReference","isActiveVersion":true,"isGcOverrideEnabled":true,"clusterLocationExtIds":["string"],"guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"$objectType":"vmm.v4.content.TemplateVersionSpec"},"guestUpdateStatus":{"deployedVmReference":"string","$objectType":"vmm.v4.content.GuestUpdateStatus"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"updatedBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"categoryExtIds":["string"],"$objectType":"vmm.v4.content.Template"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"templateName":"LinuxServer_VM_Template","templateDescription":"TemplatefordeployingLinuxServervirtualmachines.","templateVersionSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"versionName":"v2.1","versionDescription":"Updatedversionwith8GBmemory.","vmSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"createTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"versionSource":{"extId":"string","guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"$objectType":"vmm.v4.content.TemplateVmReference"},"versionSourceDiscriminator":"vmm.v4.content.TemplateVersionReference","isActiveVersion":true,"isGcOverrideEnabled":true,"clusterLocationExtIds":["string"],"guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"$objectType":"vmm.v4.content.TemplateVersionSpec"},"guestUpdateStatus":{"deployedVmReference":"string","$objectType":"vmm.v4.content.GuestUpdateStatus"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"updatedBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"categoryExtIds":["string"],"$objectType":"vmm.v4.content.Template"} \ - "https://host:port/api/vmm/v4.2/content/templates" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n Template template = new Template();\n\ \n // Template object initializations here...\n\n\n // Create\ \ request object with parameters\n var request = new CreateTemplateRequest\ \ {\n Body = template\n };\n try {\n \ \ CreateTemplateApiResponse createTemplateApiResponse = templatesApi.CreateTemplate(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/content/templates/{extId}: get: tags: - Templates summary: Get template details description: Retrieves the template details for a given template identifier. operationId: getTemplateById parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a1b40402-d1c5-43cb-a886-4301532b4d37 responses: "200": description: Returns the requested template. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.content.Template' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Get operation" x-permissions: operationName: View VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.GetTemplateByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.GetTemplateApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n String extId = \"DD4Bfdba-99fc-AEB5-eCC0-53Bcd6Ecc6CD\";\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n GetTemplateApiResponse\ \ getTemplateApiResponse = templatesApi.getTemplateById(GetTemplateByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getTemplateApiResponse.toString());\n\n }\ \ catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let extId = \"7A3D2EA2-7Aa2-B8Bb-fa88-c05aEaacE84f\";\n\ \n\n\n\n\n templatesApi.getTemplateById(extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n ext_id\ \ = \"fDCF0AfB-00C3-8Afd-EAEF-A8eb8Ef0Bfde\"\n\n\n try:\n api_response\ \ = templates_api.get_template_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"b7cAC0A4-c0Aa-dEbA-cC9B-CeF56aBacd49\"\ \n\n\n request := templates.GetTemplateByIdRequest{ ExtId: &extId }\n\ \ response, error := TemplatesServiceApiInstance.GetTemplateById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.Template)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/templates/f2c74cB6-B92B-AF1f-F6A2-bc3bB1cBc0bA" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates/cD3A092e-3D74-7AEa-afb2-Cbf65b8d1CfB" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n String extId = \"82b8f30D-C8Da-F84b-df76-DFEcC2DFa56C\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetTemplateByIdRequest {\n ExtId = extId\n };\n\ \ try {\n GetTemplateApiResponse getTemplateApiResponse\ \ = templatesApi.GetTemplateById(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" put: tags: - Templates summary: Update a template description: | Updates a template with the given template identifier. This operation updates the template configuration and/or adds a new version to the template. Unless otherwise specified, the newly created version is set as the active version. operationId: updateTemplateById parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 858dfeb7-1155-4f34-ab12-4cb0e7c98810 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: c4f477c5-c4b6-4539-b835-f5dbe79a852a requestBody: description: Request to update a template. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.Template' responses: "202": description: The request to update a template is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Put operation" x-permissions: operationName: Update VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.UpdateTemplateByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Templates.GetTemplateByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.content.Template;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.GetTemplateApiResponse;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.content.UpdateTemplateApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ Template template = new Template();\n\n // Template object initializations\ \ here...\n \n String extId = \"2EF6FC10-FffC-B72b-aC7C-0cA10ad4CCdA\"\ ;\n\n // perform GET call\n GetTemplateApiResponse getResponse\ \ = null;\n try {\n getResponse = templatesApi.getTemplateById(GetTemplateByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateTemplateApiResponse\ \ updateTemplateApiResponse = templatesApi.updateTemplateById(UpdateTemplateByIdRequest.builder()\n\ \ .extId(extId)\n .build(), template, opts);\n\ \n System.out.println(updateTemplateApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi, Template, GetTemplateApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n let template = new Template();\n\n // Template object initializations\ \ here...\n template = JSON.stringify(template);\n\n \n let extId\ \ = \"Babfb3ee-edaD-EeC0-9bda-f2A7EC44cF0c\";\n\n\n // Perform Get call\n\ \ templatesApi.getTemplateById(extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ // Extract E-Tag Header\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n\n templatesApi.updateTemplateById(extId,\ \ template, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n template = ntnx_vmm_py_client.Template()\n\ \n # Template object initializations here...\n \n ext_id = \"5fb01EBA-CEab-fB2e-B4fa-5c50a2B30cC9\"\ \n\n try:\n api_response = templates_api.get_template_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = templates_api.update_template_by_id(extId=ext_id,\ \ body=template, if_match=etag_value)\n print(api_response)\n \ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n template := import1.NewTemplate()\n\ \n // Template object initializations here...\n\n \n extId := \"\ B267b7eE-F49A-BA55-FE9e-daDff3b9a2d0\"\n\n getRequest := templates.GetTemplateByIdRequest{\ \ extId: &extId }\n getResponse, err := TemplatesServiceApiInstance.GetTemplateById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := templates.UpdateTemplateByIdRequest{ ExtId: &extId, Body:\ \ template }\n response, error := TemplatesServiceApiInstance.UpdateTemplateById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/content/templates/CFefEf0c-AdDb-f7Fb-bD7A-1aab02Eaa90A" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"templateName":"LinuxServer_VM_Template","templateDescription":"TemplatefordeployingLinuxServervirtualmachines.","templateVersionSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"versionName":"v2.1","versionDescription":"Updatedversionwith8GBmemory.","vmSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"createTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"versionSource":{"extId":"string","guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"$objectType":"vmm.v4.content.TemplateVmReference"},"versionSourceDiscriminator":"vmm.v4.content.TemplateVersionReference","isActiveVersion":true,"isGcOverrideEnabled":true,"clusterLocationExtIds":["string"],"guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"$objectType":"vmm.v4.content.TemplateVersionSpec"},"guestUpdateStatus":{"deployedVmReference":"string","$objectType":"vmm.v4.content.GuestUpdateStatus"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"updatedBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"categoryExtIds":["string"],"$objectType":"vmm.v4.content.Template"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"templateName":"LinuxServer_VM_Template","templateDescription":"TemplatefordeployingLinuxServervirtualmachines.","templateVersionSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"versionName":"v2.1","versionDescription":"Updatedversionwith8GBmemory.","vmSpec":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"createTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"versionSource":{"extId":"string","guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"$objectType":"vmm.v4.content.TemplateVmReference"},"versionSourceDiscriminator":"vmm.v4.content.TemplateVersionReference","isActiveVersion":true,"isGcOverrideEnabled":true,"clusterLocationExtIds":["string"],"guestCustomizationProfile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"$objectType":"vmm.v4.content.TemplateVersionSpec"},"guestUpdateStatus":{"deployedVmReference":"string","$objectType":"vmm.v4.content.GuestUpdateStatus"},"createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"updatedBy":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"username":"john_doe","userType":"$UNKNOWN","idpId":"string","displayName":"johnjanedoe","firstName":"john","middleInitial":"jane","lastName":"doe","emailId":"john.doe@example.com","locale":"en-US","region":"en-US","password":"string","isForceResetPasswordEnabled":true,"additionalAttributes":[{"name":"string","value":"string","$objectType":"common.v1.config.KVPair"}],"status":"$UNKNOWN","bucketsAccessKeys":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"accessKeyName":"key1","secretAccessKey":"string","userId":"string","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedBy":"string","assignedTo":"user2","creationType":"$UNKNOWN","expiryTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","createdBy":"string","lastUpdatedTime":"2015-07-20T15:49:04-07:00","$objectType":"iam.v4.authn.BucketsAccessKey"}],"lastLoginTime":"2015-07-20T15:49:04-07:00","createdTime":"2015-07-20T15:49:04-07:00","lastUpdatedTime":"2015-07-20T15:49:04-07:00","createdBy":"string","lastUpdatedBy":"string","description":"ITuser","creationType":"$UNKNOWN","$objectType":"vmm.v4.content.TemplateUser"},"categoryExtIds":["string"],"$objectType":"vmm.v4.content.Template"} \ - "https://host:port/api/vmm/v4.2/content/templates/2dd0ECDD-E9FF-9EA6-Da2A-f5afaeAebDfF" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n Template template = new Template();\n\ \n // Template object initializations here...\n\n String extId\ \ = \"5DfCFeEc-211e-6beA-A9BD-f3052FABcb4B\";\n\n // perform GET\ \ call\n var getRequest = new GetTemplateByIdRequest {\n \ \ ExtId = extId\n };\n try {\n GetTemplateApiResponse\ \ getResponse = templatesApi.GetTemplateById(getRequest);\n } catch(ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n \ \ // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateTemplateByIdRequest {\n ExtId = extId,\n\ \ Body = template,\n \n \n };\n\ \ try {\n UpdateTemplateApiResponse updateTemplateApiResponse\ \ = templatesApi.UpdateTemplateById(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" delete: tags: - Templates summary: Delete a template and its associated versions description: Deletes the template and all of its versions for a given template identifier. operationId: deleteTemplateById parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5f54a528-a730-437a-9a59-6ce2ee9f2a06 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 9b11edae-2cc3-4ebd-a92b-3014150a406e responses: "202": description: The request to delete a template and its versions is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Delete operation" x-permissions: operationName: Delete VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.DeleteTemplateByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.DeleteTemplateApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n String extId = \"9cBaccdC-c5F5-B1fe-bDEA-DFd6708C1f5f\";\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n DeleteTemplateApiResponse\ \ deleteTemplateApiResponse = templatesApi.deleteTemplateById(DeleteTemplateByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(deleteTemplateApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let extId = \"cfabF37B-EDb4-3fFD-bFEc-F1e1FED6d79f\";\n\ \n\n\n\n\n templatesApi.deleteTemplateById(extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n ext_id\ \ = \"eAB2ED3a-36ba-AaDd-bcBa-EacDCABbbFaA\"\n\n\n try:\n api_response\ \ = templates_api.delete_template_by_id(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"44cCDbCC-7cFB-d9be-DBaE-FDd0fEFADEA6\"\ \n\n\n request := templates.DeleteTemplateByIdRequest{ ExtId: &extId\ \ }\n response, error := TemplatesServiceApiInstance.DeleteTemplateById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/content/templates/8d2Ed001-Ef19-Aedf-cdBd-ffe5FEd7aeCA" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates/DEdfFdfc-42FF-84b4-d08f-EFa6938Ae6DF" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n String extId = \"D1B9659b-FaaA-54c4-E4Ad-C9eff2AaEddf\"\ ;\n\n // Create request object with parameters\n var request\ \ = new DeleteTemplateByIdRequest {\n ExtId = extId\n \ \ };\n try {\n DeleteTemplateApiResponse deleteTemplateApiResponse\ \ = templatesApi.DeleteTemplateById(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/content/templates/{extId}/$actions/deploy: post: tags: - Templates summary: Deploy VMs from a template description: | Deploys one or more VMs from a template. You can specify the number of VMs to deploy and their corresponding VM configuration overrides. operationId: deployTemplate parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: fde53efd-7fc5-4283-8534-d8165a5f48a0 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 294ba060-b501-4b00-ba19-7c09c7e4470f requestBody: description: Request to deploy VMs from a template. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.TemplateDeployment' required: true responses: "202": description: The request to deploy a template is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/deploy\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/deploy\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/deploy\ \ Post operation" x-permissions: operationName: Deploy VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.DeployTemplateRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.TemplateDeployment;\nimport com.nutanix.dp1.vmm.vmm.v4.content.DeployTemplateApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ TemplateDeployment templateDeployment = new TemplateDeployment();\n\n\ \ // TemplateDeployment object initializations here...\n templateDeployment.setClusterReference(\"\ fbDEFCbB-aC2F-04b2-0dCB-fcFd7cEf2aC1\"); // required field\n templateDeployment.setNumberOfVms(1);\ \ // required field\n \n String extId = \"138dF7eF-ffce-AEde-5A57-6DA05bcCbdDD\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeployTemplateApiResponse\ \ deployTemplateApiResponse = templatesApi.deployTemplate(DeployTemplateRequest.builder()\n\ \ .extId(extId)\n .build(), templateDeployment);\n\ \n System.out.println(deployTemplateApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi, TemplateDeployment } from \"\ @nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n let templateDeployment = new TemplateDeployment();\n\n // TemplateDeployment\ \ object initializations here...\n templateDeployment.setClusterReference(\"\ aC2a95ee-Df4f-fEd0-b2Ae-AC17DA9Dd86f\"); // required field\n templateDeployment.setNumberOfVms(1);\ \ // required field\n templateDeployment = JSON.stringify(templateDeployment);\n\ \n \n let extId = \"feEeED23-d64D-0FDc-C6ca-B76b345cEAd8\";\n\n\n\n\ \n\n templatesApi.deployTemplate(extId, templateDeployment).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n templateDeployment\ \ = ntnx_vmm_py_client.TemplateDeployment()\n\n # TemplateDeployment\ \ object initializations here...\n templateDeployment.cluster_reference\ \ = \"1e7Cc9AE-4aC8-dBad-F1fE-ccECd676cd0F\" # required field\n templateDeployment.number_of_vms\ \ = 1 # required field\n \n ext_id = \"AfDaD2Cf-FBfA-C8fe-AEAC-43ffd5E16aD1\"\ \n\n\n try:\n api_response = templates_api.deploy_template(extId=ext_id,\ \ body=templateDeployment)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n templateDeployment := import1.NewTemplateDeployment()\n\ \n // TemplateDeployment object initializations here...\n\n \n \ \ extId := \"C2e4f844-F75b-ebcC-32Bc-5E8Eb8d189CE\"\n\n\n request :=\ \ templates.DeployTemplateRequest{ ExtId: &extId, Body: templateDeployment\ \ }\n response, error := TemplatesServiceApiInstance.DeployTemplate(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/templates/4aBEEF80-8ade-BDdA-deA5-4fAfebDB4DA7/$actions/deploy" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"versionId":"string","numberOfVms":1,"overrideVmConfigMap":{"additionalProp1":{"name":"LinuxServer_VM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.content.VmConfigOverride"},"additionalProp2":{"name":"LinuxServer_VM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.content.VmConfigOverride"},"additionalProp3":{"name":"LinuxServer_VM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.content.VmConfigOverride"}},"clusterReference":"string","$objectType":"vmm.v4.content.TemplateDeployment"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"versionId":"string","numberOfVms":1,"overrideVmConfigMap":{"additionalProp1":{"name":"LinuxServer_VM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.content.VmConfigOverride"},"additionalProp2":{"name":"LinuxServer_VM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.content.VmConfigOverride"},"additionalProp3":{"name":"LinuxServer_VM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.content.VmConfigOverride"}},"clusterReference":"string","$objectType":"vmm.v4.content.TemplateDeployment"} \ - "https://host:port/api/vmm/v4.2/content/templates/9D90821b-8F8a-BA6c-1593-dFf1CEF45AeA/$actions/deploy" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n TemplateDeployment templateDeployment\ \ = new TemplateDeployment();\n\n // TemplateDeployment object initializations\ \ here...\n templateDeployment.ClusterReference = \"7f9e4D12-56EE-aF0D-dB8A-fBbeDDA5297E\"\ ; // required field\n templateDeployment.NumberOfVms = 1; // required\ \ field\n\n String extId = \"0ce0Da3a-15fC-Ce0b-f57A-CC59e19E0429\"\ ;\n\n // Create request object with parameters\n var request\ \ = new DeployTemplateRequest {\n ExtId = extId,\n \ \ Body = templateDeployment\n };\n try {\n DeployTemplateApiResponse\ \ deployTemplateApiResponse = templatesApi.DeployTemplate(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/content/templates/{templateExtId}/versions: get: tags: - Templates summary: List all versions in a template description: | Lists all the versions of a template with details such as name, description, VM configuration and so on. This operation supports filtering, sorting and pagination. operationId: listTemplateVersions parameters: - name: templateExtId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 030b42cb-55b0-4c95-a842-2f790823d9bb - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: versionName example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$filter=versionName\ \ eq 'v2.1'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$orderby=createTime" - name: versionName example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$orderby=versionName" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: clusterLocationExtIds example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=clusterLocationExtIds" - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=createTime" - name: createdBy example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=createdBy" - name: guestCustomizationProfile example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=guestCustomizationProfile" - name: isActiveVersion example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=isActiveVersion" - name: isGcOverrideEnabled example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=isGcOverrideEnabled" - name: versionDescription example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=versionDescription" - name: versionName example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=versionName" - name: vmSpec example: "https://{host}:{port}/api/vmm/v4.2/content/templates/{templateExtId}/versions?$select=vmSpec" responses: "200": description: Returns the list of template versions. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.content.TemplateVersionSpec' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions\ \ Get operation" x-permissions: operationName: View VM Templates Versions deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.ListTemplateVersionsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.ListTemplateVersionsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n String templateExtId = \"bdec7ADE-8BaE-ed1b-BDD2-E3FCeaFb6BBC\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListTemplateVersionsApiResponse\ \ listTemplateVersionsApiResponse = templatesApi.listTemplateVersions(ListTemplateVersionsRequest.builder()\n\ \ .templateExtId(templateExtId)\n .$page(page)\n\ \ .$limit(limit)\n .$filter(null)\n \ \ .$orderby(null)\n .$select(null)\n \ \ .build());\n\n System.out.println(listTemplateVersionsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let templateExtId = \"aFA9b7eD-3FcB-AADf-BbcE-b8c77DdE7Fb4\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n opts[\"$filter\"] = \"string_sample_data\"\ ;\n opts[\"$orderby\"] = \"string_sample_data\";\n opts[\"$select\"\ ] = \"string_sample_data\";\n\n\n\n\n templatesApi.listTemplateVersions(templateExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n template_ext_id\ \ = \"AC9dE5aB-CA27-9b1f-CAFC-Fa6fCEa4fE2D\"\n \n page = 0\n \n\ \ limit = 50\n\n\n try:\n api_response = templates_api.list_template_versions(templateExtId=template_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n templateExtId := \"1EB6b4CD-c2Ed-51fb-E46F-cD4BcFCbB1Bf\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := templates.ListTemplateVersionsRequest{\ \ TemplateExtId: &templateExtId, Page_: &page_, Limit_: &limit_, Filter_:\ \ nil, Orderby_: nil, Select_: nil }\n response, error := TemplatesServiceApiInstance.ListTemplateVersions(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.TemplateVersionSpec)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/templates/EAe50a9e-dFBe-cc0B-aaea-9fDfD459cae5/versions?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates/cb79aD4A-Acc2-FFda-0A8A-ecBDd4FCBBaA/versions?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n String templateExtId = \"c15cDdce-87BC-Eaa6-ACA3-b00Dcd0fcDfe\"\ ;\n int page = 0;\n int limit = 50;\n String filter = \"\ string_sample_data\";\n String orderby = \"string_sample_data\";\n\ \ String select = \"string_sample_data\";\n\n // Create request\ \ object with parameters\n var request = new ListTemplateVersionsRequest\ \ {\n TemplateExtId = templateExtId,\n Page = page,\n\ \ Limit = limit,\n Filter = filter,\n Orderby\ \ = orderby,\n Select = select\n };\n try {\n \ \ ListTemplateVersionsApiResponse listTemplateVersionsApiResponse\ \ = templatesApi.ListTemplateVersions(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}: get: tags: - Templates summary: Get the template version detail description: Retrieves the template version details of the given template and version identifier. operationId: getTemplateVersionById parameters: - name: templateExtId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 158b9493-c0f5-46f0-ba10-67c21714319e - name: extId in: path description: The identifier of a version. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1533ffac-48dd-453b-83b5-9b5cde717eba responses: "200": description: Returns the requested template version details. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.content.TemplateVersionSpec' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Get operation" x-permissions: operationName: View VM Templates Versions deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Prism Viewer - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.GetTemplateVersionByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.GetTemplateVersionApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n String templateExtId = \"aafBCb21-eA0c-caEF-FAcE-9FAA7EeCCFaf\"\ ;\n \n String extId = \"CeBcdaFb-D5E0-Dcd0-A149-dEB2Bf1EAcfF\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetTemplateVersionApiResponse\ \ getTemplateVersionApiResponse = templatesApi.getTemplateVersionById(GetTemplateVersionByIdRequest.builder()\n\ \ .templateExtId(templateExtId)\n .extId(extId)\n\ \ .build());\n\n System.out.println(getTemplateVersionApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let templateExtId = \"c0169FAd-AfFC-d8ae-86f5-7B8FDCdd471E\"\ ;\n \n let extId = \"EC6FEe40-Cd0b-63ec-9Ebe-cd5b4d8daBad\";\n\n\n\ \n\n\n templatesApi.getTemplateVersionById(templateExtId, extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n template_ext_id\ \ = \"5dBBCADE-cAA3-7f7F-8d5e-D250b1aCFDE9\"\n \n ext_id = \"1CA7EaE9-aEfD-8FFD-AEbf-4cABe3cfeAf1\"\ \n\n\n try:\n api_response = templates_api.get_template_version_by_id(templateExtId=template_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n templateExtId := \"1FE5D97A-a9Fd-CaCa-1f88-cCeFfFBBE0fa\"\ \n \n extId := \"FFfbDF26-ede6-dCFB-2cCf-fbBc7CA3f78A\"\n\n\n request\ \ := templates.GetTemplateVersionByIdRequest{ TemplateExtId: &templateExtId,\ \ ExtId: &extId }\n response, error := TemplatesServiceApiInstance.GetTemplateVersionById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TemplateVersionSpec)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/content/templates/00932BE2-A7Ff-0e9b-0caF-F92BC2Eb9ffC/versions/Ed530aBB-0C89-9Bff-47b7-4Efdd5c1a4Bd" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates/ABe7c8b3-C84F-B7AD-dBdA-FEa2cfa2AaF9/versions/C7FE23F7-aB2d-61d5-11eB-2bFa4Bf244Ab" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n String templateExtId = \"eACabbeE-aA5F-fB4F-A7AD-D9a7BE63C99e\"\ ;\n String extId = \"3DB6d9bf-2B5B-06ee-b4bF-BCC5C174AFBa\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetTemplateVersionByIdRequest {\n TemplateExtId = templateExtId,\n\ \ ExtId = extId\n };\n try {\n GetTemplateVersionApiResponse\ \ getTemplateVersionApiResponse = templatesApi.GetTemplateVersionById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Templates summary: Delete a template version description: Deletes a version for the given template version identifier. operationId: deleteTemplateVersionById parameters: - name: templateExtId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 658b3b1d-3bb6-4ffb-a61a-b922e18e72d7 - name: extId in: path description: The identifier of a version. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2d48cb1d-a76f-4f7b-b3d7-8dec1a481304 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 70745c84-9260-4ce6-b9bd-9ae50090fb4f responses: "202": description: The request to delete a template version is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Delete operation" x-permissions: operationName: Delete VM Templates Versions deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.DeleteTemplateVersionByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.DeleteTemplateVersionApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n String templateExtId = \"fD59A9F5-5CDa-DCEa-5bd2-c9EECE484823\"\ ;\n \n String extId = \"aA47420e-fd5a-8dCC-ee9A-2EcEc9eDe33D\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteTemplateVersionApiResponse\ \ deleteTemplateVersionApiResponse = templatesApi.deleteTemplateVersionById(DeleteTemplateVersionByIdRequest.builder()\n\ \ .templateExtId(templateExtId)\n .extId(extId)\n\ \ .build());\n\n System.out.println(deleteTemplateVersionApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let templateExtId = \"e5Ca4cFc-5dCb-A44A-DeCE-8EDeF9eAb3EC\"\ ;\n \n let extId = \"8A62108e-A7ce-FB2d-5642-b4e3acaa6beB\";\n\n\n\ \n\n\n templatesApi.deleteTemplateVersionById(templateExtId, extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n template_ext_id\ \ = \"BffAc00E-e0aA-B7aF-8BAD-EaCE57ADe39b\"\n \n ext_id = \"22d002Ed-BfF7-dBcB-5Fb9-AfE10a7De4ed\"\ \n\n\n try:\n api_response = templates_api.delete_template_version_by_id(templateExtId=template_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n templateExtId := \"bDee4F11-1CA0-d3bb-bc28-3bCeC10AdBBe\"\ \n \n extId := \"e91fE1ef-c5EF-7aE3-8B4E-c5d8Af0dDAeF\"\n\n\n request\ \ := templates.DeleteTemplateVersionByIdRequest{ TemplateExtId: &templateExtId,\ \ ExtId: &extId }\n response, error := TemplatesServiceApiInstance.DeleteTemplateVersionById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/content/templates/E83aaF0E-57Bc-1da2-ffcA-8aDBFbc6aCc2/versions/B22f7AfD-9eb3-Fb8c-a1Bb-d4a9CAFebBFc" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates/e44bB02C-DCfE-3eBd-4dA8-FaecDAA39bec/versions/6fdb9d99-Cc0D-BA7A-aFce-11eDa55Acc9A" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n String templateExtId = \"Dbde8fc4-BafC-ee33-Aacf-CC40ddBFDAc0\"\ ;\n String extId = \"0cCdA3AE-D056-a9aa-afAE-CEA2caC7969d\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteTemplateVersionByIdRequest {\n TemplateExtId = templateExtId,\n\ \ ExtId = extId\n };\n try {\n DeleteTemplateVersionApiResponse\ \ deleteTemplateVersionApiResponse = templatesApi.DeleteTemplateVersionById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/content/templates/{extId}/$actions/initiate-guest-update: post: tags: - Templates summary: Initiate guest OS updates description: | Initiates the process of updating the Guest OS from a given template version identifier. Only one guest OS update can be initiated for a template at a time. A temporary VM is created where the guest OS updates will be applied. The user must make the necessary modifications to this temporary VM. After completing the modifications, the user should issue the "Complete Guest OS Update" command to finalize the update. The "Cancel Guest OS Update" command can be issued at any time to abort an ongoing update. operationId: initiateGuestUpdate parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 623208b0-dce2-41a1-86f5-87b97c74fea3 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f4e54d7d-9447-4303-b798-c64657f42467 requestBody: description: Request to initiate guest update on a template. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.InitiateGuestUpdateSpec' responses: "202": description: The request to initiate a guest OS update is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/initiate-guest-update\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/initiate-guest-update\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/initiate-guest-update\ \ Post operation" x-permissions: operationName: Init Guest Update VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.InitiateGuestUpdateRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.InitiateGuestUpdateSpec;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.content.InitiateGuestUpdateApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ InitiateGuestUpdateSpec initiateGuestUpdateSpec = new InitiateGuestUpdateSpec();\n\ \n // InitiateGuestUpdateSpec object initializations here...\n \ \ \n String extId = \"E1b4a8fc-cbCa-AcAB-AC38-64cddbEf9aCB\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n InitiateGuestUpdateApiResponse\ \ initiateGuestUpdateApiResponse = templatesApi.initiateGuestUpdate(InitiateGuestUpdateRequest.builder()\n\ \ .extId(extId)\n .build(), initiateGuestUpdateSpec);\n\ \n System.out.println(initiateGuestUpdateApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi, InitiateGuestUpdateSpec } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n let initiateGuestUpdateSpec = new InitiateGuestUpdateSpec();\n\n\ \ // InitiateGuestUpdateSpec object initializations here...\n initiateGuestUpdateSpec\ \ = JSON.stringify(initiateGuestUpdateSpec);\n\n \n let extId = \"\ e171fBaf-4caE-9Dac-fAc6-5fDBDcf50ce7\";\n\n\n\n\n\n templatesApi.initiateGuestUpdate(extId,\ \ initiateGuestUpdateSpec).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n initiateGuestUpdateSpec\ \ = ntnx_vmm_py_client.InitiateGuestUpdateSpec()\n\n # InitiateGuestUpdateSpec\ \ object initializations here...\n \n ext_id = \"b44EdacB-Baaf-adfb-BCbe-b5c88E9a6E96\"\ \n\n\n try:\n api_response = templates_api.initiate_guest_update(extId=ext_id,\ \ body=initiateGuestUpdateSpec)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n initiateGuestUpdateSpec := import1.NewInitiateGuestUpdateSpec()\n\ \n // InitiateGuestUpdateSpec object initializations here...\n\n \n\ \ extId := \"eb1a0C6e-90e0-0Be2-6aF3-DcfACfBb2eF7\"\n\n\n request\ \ := templates.InitiateGuestUpdateRequest{ ExtId: &extId, Body: initiateGuestUpdateSpec\ \ }\n response, error := TemplatesServiceApiInstance.InitiateGuestUpdate(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/templates/Ecf9Daac-edaB-3d1b-a61e-69eB3ea32dCB/$actions/initiate-guest-update" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"versionId":"string","$objectType":"vmm.v4.content.InitiateGuestUpdateSpec"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"versionId":"string","$objectType":"vmm.v4.content.InitiateGuestUpdateSpec"} \ - "https://host:port/api/vmm/v4.2/content/templates/ac1Ecc4F-56ce-69a3-2fb6-fE151FfFABEB/$actions/initiate-guest-update" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n InitiateGuestUpdateSpec initiateGuestUpdateSpec\ \ = new InitiateGuestUpdateSpec();\n\n // InitiateGuestUpdateSpec object\ \ initializations here...\n\n String extId = \"AEb9DFCA-D6ED-83Ae-5fB1-61eABabF3B81\"\ ;\n\n // Create request object with parameters\n var request\ \ = new InitiateGuestUpdateRequest {\n ExtId = extId,\n \ \ Body = initiateGuestUpdateSpec\n };\n try {\n \ \ InitiateGuestUpdateApiResponse initiateGuestUpdateApiResponse =\ \ templatesApi.InitiateGuestUpdate(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/content/templates/{extId}/$actions/complete-guest-update: post: tags: - Templates summary: Complete guest OS update description: | This operation finalizes the update initiated by the "Initiate guest OS update" API for the template. A new version is added to the template, the temporary VM created during the update process is deleted, and the pending update status is cleared. operationId: completeGuestUpdate parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8004fa70-335b-43ce-a571-78243665b70f - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f1252942-b48e-49a9-890e-2a08ff6edaaa requestBody: description: Request to complete the ongoing guest update on a template. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.CompleteGuestUpdateSpec' required: true responses: "202": description: The request to complete the guest OS update is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/complete-guest-update\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/complete-guest-update\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/complete-guest-update\ \ Post operation" x-permissions: operationName: Complete Guest Update VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.CompleteGuestUpdateRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.CompleteGuestUpdateSpec;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.content.CompleteGuestUpdateApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ CompleteGuestUpdateSpec completeGuestUpdateSpec = new CompleteGuestUpdateSpec();\n\ \n // CompleteGuestUpdateSpec object initializations here...\n \ \ completeGuestUpdateSpec.setVersionDescription(\"Updated version with\ \ 8GB memory.\"); // required field\n completeGuestUpdateSpec.setVersionName(\"\ v2.1\"); // required field\n \n String extId = \"16FAc6C1-BAD6-fcea-D8Ed-FCaa6Dec97bD\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CompleteGuestUpdateApiResponse\ \ completeGuestUpdateApiResponse = templatesApi.completeGuestUpdate(CompleteGuestUpdateRequest.builder()\n\ \ .extId(extId)\n .build(), completeGuestUpdateSpec);\n\ \n System.out.println(completeGuestUpdateApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi, CompleteGuestUpdateSpec } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n let completeGuestUpdateSpec = new CompleteGuestUpdateSpec();\n\n\ \ // CompleteGuestUpdateSpec object initializations here...\n completeGuestUpdateSpec.setVersionDescription(\"\ Updated version with 8GB memory.\"); // required field\n completeGuestUpdateSpec.setVersionName(\"\ v2.1\"); // required field\n completeGuestUpdateSpec = JSON.stringify(completeGuestUpdateSpec);\n\ \n \n let extId = \"dBe9ae6A-adaD-af2D-015A-B9bFd34Fb1eB\";\n\n\n\n\ \n\n templatesApi.completeGuestUpdate(extId, completeGuestUpdateSpec).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n completeGuestUpdateSpec\ \ = ntnx_vmm_py_client.CompleteGuestUpdateSpec()\n\n # CompleteGuestUpdateSpec\ \ object initializations here...\n completeGuestUpdateSpec.version_description\ \ = \"Updated version with 8GB memory.\" # required field\n completeGuestUpdateSpec.version_name\ \ = \"v2.1\" # required field\n \n ext_id = \"4AdB5dda-c2fb-80C2-f3A5-638ba6DdF6fe\"\ \n\n\n try:\n api_response = templates_api.complete_guest_update(extId=ext_id,\ \ body=completeGuestUpdateSpec)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n completeGuestUpdateSpec := import1.NewCompleteGuestUpdateSpec()\n\ \n // CompleteGuestUpdateSpec object initializations here...\n\n \n\ \ extId := \"e1f3C0aB-0152-4c5e-BD4E-3d0DAc5BeeAc\"\n\n\n request\ \ := templates.CompleteGuestUpdateRequest{ ExtId: &extId, Body: completeGuestUpdateSpec\ \ }\n response, error := TemplatesServiceApiInstance.CompleteGuestUpdate(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/templates/89Eb4AcF-6Ec8-aA6D-Fa5F-417bDdcB4DCA/$actions/complete-guest-update" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"versionName":"v2.1","versionDescription":"Updatedversionwith8GBmemory.","isActiveVersion":true,"$objectType":"vmm.v4.content.CompleteGuestUpdateSpec"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"versionName":"v2.1","versionDescription":"Updatedversionwith8GBmemory.","isActiveVersion":true,"$objectType":"vmm.v4.content.CompleteGuestUpdateSpec"} \ - "https://host:port/api/vmm/v4.2/content/templates/E61AdFE4-9CB2-9ca1-8FbF-Ea74BcfAdDae/$actions/complete-guest-update" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n CompleteGuestUpdateSpec completeGuestUpdateSpec\ \ = new CompleteGuestUpdateSpec();\n\n // CompleteGuestUpdateSpec object\ \ initializations here...\n completeGuestUpdateSpec.VersionDescription\ \ = \"Updated version with 8GB memory.\"; // required field\n completeGuestUpdateSpec.VersionName\ \ = \"v2.1\"; // required field\n\n String extId = \"aDf24Eac-DeAb-DDBf-a802-DF26cDC4d1FD\"\ ;\n\n // Create request object with parameters\n var request\ \ = new CompleteGuestUpdateRequest {\n ExtId = extId,\n \ \ Body = completeGuestUpdateSpec\n };\n try {\n \ \ CompleteGuestUpdateApiResponse completeGuestUpdateApiResponse =\ \ templatesApi.CompleteGuestUpdate(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/content/templates/{extId}/$actions/cancel-guest-update: post: tags: - Templates summary: Cancel guest OS update description: | This operation cancels the update initiated by the "Initiate guest OS update" API for the given template. The temporary VM created during the update process is deleted, and the pending update status is cleared. Please note that any modifications made to the temporary VM will be lost upon cancelling the update operation. operationId: cancelGuestUpdate parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 846ace40-a490-4c13-abaf-9e43e667240d - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 8574a19c-635f-4e9a-9d3b-de5e1b1d0d2c responses: "202": description: The request to cancel the guest OS update is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/cancel-guest-update\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/cancel-guest-update\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/cancel-guest-update\ \ Post operation" x-permissions: operationName: Cancel Guest Update VM Templates deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.CancelGuestUpdateRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.content.CancelGuestUpdateApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ \n String extId = \"cEBd9Ace-0CDf-bd43-E385-a0eD6de9ADa8\";\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n CancelGuestUpdateApiResponse\ \ cancelGuestUpdateApiResponse = templatesApi.cancelGuestUpdate(CancelGuestUpdateRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(cancelGuestUpdateApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n\n \n let extId = \"EdBC0c16-CeB8-edFe-12Fd-eA57cd1bcEf5\";\n\ \n\n\n\n\n templatesApi.cancelGuestUpdate(extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n \n ext_id\ \ = \"E4be1FFc-1a3F-ccFe-B02c-fAB7fCDcCd1C\"\n\n\n try:\n api_response\ \ = templates_api.cancel_guest_update(extId=ext_id)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"ACF79d1B-cdEF-5Bae-bfaD-1EbF63CDE4BA\"\ \n\n\n request := templates.CancelGuestUpdateRequest{ ExtId: &extId }\n\ \ response, error := TemplatesServiceApiInstance.CancelGuestUpdate(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/templates/dBd7EdBF-83CD-eA4C-b5f7-2f2a5aBEEFf4/$actions/cancel-guest-update" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/content/templates/0F0Ce641-8fff-5FAf-58bF-bcbB6b64bBaF/$actions/cancel-guest-update" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n String extId = \"95EBDeF6-C2E0-Bbec-1cC0-BCfddb7dF8Ca\"\ ;\n\n // Create request object with parameters\n var request\ \ = new CancelGuestUpdateRequest {\n ExtId = extId\n };\n\ \ try {\n CancelGuestUpdateApiResponse cancelGuestUpdateApiResponse\ \ = templatesApi.CancelGuestUpdate(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/content/templates/{extId}/$actions/publish: post: tags: - Templates summary: Set an active version description: | Designate the template version identified by the given identifier as the active version. An active version is a default version for creating VMs from the template and starting the Guest OS Update. operationId: publishTemplate parameters: - name: extId in: path description: The identifier of a template. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 72ddd517-b6e1-422c-9bc9-5215ef5dedb5 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: e0ea646b-ecc0-42aa-b96f-f898579452ce requestBody: description: Request to publish version of a template. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.content.TemplatePublishSpec' required: true responses: "202": description: The request to publish the version is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/publish\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/publish\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/publish\ \ Post operation" x-permissions: operationName: Publish VM Templates Versions deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Prism Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 20 timeUnit: seconds - type: small count: 20 timeUnit: seconds - type: large count: 20 timeUnit: seconds - type: xlarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.TemplatesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Templates.PublishTemplateRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.content.TemplatePublishSpec;\nimport com.nutanix.dp1.vmm.vmm.v4.content.PublishTemplateApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ TemplatesApi templatesApi = new TemplatesApi(apiClient);\n\n \ \ TemplatePublishSpec templatePublishSpec = new TemplatePublishSpec();\n\ \n // TemplatePublishSpec object initializations here...\n \ \ templatePublishSpec.setVersionId(\"AdbB0eD3-eE42-6ca2-aF8B-4d8BBE9ef8c3\"\ ); // required field\n \n String extId = \"a3b5DcFF-A1Bf-b44C-ABd3-70dAc9a475EF\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ PublishTemplateApiResponse publishTemplateApiResponse = templatesApi.publishTemplate(PublishTemplateRequest.builder()\n\ \ .extId(extId)\n .build(), templatePublishSpec,\ \ opts);\n\n System.out.println(publishTemplateApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, TemplatesApi, TemplatePublishSpec } from \"\ @nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let templatesApi = new TemplatesApi(apiClientInstance);\n\nfunction sample()\ \ {\n let templatePublishSpec = new TemplatePublishSpec();\n\n //\ \ TemplatePublishSpec object initializations here...\n templatePublishSpec.setVersionId(\"\ 9FCDEbAd-aF6A-b533-19Bf-FC751B15C45D\"); // required field\n templatePublishSpec\ \ = JSON.stringify(templatePublishSpec);\n\n \n let extId = \"BAEdf5a1-EeEE-d0C1-e3bc-dEAaF2f4b4fB\"\ ;\n\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n templatesApi.publishTemplate(extId,\ \ templatePublishSpec, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n templates_api\ \ = ntnx_vmm_py_client.TemplatesApi(api_client=client)\n templatePublishSpec\ \ = ntnx_vmm_py_client.TemplatePublishSpec()\n\n # TemplatePublishSpec\ \ object initializations here...\n templatePublishSpec.version_id = \"\ dcC3D9E7-AAA7-1F4F-BcaC-6ed9aeaA6EEa\" # required field\n \n ext_id\ \ = \"bC6BcEBd-Aaf0-8DC0-CfeF-FfDbda8de67f\"\n\n \"\"\"\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = templates_api.publish_template(extId=ext_id,\ \ body=templatePublishSpec, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/templates\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/content\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n TemplatesServiceApiInstance\ \ *api.TemplatesServiceApi\n)\n\nfunc main() {\n ApiClientInstance =\ \ client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ TemplatesServiceApiInstance = api.NewTemplatesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n templatePublishSpec := import1.NewTemplatePublishSpec()\n\ \n // TemplatePublishSpec object initializations here...\n\n \n \ \ extId := \"aFCF2eeE-5FEE-82Fa-FAcf-FcA8eD60FAdF\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := templates.PublishTemplateRequest{ ExtId: &extId, Body: templatePublishSpec\ \ }\n response, error := TemplatesServiceApiInstance.PublishTemplate(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/content/templates/eC1bccde-8fb2-f26B-df5b-eAcAEFFf7f24/$actions/publish" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"versionId":"string","$objectType":"vmm.v4.content.TemplatePublishSpec"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"versionId":"string","$objectType":"vmm.v4.content.TemplatePublishSpec"} \ - "https://host:port/api/vmm/v4.2/content/templates/9aaABfB7-6b9B-deDB-D7c4-dcBA18a05C36/$actions/publish" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Content;\n\nnamespace CsharpSdkSample\n{\n\ \ class Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n TemplatesApi templatesApi\ \ = new TemplatesApi(client);\n\n TemplatePublishSpec templatePublishSpec\ \ = new TemplatePublishSpec();\n\n // TemplatePublishSpec object initializations\ \ here...\n templatePublishSpec.VersionId = \"cc7c0a42-f866-9808-CeC6-Ebb2c0c7a7dc\"\ ; // required field\n\n String extId = \"cAaBaFad-1fAd-1ed0-bdb7-A607E1EBb3aB\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new PublishTemplateRequest\ \ {\n ExtId = extId,\n Body = templatePublishSpec,\n\ \ \n \n };\n try {\n PublishTemplateApiResponse\ \ publishTemplateApiResponse = templatesApi.PublishTemplate(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/associate-categories: post: tags: - Vm summary: Associate categories to a VM description: Associate categories to a virtual machine. operationId: associateCategories parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 116a11fd-b763-4179-8985-0f7da6e1bdb4 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: df5732e2-849c-4afe-9b11-42f1201da71d requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.AssociateVmCategoriesParams' required: true responses: "202": description: The request to associate categories to a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/associate-categories\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/associate-categories\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/associate-categories\ \ Post operation" x-permissions: operationName: Associate Virtual Machine Categories deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.AssociateCategoriesRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.AssociateVmCategoriesParams;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.AssociateCategoriesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigAssociateVmCategoriesParams\ \ ahvConfigAssociateVmCategoriesParams = new AhvConfigAssociateVmCategoriesParams();\n\ \n // AhvConfigAssociateVmCategoriesParams object initializations\ \ here...\n \n String extId = \"fdE0ecCC-E5ad-C9F4-Aa4F-FFfaEAaCDFF6\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigAssociateCategoriesApiResponse ahvConfigAssociateCategoriesApiResponse\ \ = vmApi.associateCategories(AssociateCategoriesRequest.builder()\n \ \ .extId(extId)\n .build(), ahvConfigAssociateVmCategoriesParams,\ \ opts);\n\n System.out.println(ahvConfigAssociateCategoriesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, AssociateVmCategoriesParams } from \"\ @nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigAssociateVmCategoriesParams = new AhvConfigAssociateVmCategoriesParams();\n\ \n // AhvConfigAssociateVmCategoriesParams object initializations here...\n\ \ ahvConfigAssociateVmCategoriesParams = JSON.stringify(ahvConfigAssociateVmCategoriesParams);\n\ \n \n let extId = \"9CCd0Eee-b49c-eFfa-7dE3-efeEbf5d4Eb0\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.associateCategories(extId,\ \ ahvConfigAssociateVmCategoriesParams, args).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigAssociateVmCategoriesParams\ \ = ntnx_vmm_py_client.AhvConfigAssociateVmCategoriesParams()\n\n # AhvConfigAssociateVmCategoriesParams\ \ object initializations here...\n \n ext_id = \"E4b0ffAB-bCdf-01AF-6CCA-88bcdBeEabC9\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.associate_categories(extId=ext_id,\ \ body=ahvConfigAssociateVmCategoriesParams, if_match=etag_value)\n \ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigAssociateVmCategoriesParams\ \ := import1.NewAhvConfigAssociateVmCategoriesParams()\n\n // AhvConfigAssociateVmCategoriesParams\ \ object initializations here...\n\n \n extId := \"aAfecABc-eAF6-3cdB-fd91-ecfA3D9Db7EE\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.AssociateCategoriesRequest{ ExtId: &extId,\ \ Body: ahvConfigAssociateVmCategoriesParams }\n response, error := VmServiceApiInstance.AssociateCategories(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/EdA597A5-Ed66-971e-D62c-7FEff62A72AA/$actions/associate-categories" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"$objectType":"vmm.v4.ahv.config.AssociateVmCategoriesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"$objectType":"vmm.v4.ahv.config.AssociateVmCategoriesParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/53aEDC9F-7fC7-3f4B-0Aef-8A74B8ddb4Ee/$actions/associate-categories" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigAssociateVmCategoriesParams ahvConfigAssociateVmCategoriesParams\ \ = new AhvConfigAssociateVmCategoriesParams();\n\n // AhvConfigAssociateVmCategoriesParams\ \ object initializations here...\n\n String extId = \"F1cFDd7B-aBFd-e13d-d3cA-eDDcFCcf9Ea2\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new AssociateCategoriesRequest\ \ {\n ExtId = extId,\n Body = ahvConfigAssociateVmCategoriesParams,\n\ \ \n \n };\n try {\n AhvConfigAssociateCategoriesApiResponse\ \ ahvConfigAssociateCategoriesApiResponse = vmApi.AssociateCategories(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/disassociate-categories: post: tags: - Vm summary: Disassociate categories from a VM description: Disassociate categories from a virtual machine. operationId: disassociateCategories parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b3588da8-33f0-4d8f-8c3a-f3d11b496080 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: c446706c-02dd-47bc-9343-f0e491b20c6a requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DisassociateVmCategoriesParams' required: true responses: "202": description: The request to disassociate categories from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" x-permissions: operationName: Disassociate Virtual Machine Categories deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DisassociateCategoriesRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.DisassociateVmCategoriesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DisassociateCategoriesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigDisassociateVmCategoriesParams\ \ ahvConfigDisassociateVmCategoriesParams = new AhvConfigDisassociateVmCategoriesParams();\n\ \n // AhvConfigDisassociateVmCategoriesParams object initializations\ \ here...\n \n String extId = \"C0BC9DBc-fffA-b7bf-Aee3-cF5F0CBBD35A\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigDisassociateCategoriesApiResponse ahvConfigDisassociateCategoriesApiResponse\ \ = vmApi.disassociateCategories(DisassociateCategoriesRequest.builder()\n\ \ .extId(extId)\n .build(), ahvConfigDisassociateVmCategoriesParams,\ \ opts);\n\n System.out.println(ahvConfigDisassociateCategoriesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, DisassociateVmCategoriesParams } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigDisassociateVmCategoriesParams = new AhvConfigDisassociateVmCategoriesParams();\n\ \n // AhvConfigDisassociateVmCategoriesParams object initializations\ \ here...\n ahvConfigDisassociateVmCategoriesParams = JSON.stringify(ahvConfigDisassociateVmCategoriesParams);\n\ \n \n let extId = \"e7BEb8d1-dfB5-C7Ad-58AB-3a1addDDcFEd\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.disassociateCategories(extId,\ \ ahvConfigDisassociateVmCategoriesParams, args).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigDisassociateVmCategoriesParams\ \ = ntnx_vmm_py_client.AhvConfigDisassociateVmCategoriesParams()\n\n \ \ # AhvConfigDisassociateVmCategoriesParams object initializations here...\n\ \ \n ext_id = \"4213aD2e-caeC-427c-DAAc-bc88C1E1EfcF\"\n\n \"\"\ \"\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.disassociate_categories(extId=ext_id,\ \ body=ahvConfigDisassociateVmCategoriesParams, if_match=etag_value)\n \ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigDisassociateVmCategoriesParams\ \ := import1.NewAhvConfigDisassociateVmCategoriesParams()\n\n // AhvConfigDisassociateVmCategoriesParams\ \ object initializations here...\n\n \n extId := \"5ccA37eE-A136-dDD6-EC63-0fdbdEd2FFcA\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.DisassociateCategoriesRequest{ ExtId: &extId,\ \ Body: ahvConfigDisassociateVmCategoriesParams }\n response, error :=\ \ VmServiceApiInstance.DisassociateCategories(ctx, &request, args)\n \ \ if error != nil {\n fmt.Println(error)\n return\n }\n\ \ data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Ee2c1DC3-f920-ddc2-0b4c-bDCf55DCDCEB/$actions/disassociate-categories" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"$objectType":"vmm.v4.ahv.config.DisassociateVmCategoriesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"$objectType":"vmm.v4.ahv.config.DisassociateVmCategoriesParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/ccccCBAd-e68B-CAa8-Eaa6-b53bC1D38bEA/$actions/disassociate-categories" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigDisassociateVmCategoriesParams ahvConfigDisassociateVmCategoriesParams\ \ = new AhvConfigDisassociateVmCategoriesParams();\n\n // AhvConfigDisassociateVmCategoriesParams\ \ object initializations here...\n\n String extId = \"9c6484Ad-DcfD-08ED-3b8E-cBfEAcAAeDaA\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new DisassociateCategoriesRequest\ \ {\n ExtId = extId,\n Body = ahvConfigDisassociateVmCategoriesParams,\n\ \ \n \n };\n try {\n AhvConfigDisassociateCategoriesApiResponse\ \ ahvConfigDisassociateCategoriesApiResponse = vmApi.DisassociateCategories(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}: get: tags: - Vm summary: Get configuration details for the provided CD-ROM description: Retrieves configuration details for the provided CD-ROM device attached to a virtual machine. operationId: getCdRomById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 91e8a275-78dd-469a-b1d3-b0f518efafda - name: extId in: path description: A globally unique identifier of a CD-ROM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 08ddb5c0-c96f-43bb-9f93-f0ec190cc038 responses: "200": description: Returns the configuration details for the provided CD-ROM device attached to a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine CD ROM deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetCdRomByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetCdRomApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"0e5B0Ac6-d7cc-AadD-ed02-ccBB1fFdDEce\";\n \n String\ \ extId = \"288Eeaff-4eA3-F66c-81FD-E8Ad12cC358b\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetCdRomApiResponse getCdRomApiResponse\ \ = vmApi.getCdRomById(GetCdRomByIdRequest.builder()\n .vmExtId(vmExtId)\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getCdRomApiResponse.toString());\n\n } catch\ \ (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"d70e9eA6-FF0B-b6E2-754A-45DCd93BBde8\";\n \n\ \ let extId = \"Ded4DBB0-EE88-3eAb-4Bba-7fFDa7fbD0AB\";\n\n\n\n\n\n \ \ vmApi.getCdRomById(vmExtId, extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ 1dd25F53-bFA4-34Af-3f7f-8aF4D3EEEeff\"\n \n ext_id = \"ddF9Aa31-1dE1-d3Eb-ffC9-d1de8E0abEB3\"\ \n\n\n try:\n api_response = vm_api.get_cd_rom_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"38c6F0ad-75Ea-Ba34-ECaa-e8e08FCceF7E\"\ \n \n extId := \"fAa3b6b8-b8bf-Dd1c-1A2C-1E8D66cB1aBf\"\n\n\n request\ \ := vm.GetCdRomByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.GetCdRomById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.CdRom)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/fE329db2-70Cc-AbAd-0FA1-E0644a40dFeF/cd-roms/CAE84dFB-bDdb-eEc3-4Acc-8BDFfFeef104" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/8eba3C43-fDfA-0704-6A65-D07188e4Ae2f/cd-roms/BddfD3fF-aC37-AbBa-ACC5-fEDcD4eA466C" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"bAaE4acE-5FD2-BEF5-5b4E-De8386A8c56d\"\ ;\n String extId = \"85f0CEA0-1eeb-cb71-Cfcf-Bde6Aa0BaE0A\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetCdRomByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n GetCdRomApiResponse getCdRomApiResponse\ \ = vmApi.GetCdRomById(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" delete: tags: - Vm summary: Remove a CD-ROM device from a VM description: Removes the specified CD-ROM device from a virtual machine. operationId: deleteCdRomById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 7e8dba2a-9a66-4df5-a960-e2577a97fa11 - name: extId in: path description: A globally unique identifier of a CD-ROM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 262c0403-9307-4234-86b2-193681bceb74 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 2ae4eece-a2fd-48ef-96b0-90208fbd3941 responses: "202": description: The request to delete the specified CD-ROM device from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Delete operation" x-permissions: operationName: Delete Virtual Machine CD ROM deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeleteCdRomByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteCdRomApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"ACbbDFb0-beEf-EfBA-8510-975CdCFcc6Bd\";\n \n String\ \ extId = \"Cb4ffE7D-9Ffc-a484-aBBd-A4B45DA6b037\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteCdRomApiResponse deleteCdRomApiResponse\ \ = vmApi.deleteCdRomById(DeleteCdRomByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(deleteCdRomApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"10A9a3c3-AeCd-CC9A-Da95-f8aDAbEfea9d\";\n \n\ \ let extId = \"0f3C3CF3-E5A6-eED0-3CA7-faAa8ca93eD8\";\n\n\n\n\n\n \ \ vmApi.deleteCdRomById(vmExtId, extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ 30Cc7d83-fDeA-E0ed-BcCa-bBF6e1Caaaac\"\n \n ext_id = \"f7F3dC9c-AcBB-Df3e-c1a9-1f5e04EDA4ae\"\ \n\n\n try:\n api_response = vm_api.delete_cd_rom_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"cBEDfb0A-ea59-e034-Ffcf-cB99EBEeDedd\"\ \n \n extId := \"EdeDc946-dBFe-0fb7-13be-1dAffbcD5BDE\"\n\n\n request\ \ := vm.DeleteCdRomByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n \ \ response, error := VmServiceApiInstance.DeleteCdRomById(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/BFBdfeea-6F28-b1BF-c45b-73cA0fCDeCaC/cd-roms/EE5ebb61-7F9A-A8Ff-b3Eb-7B4d9Dfb96dC" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/FD4caEEd-2E2b-254E-B60e-Acdad2d4ffd6/cd-roms/A5C1e17B-5b2E-EcBa-31cc-bBCd7BbCfde0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"E1c0E8DC-fD9b-feCf-EbfC-3D6dadE8ECEF\"\ ;\n String extId = \"aDa79bAC-BBCb-Ad4C-1BCE-fBcb20fcFeBF\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteCdRomByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n DeleteCdRomApiResponse\ \ deleteCdRomApiResponse = vmApi.DeleteCdRomById(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/insert: post: tags: - Vm summary: Inserts an ISO in the provided CD-ROM device description: Inserts the defined ISO into a CD-ROM device attached to a Virtual Machine. operationId: insertCdRomById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ce2dcd4d-1fb2-4c23-b195-25390d66bcb8 - name: extId in: path description: A globally unique identifier of a CD-ROM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: de285458-42ed-4bc9-8321-038df8a4776f - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 6992f329-5065-40a2-9968-ae8a13227569 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRomInsertParams' required: true responses: "202": description: The request to insert the defined ISO into a CD-ROM device attached to a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/insert\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/insert\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/insert\ \ Post operation" x-permissions: operationName: Insert Virtual Machine CD ROM deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.InsertCdRomByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.CdRomInsertParams;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.InsertCdRomApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n CdRomInsertParams cdRomInsertParams\ \ = new CdRomInsertParams();\n\n // CdRomInsertParams object initializations\ \ here...\n \n String vmExtId = \"Dfd4a9B5-3DEd-478A-aCfd-3f3a8D3dcC3C\"\ ;\n \n String extId = \"D50B863A-DbCa-f403-523c-AeDF2Aed37e2\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ InsertCdRomApiResponse insertCdRomApiResponse = vmApi.insertCdRomById(InsertCdRomByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), cdRomInsertParams, opts);\n\n System.out.println(insertCdRomApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, CdRomInsertParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ cdRomInsertParams = new CdRomInsertParams();\n\n // CdRomInsertParams\ \ object initializations here...\n cdRomInsertParams = JSON.stringify(cdRomInsertParams);\n\ \n \n let vmExtId = \"da1e06BC-Cb27-fFBa-3F7C-ee14Dd7EB2e4\";\n \ \ \n let extId = \"df4fC3bc-FdEa-b5B4-0b7C-c9E1FEc22b1A\";\n\n\n \ \ /*\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.insertCdRomById(vmExtId,\ \ extId, cdRomInsertParams, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n cdRomInsertParams =\ \ ntnx_vmm_py_client.CdRomInsertParams()\n\n # CdRomInsertParams object\ \ initializations here...\n \n vm_ext_id = \"BCfAeEaE-a8Db-Cd75-2dFA-9BACA9D6E79C\"\ \n \n ext_id = \"86d1EFFd-c9AB-57bF-bBD9-dc5622Be90Ec\"\n\n \"\"\ \"\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.insert_cd_rom_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, body=cdRomInsertParams, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n cdRomInsertParams := import1.NewCdRomInsertParams()\n\ \n // CdRomInsertParams object initializations here...\n\n \n vmExtId\ \ := \"e6f9BFD8-abFe-5dEF-4Efc-1D1bAFDA0aAB\"\n \n extId := \"99F5Ca5c-bcdA-BED2-bFc8-A1fDCe29Ad3d\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.InsertCdRomByIdRequest{ VmExtId: &vmExtId,\ \ ExtId: &extId, Body: cdRomInsertParams }\n response, error := VmServiceApiInstance.InsertCdRomById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/C77Fdfac-7Baa-4aD4-Bb31-ACB6daadfb84/cd-roms/CCcEDbE0-FDeE-2083-92Fd-1dA8130a6Ecc/$actions/insert" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"$objectType":"vmm.v4.ahv.config.CdRomInsertParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"$objectType":"vmm.v4.ahv.config.CdRomInsertParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/dfCAEfD6-aee8-B0fc-B8EB-A154cE4E54C5/cd-roms/DFa4FDB9-8e27-0d1D-6cFd-c5BA0cfdAfFD/$actions/insert" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n CdRomInsertParams cdRomInsertParams = new CdRomInsertParams();\n\ \n // CdRomInsertParams object initializations here...\n\n String\ \ vmExtId = \"CE6ec1f2-CeAB-D4f1-595A-C9AEFeD2Be58\";\n String extId\ \ = \"4BAf6b25-33f5-dd4b-BDaf-CF353Fd132FD\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.GetEtag(getResponse);\n \ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new InsertCdRomByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ Body = cdRomInsertParams,\n \n \n };\n\ \ try {\n InsertCdRomApiResponse insertCdRomApiResponse\ \ = vmApi.InsertCdRomById(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/eject: post: tags: - Vm summary: Ejects an ISO from the provided CD-ROM device description: Ejects the ISO currently inserted into a CD-ROM device on a Virtual Machine. operationId: ejectCdRomById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ecf80624-ca38-44dd-b85c-1152d916129d - name: extId in: path description: A globally unique identifier of a CD-ROM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2e2cb9a5-f82f-4569-b48b-51e67ca8f58b - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 8e34d0a2-2ccd-49e6-8d0b-8c1731690669 responses: "202": description: The request to eject an ISO from the provided CD-ROM device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/eject\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/eject\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/eject\ \ Post operation" x-permissions: operationName: Eject Virtual Machine CD ROM deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.EjectCdRomByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.EjectCdRomApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"FA4aE04F-f37A-3F1A-2FEA-C3a1FFfFAeBc\";\n \n String\ \ extId = \"8e94f4F5-25FC-F21e-b6CF-34BAbdbEeEE8\";\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header\ \ needs to be retrieved by performing a Read(Get) operation on the same\ \ resource.\n ETags can be retrieved by calling a static method of\ \ ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ EjectCdRomApiResponse ejectCdRomApiResponse = vmApi.ejectCdRomById(EjectCdRomByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), opts);\n\n System.out.println(ejectCdRomApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"4dAaf0a0-a8C9-dBfc-5b7E-CAE2bf34C39E\";\n \n\ \ let extId = \"6DBfD60a-0c4c-Def0-aB0F-1fDDaBAAaBb5\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.ejectCdRomById(vmExtId, extId, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ 0ddaEFC5-DCe2-BEAe-7C0B-DdEDfBFfcf06\"\n \n ext_id = \"Efc4bc28-F33b-F7cB-4c3b-daaDcEDacD6D\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.eject_cd_rom_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, if_match=etag_value)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"E7ab1e1C-ebDF-5BcD-D74c-Ac3f75eEdbBe\"\ \n \n extId := \"b6f2a770-a9E9-2DbA-AbfB-dECdbdDFAcb0\"\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.EjectCdRomByIdRequest{ VmExtId: &vmExtId, ExtId: &extId\ \ }\n response, error := VmServiceApiInstance.EjectCdRomById(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/eBd31EE4-70c4-A7b1-aa3b-Cd6faDB19dAB/cd-roms/E32BCBEF-4AfD-DdFE-7ccC-c64C8B0Bb9cd/$actions/eject" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/AA3AfBBd-2eaC-8B5B-8bD2-A1dF57Bc6C9f/cd-roms/CEcaeece-BcD9-e22B-ab55-14b6eD27deB5/$actions/eject" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"bBEdeBe6-e4FE-e1bB-ea1B-a4B0cC21CdF5\"\ ;\n String extId = \"bF0EdAdC-f4B2-ebec-97a7-c5d42daF3f95\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new EjectCdRomByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ \n \n };\n try {\n EjectCdRomApiResponse\ \ ejectCdRomApiResponse = vmApi.EjectCdRomById(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/enable-hydration: post: tags: - Vm summary: Enable hydration for a VM CD-ROM description: "Enable a VM CD-ROM to be hydrated to the local storage container\ \ in the background. If the VM CD-ROM hydration has been disabled, this will\ \ resume the hydration process." operationId: enableVmCdRomHydration parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2140fa91-352a-4782-8e37-ed85f057aadb - name: extId in: path description: A globally unique identifier of a CD-ROM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: fbcfa9c2-ac3d-46d0-9d35-ad704c117b0b - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 8600001b-e575-4971-b941-c6308b4f6118 responses: "202": description: The request to enable hydration for the provided CD-ROM device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/enable-hydration\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/enable-hydration\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/enable-hydration\ \ Post operation" x-permissions: operationName: Enable Virtual Machine CD ROM Hydration deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Disaster Recovery Admin - name: Backup Admin - name: Prism Admin - name: Cluster Admin - name: Project Manager x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.EnableVmCdRomHydrationRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.EnableVmCdRomHydrationApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"A81cfCde-37Fd-32B2-bD2b-Fd7be0B4e1cE\";\n \n String\ \ extId = \"ffBb3aC3-ec2F-DA68-69fC-F8aE9486Efeb\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n EnableVmCdRomHydrationApiResponse enableVmCdRomHydrationApiResponse\ \ = vmApi.enableVmCdRomHydration(EnableVmCdRomHydrationRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(enableVmCdRomHydrationApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"A3aDE6A1-Cc3a-f073-1fd8-Cee6ea8B670d\";\n \n\ \ let extId = \"f490cA6a-F90F-9DCB-FF5D-0BfeBfe6BcBc\";\n\n\n\n\n\n \ \ vmApi.enableVmCdRomHydration(vmExtId, extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ a9fe5c9d-EE5b-Fce1-B0cA-e9eAcBCCBBE5\"\n \n ext_id = \"299Ac02C-eFeA-7edA-0Acd-3BeBEaaDBaa1\"\ \n\n\n try:\n api_response = vm_api.enable_vm_cd_rom_hydration(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"C9bBcbCF-c9FB-C6E6-E8Cc-ccfAA6Ae88BE\"\ \n \n extId := \"04f4E20f-C9Fe-DC78-aB7a-DcffbBeE8C1b\"\n\n\n request\ \ := vm.EnableVmCdRomHydrationRequest{ VmExtId: &vmExtId, ExtId: &extId\ \ }\n response, error := VmServiceApiInstance.EnableVmCdRomHydration(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/AE8F5fce-2E3A-f8D6-CbEd-CEd7a5BCBc25/cd-roms/dFFDADe0-9FCe-65Aa-59DF-f3C4b1e7ABeF/$actions/enable-hydration" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/dd8DBEFC-CF4e-d6F5-bad8-AfF8D674A1C5/cd-roms/F1d1286b-Ded5-2fAa-cdBA-eD08DEbF2Efc/$actions/enable-hydration" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"87ce4c82-fA9B-DfDc-17Be-d9eFaad2BfC5\"\ ;\n String extId = \"aC6C8252-cC1e-FAd4-dCDA-CCaCdfC8fb1d\";\n\n \ \ // Create request object with parameters\n var request = new\ \ EnableVmCdRomHydrationRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n EnableVmCdRomHydrationApiResponse\ \ enableVmCdRomHydrationApiResponse = vmApi.EnableVmCdRomHydration(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/disable-hydration: post: tags: - Vm summary: Disable hydration for a VM CD-ROM description: Disable hydration for a VM CD-ROM. The hydration process will be stopped and the CD-ROM will not be migrated to the local storage container. operationId: disableVmCdRomHydration parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 36220e8f-723e-4301-81ba-9328a0231de5 - name: extId in: path description: A globally unique identifier of a CD-ROM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 37cecd48-1613-4d25-baf1-3ddaf138a873 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 34fec125-68b5-4d2d-9a2f-d5426353ff17 responses: "202": description: The request to disable hydration for the provided CD-ROM device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/disable-hydration\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/disable-hydration\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/disable-hydration\ \ Post operation" x-permissions: operationName: Disable Virtual Machine CD ROM Hydration deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Disaster Recovery Admin - name: Backup Admin - name: Prism Admin - name: Cluster Admin - name: Project Manager x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DisableVmCdRomHydrationRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DisableVmCdRomHydrationApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"aCfdCcC5-BAFc-b7dC-4dd4-b43FBA1CBbbe\";\n \n String\ \ extId = \"DC8d6D38-d0dc-D11e-cCBF-3D87Da5F9Aaa\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DisableVmCdRomHydrationApiResponse disableVmCdRomHydrationApiResponse\ \ = vmApi.disableVmCdRomHydration(DisableVmCdRomHydrationRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(disableVmCdRomHydrationApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"Da80eC68-3dE3-a3c2-fFBe-3cEaAf48bbF2\";\n \n\ \ let extId = \"BbBC8Fb1-8C59-E9da-d24e-aFb4FFabBc2A\";\n\n\n\n\n\n \ \ vmApi.disableVmCdRomHydration(vmExtId, extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ DBbFd38C-b84e-1E23-1f86-ef50fCFdfFba\"\n \n ext_id = \"c57f3AFA-deBF-a0fA-faDb-aff2a28bBFCa\"\ \n\n\n try:\n api_response = vm_api.disable_vm_cd_rom_hydration(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"bCDBAfec-88bb-CfcF-fbF8-26Edcf3B9cbE\"\ \n \n extId := \"FdD45A1e-B104-ebc4-96B2-cf96aCddeA5C\"\n\n\n request\ \ := vm.DisableVmCdRomHydrationRequest{ VmExtId: &vmExtId, ExtId: &extId\ \ }\n response, error := VmServiceApiInstance.DisableVmCdRomHydration(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/E0FF5BFE-AEf0-c38B-AdA6-d3edab9daeDd/cd-roms/c7b7bE89-0BcD-66cB-acF3-CfbbBeFc8e5c/$actions/disable-hydration" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/2efE32De-d62C-E05B-CCef-Ecac2dcc8Fae/cd-roms/7F8F2Edf-3fAF-fb81-bD4A-eFC05cbCab6e/$actions/disable-hydration" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"aAbAAe0a-4be5-fC89-aDC9-c2Fbb8db1fDc\"\ ;\n String extId = \"e1cABC18-34C3-c6fB-5bFD-4a653d6DC8bF\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DisableVmCdRomHydrationRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n DisableVmCdRomHydrationApiResponse\ \ disableVmCdRomHydrationApiResponse = vmApi.DisableVmCdRomHydration(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms: get: tags: - Vm summary: List CD-ROMs attached to a VM description: Lists the CD-ROM devices attached to a virtual machine. operationId: listCdRomsByVmId parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 14d9263f-928a-4ef8-800b-aba95ca56cf4 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the configuration details for the CD-ROM devices attached to a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Get operation" x-permissions: operationName: View Virtual Machine CD ROM deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListCdRomsByVmIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListCdRomsApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"dcB7aaCA-d08C-CbB7-7c59-FFeDe4Cbbfdf\";\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListCdRomsApiResponse listCdRomsApiResponse\ \ = vmApi.listCdRomsByVmId(ListCdRomsByVmIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .$page(page)\n \ \ .$limit(limit)\n .build());\n\n System.out.println(listCdRomsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"2D1C7fdB-f05F-B0BD-c604-b5D1cAFDDDAf\";\n\n //\ \ Construct Optional Parameters\n var opts = {};\n opts[\"$page\"\ ] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmApi.listCdRomsByVmId(vmExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ FfAf9CbE-dDA4-DD3D-dFC7-d0F97e2eDE20\"\n \n page = 0\n \n limit\ \ = 50\n\n\n try:\n api_response = vm_api.list_cd_roms_by_vm_id(vmExtId=vm_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"AE5DAD7d-f5ca-Cfca-3FbF-AAbBA50B6Fed\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := vm.ListCdRomsByVmIdRequest{\ \ VmExtId: &vmExtId, Page_: &page_, Limit_: &limit_ }\n response, error\ \ := VmServiceApiInstance.ListCdRomsByVmId(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().([]import1.CdRom)\n fmt.Println(data)\n\n}\n\ \n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/a7dCEc2a-6A18-AEB4-1ddD-5c0dEdEc2C76/cd-roms?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/6e282fDb-F26f-a2DC-caB0-FEEBE25c023a/cd-roms?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"aBFb6cbD-CcEB-bdd5-59Ef-A1dBA8baAbAC\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListCdRomsByVmIdRequest\ \ {\n VmExtId = vmExtId,\n Page = page,\n \ \ Limit = limit\n };\n try {\n ListCdRomsApiResponse\ \ listCdRomsApiResponse = vmApi.ListCdRomsByVmId(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - Vm summary: Create a CD-ROM device for a VM description: Creates and attaches a CD-ROM device to a virtual machine. operationId: createCdRom parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: fa4ddafe-f2f6-4692-bb0e-9dda2336aa3e - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f2ae44b1-ce95-41bd-bc39-ee13a101d0d7 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' required: true responses: "202": description: The request to create a CD-ROM device for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Post operation" x-permissions: operationName: Create Virtual Machine CD ROM deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreateCdRomRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.CdRom;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateCdRomApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigCdRom ahvConfigCdRom\ \ = new AhvConfigCdRom();\n\n // AhvConfigCdRom object initializations\ \ here...\n \n String vmExtId = \"fBd7e7bF-Bd7E-CaFB-bFb0-dBFa8aeef6f4\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CreateCdRomApiResponse\ \ createCdRomApiResponse = vmApi.createCdRom(CreateCdRomRequest.builder()\n\ \ .vmExtId(vmExtId)\n .build(), ahvConfigCdRom);\n\ \n System.out.println(createCdRomApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, CdRom } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigCdRom = new AhvConfigCdRom();\n\n // AhvConfigCdRom object\ \ initializations here...\n ahvConfigCdRom = JSON.stringify(ahvConfigCdRom);\n\ \n \n let vmExtId = \"B3d9B8b0-Cf19-aac2-d5AC-EFB0Dd9a4DdB\";\n\n\n\ \n\n\n vmApi.createCdRom(vmExtId, ahvConfigCdRom).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigCdRom = ntnx_vmm_py_client.AhvConfigCdRom()\n\ \n # AhvConfigCdRom object initializations here...\n \n vm_ext_id\ \ = \"daD7Ccfa-EE9d-CCDE-43c3-FFE0adCEcfab\"\n\n\n try:\n api_response\ \ = vm_api.create_cd_rom(vmExtId=vm_ext_id, body=ahvConfigCdRom)\n \ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigCdRom := import1.NewAhvConfigCdRom()\n\ \n // AhvConfigCdRom object initializations here...\n\n \n vmExtId\ \ := \"91cAbB89-7f43-CB8f-fFac-fc7F7d927afA\"\n\n\n request := vm.CreateCdRomRequest{\ \ VmExtId: &vmExtId, Body: ahvConfigCdRom }\n response, error := VmServiceApiInstance.CreateCdRom(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/0e7C6Be9-BCcE-d86C-B3Cf-D8BCDeaefeFC/cd-roms" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/80BF25ED-eDfa-a0CE-Adec-2D0B1edEdeBf/cd-roms" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigCdRom ahvConfigCdRom = new AhvConfigCdRom();\n\ \n // AhvConfigCdRom object initializations here...\n\n String\ \ vmExtId = \"87ddfF3E-Bae1-CCA1-cDbF-ff86aecBEDa4\";\n\n // Create\ \ request object with parameters\n var request = new CreateCdRomRequest\ \ {\n VmExtId = vmExtId,\n Body = ahvConfigCdRom\n\ \ };\n try {\n CreateCdRomApiResponse createCdRomApiResponse\ \ = vmApi.CreateCdRom(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/clone: post: tags: - Vm summary: Clone a VM description: Clones an existing virtual machine. This operation also includes updating the existing configuration during the clone operation. operationId: cloneVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a8a0230e-7fe8-4090-a945-1bfb2b8e998d - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 0f404c29-a4dd-4273-af03-42b8edde7077 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CloneOverrideParams' responses: "202": description: The request to clone a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/clone\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/clone\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/clone\ \ Post operation" x-permissions: operationName: Clone Existing Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CloneVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.CloneOverrideParams;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CloneVmApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n CloneOverrideParams\ \ cloneOverrideParams = new CloneOverrideParams();\n\n // CloneOverrideParams\ \ object initializations here...\n \n String extId = \"EeC41Adb-deBf-9cca-36aE-e8baAcE1b9cB\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ CloneVmApiResponse cloneVmApiResponse = vmApi.cloneVm(CloneVmRequest.builder()\n\ \ .extId(extId)\n .build(), cloneOverrideParams,\ \ opts);\n\n System.out.println(cloneVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, CloneOverrideParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ cloneOverrideParams = new CloneOverrideParams();\n\n // CloneOverrideParams\ \ object initializations here...\n cloneOverrideParams = JSON.stringify(cloneOverrideParams);\n\ \n \n let extId = \"6Ed7BcC2-6aE0-2E2a-dAe5-8eE255cef01F\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.cloneVm(extId,\ \ cloneOverrideParams, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n cloneOverrideParams\ \ = ntnx_vmm_py_client.CloneOverrideParams()\n\n # CloneOverrideParams\ \ object initializations here...\n \n ext_id = \"Da2Ea5Bb-9c5A-b06F-e45c-E9515bDb0cF1\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.clone_vm(extId=ext_id,\ \ body=cloneOverrideParams, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n cloneOverrideParams := import1.NewCloneOverrideParams()\n\ \n // CloneOverrideParams object initializations here...\n\n \n \ \ extId := \"e9FDEacb-BfDc-aD8a-DfCd-cb53d4a51CDB\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.CloneVmRequest{ ExtId: &extId, Body: cloneOverrideParams\ \ }\n response, error := VmServiceApiInstance.CloneVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/1Ed8eEAc-FBD7-cb79-45FC-ea3efEcEEFf9/$actions/clone" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"name":"TestVM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.ahv.config.CloneOverrideParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"name":"TestVM","numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"memorySizeBytes":0,"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestCustomizationProfileConfig":{"profile":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileReference"},"configOverrideSpec":{"customization":{"generalSettings":{"computerName":{"value":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileComputerName"},"timezone":{"value":"GreenwichStandardTime","$objectType":"vmm.v4.ahv.config.VmGcProfileTimezone"},"administratorPassword":{"value":"abc@123","$objectType":"vmm.v4.ahv.config.VmGcProfileAdministratorPassword"},"autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec"},"windowsProductKey":{"value":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","$objectType":"vmm.v4.ahv.config.VmGcProfileWindowsProductKey"},"registeredOwner":{"value":"Admin","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOwner"},"registeredOrganization":{"value":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileRegisteredOrganization"},"$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettingsOverrideSpec"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"systemLocale":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"uiLanguage":{"value":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride"},"$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettingsOverrideSpec"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfigOverrideSpec"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfigOverrideSpec"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettingsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmGcProfileConfig"},"$objectType":"vmm.v4.ahv.config.CloneOverrideParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/4D5AfeeF-8F1C-fBb7-e5bd-d7671fb9AA4b/$actions/clone" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n CloneOverrideParams cloneOverrideParams = new\ \ CloneOverrideParams();\n\n // CloneOverrideParams object initializations\ \ here...\n\n String extId = \"9aeabDeC-a2cD-28e7-93dE-e96A9dDEbCab\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new CloneVmRequest {\n \ \ ExtId = extId,\n Body = cloneOverrideParams,\n \ \ \n \n };\n try {\n CloneVmApiResponse\ \ cloneVmApiResponse = vmApi.CloneVm(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}: get: tags: - Vm summary: Get configuration details for the provided disk device description: Retrieves configuration details for the provided disk device attached to a virtual machine. operationId: getDiskById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 03f854e5-7921-472e-bb06-4035b60f574b - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 21793447-9b67-4ecc-a291-decadf1af247 responses: "200": description: Returns the configuration details for the provided disk device attached to a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine Disk deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetDiskByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetDiskApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"B2BB127b-fBB2-EE99-696b-1B865EfDfAaF\";\n \n String\ \ extId = \"358d44A4-eeDB-CDbA-F1aA-5fEc03CF5Ba2\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetDiskApiResponse getDiskApiResponse\ \ = vmApi.getDiskById(GetDiskByIdRequest.builder()\n .vmExtId(vmExtId)\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getDiskApiResponse.toString());\n\n } catch\ \ (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"0CdDABeC-67E6-fE0e-db9A-84c26F70CD8c\";\n \n\ \ let extId = \"FCdACF88-6f2e-32bb-Cc8A-be3Db3cB2dDf\";\n\n\n\n\n\n \ \ vmApi.getDiskById(vmExtId, extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ C776DfAd-aCE9-F2bC-1Ba2-Fdd5d5AD9C3c\"\n \n ext_id = \"b5dcbbDF-8ccE-E2A1-db5e-e8dFEba5ef5f\"\ \n\n\n try:\n api_response = vm_api.get_disk_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"4a2661D0-f9Ef-A7F1-Cb6A-5Eee6Dd0CBaF\"\ \n \n extId := \"5DABfCBf-D702-AD73-6FdA-aaCa82AEdbCD\"\n\n\n request\ \ := vm.GetDiskByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.GetDiskById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.Disk)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/dB0bF5eC-d210-FB5a-9fbb-9dd28CAbaCEe/disks/11be57EB-cD9C-Aeab-AbAA-fE69EB1EADA0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/EFC0Ee42-BE0d-DCaD-cEdd-4bDdaEC8fF77/disks/DdE59D80-ddbE-4D6D-aE91-DCe2CC72481d" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"1Ca32Bcb-Ab95-28Fb-F07D-7fADeaB2f2af\"\ ;\n String extId = \"D07cCFDf-1bCB-85f6-C8b0-edF4CAC1faff\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetDiskByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n GetDiskApiResponse getDiskApiResponse\ \ = vmApi.GetDiskById(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" put: tags: - Vm summary: Update the configuration for the provided disk device description: Updates the configuration details for the provided disk device. operationId: updateDiskById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 29fa9673-5060-49c5-b959-c4d44e7e0e11 - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 857cec27-0943-43ad-8565-4fa3bd5944a7 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 11d35582-c4f4-431e-9534-1c143ab7eb83 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' required: true responses: "202": description: The request to update the configuration for the provided disk device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Put operation" x-permissions: operationName: Update Virtual Machine Disk deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UpdateDiskByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetDiskByIdRequest;\nimport\ \ java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.Disk;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetDiskApiResponse;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateDiskApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigDisk ahvConfigDisk\ \ = new AhvConfigDisk();\n\n // AhvConfigDisk object initializations\ \ here...\n \n String vmExtId = \"Ecdffd3A-43CF-daca-8aeB-fB87F6b6FFFE\"\ ;\n \n String extId = \"1EC6789E-B4fA-dFf7-Ea3E-eDabce3BaACB\"\ ;\n\n // perform GET call\n GetDiskApiResponse getResponse\ \ = null;\n try {\n getResponse = vmApi.getDiskById(GetDiskByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n } catch(RestClientException ex) {\n \ \ System.out.println(ex.getMessage());\n }\n // Extract\ \ E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateDiskApiResponse\ \ updateDiskApiResponse = vmApi.updateDiskById(UpdateDiskByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), ahvConfigDisk, opts);\n\n System.out.println(updateDiskApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, Disk, GetDiskApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigDisk = new AhvConfigDisk();\n\n // AhvConfigDisk object initializations\ \ here...\n ahvConfigDisk = JSON.stringify(ahvConfigDisk);\n\n \n\ \ let vmExtId = \"5cb2B1f4-e7c9-daED-ACbc-8fF9Cee33B5B\";\n \n \ \ let extId = \"c3A20bfb-7C7C-099D-EaAd-BEaDbbcA43C4\";\n\n\n // Perform\ \ Get call\n vmApi.getDiskById(vmExtId, extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ // Extract E-Tag Header\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n\n vmApi.updateDiskById(vmExtId,\ \ extId, ahvConfigDisk, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n\ \ console.log(`Error is: ${error}`);\n });\n });\n\n\ }\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigDisk = ntnx_vmm_py_client.AhvConfigDisk()\n\ \n # AhvConfigDisk object initializations here...\n \n vm_ext_id\ \ = \"6fcC4DfD-FEFF-B8aE-b7ad-5A4d3e7DFcea\"\n \n ext_id = \"a21DEE1a-DAEa-Ae0f-1708-E077eAa3efDd\"\ \n\n try:\n api_response = vm_api.get_disk_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n except ntnx_vmm_py_client.rest.ApiException as e:\n\ \ print(e)\n # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_api.update_disk_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, body=ahvConfigDisk, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigDisk := import1.NewAhvConfigDisk()\n\ \n // AhvConfigDisk object initializations here...\n\n \n vmExtId\ \ := \"DAdbB1c8-dFa2-FDdD-F6B9-EAaAD48ffd1C\"\n \n extId := \"da93B44b-4DfB-BEEA-C6EF-02a25EfF458E\"\ \n\n getRequest := vm.GetDiskByIdRequest{ vmExtId: &vmExtId, extId: &extId\ \ }\n getResponse, err := VmServiceApiInstance.GetDiskById(ctx, &getRequest)\n\ \ if err != nil {\n fmt.Println(err)\n return\n }\n\n\ \ // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vm.UpdateDiskByIdRequest{ VmExtId: &vmExtId, ExtId: &extId,\ \ Body: ahvConfigDisk }\n response, error := VmServiceApiInstance.UpdateDiskById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/5Fd5E28E-725f-670A-ACad-CcEDCAAf28Cc/disks/8B4CDDFf-353a-6ECd-6E85-B8aE3EEce496" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/F7D70FAf-b54e-CcFD-Cc0e-8EB5bE5d7C79/disks/D8dc77e5-dBb7-409e-1cbB-ECbd9FaADEcC" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Config;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmApi vmApi = new VmApi(client);\n\n AhvConfigDisk ahvConfigDisk\ \ = new AhvConfigDisk();\n\n // AhvConfigDisk object initializations\ \ here...\n\n String vmExtId = \"9BEabBED-B8CD-e5fE-d4Ff-A3CCcE0CcDFE\"\ ;\n String extId = \"C7beeffC-a1a7-47BE-e2a8-Fe99d2EeBce1\";\n\n \ \ // perform GET call\n var getRequest = new GetDiskByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ };\n var getRequest = new GetDiskByIdRequest {\n VmExtId\ \ = vmExtId,\n ExtId = extId\n };\n try {\n \ \ GetDiskApiResponse getResponse = vmApi.GetDiskById(getRequestgetRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateDiskByIdRequest {\n VmExtId = vmExtId,\n\ \ ExtId = extId,\n Body = ahvConfigDisk,\n \ \ \n \n };\n try {\n UpdateDiskApiResponse\ \ updateDiskApiResponse = vmApi.UpdateDiskById(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Vm summary: Removes the specified disk device from a virtual machine. description: Removes the specified disk device from a virtual machine. operationId: deleteDiskById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1747d2e8-cc38-40df-9b7b-12e015f6378e - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 6b163870-bd09-4e65-b341-9f01b0e12d9c - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 11166627-49b4-4ef6-bdd3-0ad84c73ce95 responses: "202": description: The request to remove specified disk device from a virtual machine is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Delete operation" x-permissions: operationName: Delete Virtual Machine Disk deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: CSI System - name: Developer - name: Kubernetes Data Services System - name: Kubernetes Infrastructure Provision - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Storage Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeleteDiskByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteDiskApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"7feE2ECe-Eb70-dAaF-e3E8-C3b5BCEeBc42\";\n \n String\ \ extId = \"fCdce9EE-59Da-D8e9-1Da2-FDCE343eAFda\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteDiskApiResponse deleteDiskApiResponse\ \ = vmApi.deleteDiskById(DeleteDiskByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n .build());\n\ \n System.out.println(deleteDiskApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"CF4cb3bE-Dc5c-6e8A-1eae-50Fa83E4b243\";\n \n\ \ let extId = \"A03BA2a6-0dCF-FC59-1D4d-EBbbb27bbEcc\";\n\n\n\n\n\n \ \ vmApi.deleteDiskById(vmExtId, extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ bD81E2B7-DBCD-d7Ed-f44A-eE5A3DD6cbfd\"\n \n ext_id = \"acFCefdb-9Bac-E3bB-27E9-c8EaBEB4f2aC\"\ \n\n\n try:\n api_response = vm_api.delete_disk_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"c7e4a7aA-0CeA-daa8-fAC4-34F797e7fEE6\"\ \n \n extId := \"3dB5E3F2-eBFc-2bba-9f76-4EC8DcddC6F7\"\n\n\n request\ \ := vm.DeleteDiskByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.DeleteDiskById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Dc98fF9D-2D50-ecD6-9DFC-4e2C0febEbCf/disks/dafDa3Ba-E33B-CABf-Fc9b-EE4A5A85b6aB" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/Be0ed1F3-adb8-eE4E-7aBE-cAb4eBB0Bf01/disks/fCFB0CC2-eDE2-a5b2-3bAB-DeeDccb0af59" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"02a18abb-CCA0-DFfA-89c1-4CCc84C2FAfe\"\ ;\n String extId = \"4C770ccE-E3AE-5eC2-5Cd9-ec5dA40aD6Be\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteDiskByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n DeleteDiskApiResponse\ \ deleteDiskApiResponse = vmApi.DeleteDiskById(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/add-custom-attributes: post: tags: - Vm summary: Add to the VM disk's custom attributes description: Adds to the custom attributes of the VM disk entity. operationId: addVmDiskCustomAttributes parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b991b323-48b6-4039-b649-237c872f5a2c - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a0416f8a-bbf2-4df4-9b39-7d070e1ffef5 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: e0f6d09f-ae39-4069-85cd-c4347b097891 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.UpdateCustomAttributesParams' required: true responses: "202": description: The request to add to the custom attributes for the provided disk device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/add-custom-attributes\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/add-custom-attributes\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/add-custom-attributes\ \ Post operation" x-permissions: operationName: Update Virtual Machine Disk Custom Attributes deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.AddVmDiskCustomAttributesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateCustomAttributesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.AddVmDiskCustomAttributesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n UpdateCustomAttributesParams\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n\ \ updateCustomAttributesParams.setCustomAttributes(new ArrayList<>());\ \ // required field\n \n String vmExtId = \"F1DBdcBC-BbA6-A6cD-d5Fd-c98ADafDDEA1\"\ ;\n \n String extId = \"adC3bFEa-A6BC-6bEd-cAF0-3BFE8B25b1Bb\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n AddVmDiskCustomAttributesApiResponse\ \ addVmDiskCustomAttributesApiResponse = vmApi.addVmDiskCustomAttributes(AddVmDiskCustomAttributesRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), updateCustomAttributesParams);\n\n System.out.println(addVmDiskCustomAttributesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, UpdateCustomAttributesParams } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n \ \ updateCustomAttributesParams.setCustomAttributes([]); // required field\n\ \ updateCustomAttributesParams = JSON.stringify(updateCustomAttributesParams);\n\ \n \n let vmExtId = \"38FACc6C-5C94-F1c2-Bdfa-DAeae8f9E24F\";\n \ \ \n let extId = \"d3eEecAD-fEad-7BeE-AcF9-caFba28FafBD\";\n\n\n\n\n\ \n vmApi.addVmDiskCustomAttributes(vmExtId, extId, updateCustomAttributesParams).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n updateCustomAttributesParams\ \ = ntnx_vmm_py_client.UpdateCustomAttributesParams()\n\n # UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.custom_attributes\ \ = [] # required field\n \n vm_ext_id = \"6a5fED6c-3efc-eF4C-aeD5-fAc3DdfBeFED\"\ \n \n ext_id = \"cE435C68-F8ed-4C9a-E9da-341CaebFB26b\"\n\n\n try:\n\ \ api_response = vm_api.add_vm_disk_custom_attributes(vmExtId=vm_ext_id,\ \ extId=ext_id, body=updateCustomAttributesParams)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n updateCustomAttributesParams := import1.NewUpdateCustomAttributesParams()\n\ \n // UpdateCustomAttributesParams object initializations here...\n\n\ \ \n vmExtId := \"c3E56E3C-9FAF-dcc8-5DE1-b7E0EaA63cdf\"\n \n \ \ extId := \"3dEDEFfc-3bF7-30c9-ee5a-1db312EBDea8\"\n\n\n request :=\ \ vm.AddVmDiskCustomAttributesRequest{ VmExtId: &vmExtId, ExtId: &extId,\ \ Body: updateCustomAttributesParams }\n response, error := VmServiceApiInstance.AddVmDiskCustomAttributes(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/2de6afAB-8f42-5AFD-dffe-bdA1Dc1A6dce/disks/C64b2ED0-eB6A-0bda-BBCe-a603EaF1BEfd/$actions/add-custom-attributes" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/d95bFfb4-FFEA-4caA-4cEa-0AEDC6FD00A2/disks/1Cbf76eD-D02f-a72E-eBef-CcE2Ab599A5E/$actions/add-custom-attributes" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n UpdateCustomAttributesParams updateCustomAttributesParams\ \ = new UpdateCustomAttributesParams();\n\n // UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.CustomAttributes\ \ = new ArrayList(); // required field\n\n String vmExtId = \"08F20C2b-AABe-A87d-F6B7-AE7BbcBaEb44\"\ ;\n String extId = \"f0CA7abd-f5Ad-BdfC-DBe7-FbabDd9e3eAb\";\n\n \ \ // Create request object with parameters\n var request = new\ \ AddVmDiskCustomAttributesRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId,\n Body = updateCustomAttributesParams\n\ \ };\n try {\n AddVmDiskCustomAttributesApiResponse\ \ addVmDiskCustomAttributesApiResponse = vmApi.AddVmDiskCustomAttributes(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/remove-custom-attributes: post: tags: - Vm summary: Remove from the VM disk's custom attributes description: Removes from the custom attributes of the VM Disk entity. operationId: removeVmDiskCustomAttributes parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5f9e58ec-4893-4641-a299-888cd7f342f1 - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a5d093f2-10a4-4853-93f1-5ae0e11b6d58 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 9642e5fe-390c-46a2-ba77-86d920ff3145 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.UpdateCustomAttributesParams' required: true responses: "202": description: The request to remove from the custom attributes for the provided disk device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/remove-custom-attributes\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/remove-custom-attributes\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/remove-custom-attributes\ \ Post operation" x-permissions: operationName: Update Virtual Machine Disk Custom Attributes deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.RemoveVmDiskCustomAttributesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateCustomAttributesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.RemoveVmDiskCustomAttributesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n UpdateCustomAttributesParams\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n\ \ updateCustomAttributesParams.setCustomAttributes(new ArrayList<>());\ \ // required field\n \n String vmExtId = \"1bFe2bFb-CeF8-FD20-8F6E-2306Eda5a9cC\"\ ;\n \n String extId = \"d7FcBD4e-daab-a1F6-E00B-edA9ABAfC3bF\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n RemoveVmDiskCustomAttributesApiResponse\ \ removeVmDiskCustomAttributesApiResponse = vmApi.removeVmDiskCustomAttributes(RemoveVmDiskCustomAttributesRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), updateCustomAttributesParams);\n\n System.out.println(removeVmDiskCustomAttributesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, UpdateCustomAttributesParams } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n \ \ updateCustomAttributesParams.setCustomAttributes([]); // required field\n\ \ updateCustomAttributesParams = JSON.stringify(updateCustomAttributesParams);\n\ \n \n let vmExtId = \"Dc0BDf3C-0fc1-dEA3-Ef63-b1F35B88beFC\";\n \ \ \n let extId = \"bCaD02b8-dAbC-CfeF-3CDE-5Ef2acdb4C4E\";\n\n\n\n\n\ \n vmApi.removeVmDiskCustomAttributes(vmExtId, extId, updateCustomAttributesParams).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n updateCustomAttributesParams\ \ = ntnx_vmm_py_client.UpdateCustomAttributesParams()\n\n # UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.custom_attributes\ \ = [] # required field\n \n vm_ext_id = \"Abd53B24-eC2a-6Ddf-88b3-Fb00fBEEfc60\"\ \n \n ext_id = \"9f86d117-fEcC-bD3C-3CFB-5cd50F1e267A\"\n\n\n try:\n\ \ api_response = vm_api.remove_vm_disk_custom_attributes(vmExtId=vm_ext_id,\ \ extId=ext_id, body=updateCustomAttributesParams)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n updateCustomAttributesParams := import1.NewUpdateCustomAttributesParams()\n\ \n // UpdateCustomAttributesParams object initializations here...\n\n\ \ \n vmExtId := \"afAd8a2B-DDFc-B2fb-86b2-5dceF6dfEFCE\"\n \n \ \ extId := \"cBCbCCC9-DBbA-AcCA-2BA2-8AbA2A3a76DA\"\n\n\n request :=\ \ vm.RemoveVmDiskCustomAttributesRequest{ VmExtId: &vmExtId, ExtId: &extId,\ \ Body: updateCustomAttributesParams }\n response, error := VmServiceApiInstance.RemoveVmDiskCustomAttributes(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/FD3b04ef-e1A3-4BB9-72d6-aB4BDFFAece1/disks/ba5FAE4e-37Ca-eB7e-EFDf-9f0A4C6eeCb4/$actions/remove-custom-attributes" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/DC73c0Ad-dcDd-2Bdb-eDD5-Dc3ABEAF31ea/disks/aDcFedD4-D1fe-e4a3-9CdD-EF5d0Ac484FA/$actions/remove-custom-attributes" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n UpdateCustomAttributesParams updateCustomAttributesParams\ \ = new UpdateCustomAttributesParams();\n\n // UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.CustomAttributes\ \ = new ArrayList(); // required field\n\n String vmExtId = \"BdEEE6Ca-AED4-7CaC-afC3-DF3DFfE6Dadb\"\ ;\n String extId = \"c27BF062-aFAE-cBBe-B901-1A1BDEEA6DdB\";\n\n \ \ // Create request object with parameters\n var request = new\ \ RemoveVmDiskCustomAttributesRequest {\n VmExtId = vmExtId,\n\ \ ExtId = extId,\n Body = updateCustomAttributesParams\n\ \ };\n try {\n RemoveVmDiskCustomAttributesApiResponse\ \ removeVmDiskCustomAttributesApiResponse = vmApi.RemoveVmDiskCustomAttributes(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/enable-hydration: post: tags: - Vm summary: Enable hydration for a VM disk description: "Enable a VM disk to be hydrated to the local storage container\ \ in the background. If the VM disk hydration has been disabled, this will\ \ resume the hydration process." operationId: enableVmDiskHydration parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d5ac7850-4fe7-462a-9c71-108c99a95083 - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d6274de5-0ad2-41c3-af6e-f82f3a069241 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 15320ae1-d09c-42cc-b1f5-9f786d249f3e responses: "202": description: The request to enable hydration for the provided disk device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/enable-hydration\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/enable-hydration\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/enable-hydration\ \ Post operation" x-permissions: operationName: Enable Virtual Machine Disk Hydration deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Disaster Recovery Admin - name: Backup Admin - name: Prism Admin - name: Cluster Admin - name: Project Manager x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.EnableVmDiskHydrationRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.EnableVmDiskHydrationApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"cC9b17d3-DAEB-aBfa-9eEB-Bd3aAA55bCf8\";\n \n String\ \ extId = \"BbB41a69-8F8b-2aEb-443C-Ee1bC356CaCe\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n EnableVmDiskHydrationApiResponse enableVmDiskHydrationApiResponse\ \ = vmApi.enableVmDiskHydration(EnableVmDiskHydrationRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(enableVmDiskHydrationApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"BFDCCdc2-CC59-Cceb-F9dB-3D92Cc8CA686\";\n \n\ \ let extId = \"7c9Efe82-49E8-3e3E-1EcC-DbCecAe00130\";\n\n\n\n\n\n \ \ vmApi.enableVmDiskHydration(vmExtId, extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ eA7Fc38B-CBaF-cFF3-bF1E-FFd7BFaCC0c0\"\n \n ext_id = \"E97dd4E3-dc87-bE4e-BAbb-0de25dE82eFD\"\ \n\n\n try:\n api_response = vm_api.enable_vm_disk_hydration(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"BdEAce6A-bEbf-C8CA-dB00-3a0bBc7E4eAe\"\ \n \n extId := \"A5fF26Cb-2C0a-acdE-D5fA-abe6feea3EfA\"\n\n\n request\ \ := vm.EnableVmDiskHydrationRequest{ VmExtId: &vmExtId, ExtId: &extId }\n\ \ response, error := VmServiceApiInstance.EnableVmDiskHydration(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/d253c6d6-e937-5fEb-b3FF-AA1ee1Fb4a3C/disks/DBB6CF4f-9DDB-12dC-AC60-3995CA6f33fb/$actions/enable-hydration" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/fbADFD5c-E1Ac-Cd26-E0Ac-3BC8208b5cB3/disks/BDFc4D2A-d4F7-Dfb4-e2F2-Be16aDeE2de0/$actions/enable-hydration" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"d50C2Bec-FFD1-D0f9-Daf6-1D417BEaEFcC\"\ ;\n String extId = \"aACFc640-3Abe-31b5-8Eed-f0bC2e0cfFc4\";\n\n \ \ // Create request object with parameters\n var request = new\ \ EnableVmDiskHydrationRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n EnableVmDiskHydrationApiResponse\ \ enableVmDiskHydrationApiResponse = vmApi.EnableVmDiskHydration(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/disable-hydration: post: tags: - Vm summary: Disable hydration for a VM disk description: Disable hydration for a VM disk. The hydration process will be stopped and the disk will not be migrated to the local storage container. operationId: disableVmDiskHydration parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b574c4f6-f52f-44cb-b9be-17bd558b3376 - name: extId in: path description: A globally unique identifier of a VM disk of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: f95a03ee-835a-4968-84b4-3c635f67f557 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: eb496e68-751a-42fd-9353-105847e5e74d responses: "202": description: The request to disable hydration for the provided disk device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/disable-hydration\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/disable-hydration\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/disable-hydration\ \ Post operation" x-permissions: operationName: Disable Virtual Machine Disk Hydration deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Disaster Recovery Admin - name: Backup Admin - name: Prism Admin - name: Cluster Admin - name: Project Manager x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DisableVmDiskHydrationRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DisableVmDiskHydrationApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"A2E8ED0a-c6AA-14df-A493-5af7fE1addfC\";\n \n String\ \ extId = \"aAd2DfD1-B15d-a44b-AfF4-aCffeb83eC8e\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DisableVmDiskHydrationApiResponse disableVmDiskHydrationApiResponse\ \ = vmApi.disableVmDiskHydration(DisableVmDiskHydrationRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(disableVmDiskHydrationApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"4f09FFCc-11bE-9dDC-F3Dd-C8a8F22fB0Ab\";\n \n\ \ let extId = \"EDfD6ddb-bE25-f3dA-5ab5-ddf5E1EFDAdd\";\n\n\n\n\n\n \ \ vmApi.disableVmDiskHydration(vmExtId, extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ CDA5b3Ae-aB55-F9dE-a62A-d8bc76F4Ec1c\"\n \n ext_id = \"dc5173D4-Bf8a-c86F-FebD-5aEedc7Dd57c\"\ \n\n\n try:\n api_response = vm_api.disable_vm_disk_hydration(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"FCcdfacA-AB8a-6b4B-4E43-2aFea2aeBcEd\"\ \n \n extId := \"eB0aDaE0-AeD8-A693-AfCE-B88eAdA0bA2e\"\n\n\n request\ \ := vm.DisableVmDiskHydrationRequest{ VmExtId: &vmExtId, ExtId: &extId\ \ }\n response, error := VmServiceApiInstance.DisableVmDiskHydration(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/D8f6aAED-9fAa-bE3F-D67b-E8eBffdCec1F/disks/2EE693A2-f88F-ED0d-6ACf-b9ACebbcda7e/$actions/disable-hydration" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/aCd5eabB-7Fce-Dbdf-82AF-e6bd6EBc8ACE/disks/D0FACceA-7f45-acD3-Bd6a-eEc28bF5CbDD/$actions/disable-hydration" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"3fdbd0bB-BDD1-FDad-0daB-aadfADF38338\"\ ;\n String extId = \"aD2E2acF-bbAb-e94B-dFda-f8bD0daEBFbB\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DisableVmDiskHydrationRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n DisableVmDiskHydrationApiResponse\ \ disableVmDiskHydrationApiResponse = vmApi.DisableVmDiskHydration(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/disks: get: tags: - Vm summary: List disks attached to a VM description: Lists the disk devices attached to a virtual machine. operationId: listDisksByVmId parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 815b3084-5614-463c-96ae-9a2c56d4219a - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the configuration details for the disk devices attached to a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Get operation" x-permissions: operationName: View Virtual Machine Disk deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListDisksByVmIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListDisksApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"Db0bCb36-FDff-11D7-03Ef-52EdeFac25cB\";\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListDisksApiResponse listDisksApiResponse\ \ = vmApi.listDisksByVmId(ListDisksByVmIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .$page(page)\n .$limit(limit)\n\ \ .build());\n\n System.out.println(listDisksApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"Fd1fD9bB-Ce9a-21Ee-aad5-C854EBc9da72\";\n\n //\ \ Construct Optional Parameters\n var opts = {};\n opts[\"$page\"\ ] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmApi.listDisksByVmId(vmExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ A0AAABEe-Ab46-DdAE-62aF-C0dBa32c693a\"\n \n page = 0\n \n limit\ \ = 50\n\n\n try:\n api_response = vm_api.list_disks_by_vm_id(vmExtId=vm_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"fCB71aE2-CB7F-DafF-b50a-71B1fBFdbcbd\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := vm.ListDisksByVmIdRequest{\ \ VmExtId: &vmExtId, Page_: &page_, Limit_: &limit_ }\n response, error\ \ := VmServiceApiInstance.ListDisksByVmId(ctx, &request)\n if error !=\ \ nil {\n fmt.Println(error)\n return\n }\n data, _\ \ := response.GetData().([]import1.Disk)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/fB3AF03c-CfbB-AACD-ea7C-FaCDDEB6AF07/disks?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/C834D981-DecB-da3e-151e-7FD7abaEefCb/disks?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"3be2Cee8-4de2-F31A-4E31-3f4778a3Ac5e\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListDisksByVmIdRequest\ \ {\n VmExtId = vmExtId,\n Page = page,\n \ \ Limit = limit\n };\n try {\n ListDisksApiResponse\ \ listDisksApiResponse = vmApi.ListDisksByVmId(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - Vm summary: Create a disk device for a VM description: Creates and attaches a disk device to a virtual machine. operationId: createDisk parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 6ba102ec-1659-4d22-bfb3-3e8e5c0b7dcc - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 2a8aa43a-d942-4231-b4c2-5e4ebf781a00 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' required: true responses: "202": description: The request to create a disk device for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Post operation" x-permissions: operationName: Create Virtual Machine Disk deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: CSI System - name: Developer - name: Kubernetes Data Services System - name: Kubernetes Infrastructure Provision - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Storage Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreateDiskRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.Disk;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateDiskApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigDisk ahvConfigDisk\ \ = new AhvConfigDisk();\n\n // AhvConfigDisk object initializations\ \ here...\n \n String vmExtId = \"f94B198D-6FCF-Afba-ee18-fF5Ddc13Cdb0\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CreateDiskApiResponse\ \ createDiskApiResponse = vmApi.createDisk(CreateDiskRequest.builder()\n\ \ .vmExtId(vmExtId)\n .build(), ahvConfigDisk);\n\ \n System.out.println(createDiskApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, Disk } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigDisk = new AhvConfigDisk();\n\n // AhvConfigDisk object initializations\ \ here...\n ahvConfigDisk = JSON.stringify(ahvConfigDisk);\n\n \n\ \ let vmExtId = \"cAcCaefD-f1bE-EB5A-FFaE-a4DBdEc4Dbb0\";\n\n\n\n\n\n\ \ vmApi.createDisk(vmExtId, ahvConfigDisk).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigDisk = ntnx_vmm_py_client.AhvConfigDisk()\n\ \n # AhvConfigDisk object initializations here...\n \n vm_ext_id\ \ = \"1F8cDAae-1f75-dFCd-fFf2-8acAa7AbFd2D\"\n\n\n try:\n api_response\ \ = vm_api.create_disk(vmExtId=vm_ext_id, body=ahvConfigDisk)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigDisk := import1.NewAhvConfigDisk()\n\ \n // AhvConfigDisk object initializations here...\n\n \n vmExtId\ \ := \"68cBAEdd-FF8E-4EEb-B009-D5D7c41cDf9d\"\n\n\n request := vm.CreateDiskRequest{\ \ VmExtId: &vmExtId, Body: ahvConfigDisk }\n response, error := VmServiceApiInstance.CreateDisk(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/fcCa2a17-BAAb-dCD6-D243-DdDCA29EbEB1/disks" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/c9dB1442-6CAC-B62A-ca51-7FB7ABA79BfF/disks" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigDisk ahvConfigDisk = new AhvConfigDisk();\n\ \n // AhvConfigDisk object initializations here...\n\n String\ \ vmExtId = \"CCaF7bCB-ecfB-CAD9-C7ac-a447BFEED6C6\";\n\n // Create\ \ request object with parameters\n var request = new CreateDiskRequest\ \ {\n VmExtId = vmExtId,\n Body = ahvConfigDisk\n\ \ };\n try {\n CreateDiskApiResponse createDiskApiResponse\ \ = vmApi.CreateDisk(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}: get: tags: - Vm summary: Get VM configuration details description: Retrieves configuration details for a virtual machine. operationId: getVmById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ba8da8d6-4ee5-440d-8703-206051443ccc responses: "200": description: Returns the configuration details for a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Get operation" x-permissions: operationName: View Existing Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Disaster Recovery Admin - name: Disaster Recovery Viewer - name: Backup Admin - name: Flow Admin - name: Flow Viewer - name: Flow Policy Author - name: NCM Connector x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetVmByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"ddeCB00E-7EB3-66EF-A1CD-feFEEeA53F4c\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n AhvConfigGetVmApiResponse ahvConfigGetVmApiResponse\ \ = vmApi.getVmById(GetVmByIdRequest.builder()\n .extId(extId)\n\ \ .build());\n\n System.out.println(ahvConfigGetVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"d498D6aa-e8c8-5eDD-Ba7A-A6d12baEfb2B\";\n\n\n\n\n\n\ \ vmApi.getVmById(extId).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"f5Ca41f4-dDEF-434e-BBEA-DC9FDDd0BfbA\"\ \n\n\n try:\n api_response = vm_api.get_vm_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"b78a3DDD-dCeD-cFe5-aD77-10EF5a56fE4B\"\ \n\n\n request := vm.GetVmByIdRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.GetVmById(ctx, &request)\n if error !=\ \ nil {\n fmt.Println(error)\n return\n }\n data, _\ \ := response.GetData().(import1.Vm)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/aEdCdDFf-83A8-BbAC-9ACa-0BeCA8dE92cf" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/0712183E-4edd-d7F7-89cF-baAC6efD2E1a" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"bB38dbeb-5dF1-EbBD-eafe-d1cBDbFDDBd5\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetVmByIdRequest {\n ExtId = extId\n };\n \ \ try {\n AhvConfigGetVmApiResponse ahvConfigGetVmApiResponse\ \ = vmApi.GetVmById(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" put: tags: - Vm summary: Update configuration for a VM description: Updates configuration details for a virtual machine. operationId: updateVmById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d84632d3-6e57-4001-9a28-f4c571b05478 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: aec763bc-2466-4fbd-a021-b25059e50edd requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' required: true responses: "202": description: The request to update configuration for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Put operation" x-permissions: operationName: Update Virtual Machine Basic Config deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UpdateVmByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetVmByIdRequest;\nimport java.util.HashMap;\n\ import org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.Vm;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigVm ahvConfigVm\ \ = new AhvConfigVm();\n\n // AhvConfigVm object initializations\ \ here...\n \n String extId = \"a7eDF97c-Ef2F-6cCe-e73D-1FbDDc1b0FDa\"\ ;\n\n // perform GET call\n AhvConfigGetVmApiResponse getResponse\ \ = null;\n try {\n getResponse = vmApi.getVmById(GetVmByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateVmApiResponse\ \ updateVmApiResponse = vmApi.updateVmById(UpdateVmByIdRequest.builder()\n\ \ .extId(extId)\n .build(), ahvConfigVm, opts);\n\ \n System.out.println(updateVmApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, Vm } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigVm = new AhvConfigVm();\n\n // AhvConfigVm object initializations\ \ here...\n ahvConfigVm = JSON.stringify(ahvConfigVm);\n\n \n let\ \ extId = \"fACcF60f-fce2-cdFd-c7cc-EedB27CfDaeC\";\n\n\n // Perform\ \ Get call\n vmApi.getVmById(extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ // Extract E-Tag Header\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n\n vmApi.updateVmById(extId,\ \ ahvConfigVm, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigVm = ntnx_vmm_py_client.AhvConfigVm()\n\ \n # AhvConfigVm object initializations here...\n \n ext_id = \"\ aFDa46bE-7D5a-cC3d-f2e0-903edbD7AfF1\"\n\n try:\n api_response\ \ = vm_api.get_vm_by_id(extId=ext_id)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n # Extract E-Tag Header\n etag_value =\ \ ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\n try:\n \ \ api_response = vm_api.update_vm_by_id(extId=ext_id, body=ahvConfigVm,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigVm := import1.NewAhvConfigVm()\n\ \n // AhvConfigVm object initializations here...\n\n \n extId :=\ \ \"52051dc2-2E8d-21FE-faBc-AC6fab84BAB4\"\n\n getRequest := vm.GetVmByIdRequest{\ \ extId: &extId }\n getResponse, err := VmServiceApiInstance.GetVmById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vm.UpdateVmByIdRequest{ ExtId: &extId, Body: ahvConfigVm\ \ }\n response, error := VmServiceApiInstance.UpdateVmById(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/f3fc31Ef-f72B-A5f1-C8cE-409bFc22F6dF" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/c900faeC-abeb-CEFd-56bC-C27c750Bdd6A" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigVm ahvConfigVm = new AhvConfigVm();\n\ \n // AhvConfigVm object initializations here...\n\n String extId\ \ = \"b72F9f0A-B6E2-77Ab-Fc34-a43e402b6619\";\n\n // perform GET\ \ call\n var getRequest = new GetVmByIdRequest {\n ExtId\ \ = extId\n };\n try {\n AhvConfigGetVmApiResponse\ \ getResponse = vmApi.GetVmById(getRequest);\n } catch(ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n \ \ // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateVmByIdRequest {\n ExtId = extId,\n \ \ Body = ahvConfigVm,\n \n \n };\n \ \ try {\n UpdateVmApiResponse updateVmApiResponse = vmApi.UpdateVmById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Vm summary: Delete a VM description: Delete the specified virtual machine. operationId: deleteVmById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 7d5a275e-d533-4161-8086-d69c86b19085 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 69f46bbd-a6cc-4f17-be33-517f81bb2e8c responses: "202": description: The request to delete a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Delete operation" x-permissions: operationName: Delete Existing Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeleteVmByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"b59bB2aB-f0d3-Aa6F-b2fC-C15Cb4bd68eF\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteVmApiResponse deleteVmApiResponse\ \ = vmApi.deleteVmById(DeleteVmByIdRequest.builder()\n .extId(extId)\n\ \ .build());\n\n System.out.println(deleteVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"9B1D15Ef-ddEf-adAa-36cF-69b2e1DC4C97\";\n\n\n\n\n\n\ \ vmApi.deleteVmById(extId).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"13F91fFB-DD06-AF4F-3E85-f4c6BCBCCacC\"\ \n\n\n try:\n api_response = vm_api.delete_vm_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"cbBcBEEC-edE6-FADe-0eAA-9cAE1A1B1fe2\"\ \n\n\n request := vm.DeleteVmByIdRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.DeleteVmById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/dcf9ED3e-0fE4-4BA1-DF27-BdAAAA7a6dcF" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/9cbd4DFa-BCeF-B0cE-FCBA-9fFaC7CE5CBd" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"fdaAdBF1-a291-ED5F-fDFa-be9e98a7EB0C\"\ ;\n\n // Create request object with parameters\n var request\ \ = new DeleteVmByIdRequest {\n ExtId = extId\n };\n \ \ try {\n DeleteVmApiResponse deleteVmApiResponse = vmApi.DeleteVmById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms: get: tags: - Vm summary: List VMs description: Lists the Virtual Machines defined on the system. List of Virtual Machines can be further filtered out using various filtering options. operationId: listVms parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: apcConfig/cpuModel/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=apcConfig/cpuModel/extId\ \ eq 'ce3bfe85-4670-46e1-8731-8275a076ef52'" - name: apcConfig/cpuModel/name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=apcConfig/cpuModel/name\ \ eq 'Haswell'" - name: apcConfig/isApcEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=apcConfig/isApcEnabled\ \ eq true" - name: cluster/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=cluster/extId\ \ eq '7833d033-8464-40e1-b70f-0116de41de4e'" - name: customAttributes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=customAttributes/any(a:a\ \ eq 'string')" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: gpus/mode example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=gpus/any(a:a/mode\ \ eq Vmm.Ahv.Config.GpuMode'PASSTHROUGH_GRAPHICS')" - name: gpus/vendor example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=gpus/any(a:a/vendor\ \ eq Vmm.Ahv.Config.GpuVendor'NVIDIA')" - name: guestTools/guestInfo/dnsName/value example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=guestTools/guestInfo/dnsName/value\ \ eq 'string'" - name: guestTools/guestInfo/guestOsBuildNumber example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=guestTools/guestInfo/guestOsBuildNumber\ \ eq 'string'" - name: guestTools/guestInfo/installedVirtIoVersion example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=guestTools/guestInfo/installedVirtIoVersion\ \ eq 'string'" - name: guestTools/guestInfo/lastBootUpTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=guestTools/guestInfo/lastBootUpTime\ \ eq '2009-09-23T14:30:00-07:00'" - name: guestTools/isCommunicationActiveOverSerialPort example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=guestTools/isCommunicationActiveOverSerialPort\ \ eq true" - name: guestTools/isReachable example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=guestTools/isReachable\ \ eq false" - name: hardwareClockTimezone example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=hardwareClockTimezone\ \ eq 'UTC'" - name: host/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=host/extId\ \ eq '3ec856af-380d-425c-bc68-1c63a246a057'" - name: isAgentVm example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isAgentVm\ \ eq true" - name: isCpuHotplugEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isCpuHotplugEnabled\ \ eq true" - name: isCpuPassthroughEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isCpuPassthroughEnabled\ \ eq true" - name: isGpuConsoleEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isGpuConsoleEnabled\ \ eq false" - name: isLiveMigrateCapable example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isLiveMigrateCapable\ \ eq true" - name: isMemoryOvercommitEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isMemoryOvercommitEnabled\ \ eq true" - name: isScsiControllerEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isScsiControllerEnabled\ \ eq true" - name: isVcpuHardPinningEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isVcpuHardPinningEnabled\ \ eq false" - name: isVgaConsoleEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=isVgaConsoleEnabled\ \ eq true" - name: machineType example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=machineType\ \ eq Vmm.Ahv.Config.MachineType'PC'" - name: memorySizeBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=memorySizeBytes\ \ eq 59" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=name\ \ eq 'Test VM'" - name: nics/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=nics/any(a:a/extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5')" - name: nics/networkInfo/subnet/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=nics/any(a:a/networkInfo/subnet/extId\ \ eq 'c899f9ec-5958-4d10-968f-53353f5ac272')" - name: numCoresPerSocket example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=numCoresPerSocket\ \ eq 42" - name: numNumaNodes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=numNumaNodes\ \ eq 36" - name: numSockets example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=numSockets\ \ eq 42" - name: numThreadsPerCore example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=numThreadsPerCore\ \ eq 94" - name: powerState example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=powerState\ \ eq Vmm.Ahv.Config.PowerState'ON'" - name: storageConfig/hydrationInfo/hydrationStatus example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=storageConfig/hydrationInfo/hydrationStatus\ \ eq Vmm.Ahv.Config.HydrationStatus'IN_PROGRESS'" - name: storageConfig/storageLocationInfo/storageCluster/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$filter=storageConfig/storageLocationInfo/storageCluster/extId\ \ eq '7833d033-8464-40e1-b70f-0116de41de4e'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: guestTools/guestInfo/dnsName/value example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=guestTools/guestInfo/dnsName/value" - name: guestTools/guestInfo/installedVirtIoVersion example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=guestTools/guestInfo/installedVirtIoVersion" - name: guestTools/guestInfo/lastBootUpTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=guestTools/guestInfo/lastBootUpTime" - name: guestTools/version example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=guestTools/version" - name: memorySizeBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=memorySizeBytes" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=name" - name: numCoresPerSocket example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=numCoresPerSocket" - name: numNumaNodes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=numNumaNodes" - name: numSockets example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=numSockets" - name: numThreadsPerCore example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$orderby=numThreadsPerCore" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: apcConfig/cpuModel/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=apcConfig/cpuModel/extId" - name: apcConfig/cpuModel/name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=apcConfig/cpuModel/name" - name: apcConfig/isApcEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=apcConfig/isApcEnabled" - name: availabilityZone example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=availabilityZone" - name: biosUuid example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=biosUuid" - name: bootConfig example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=bootConfig" - name: categories example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=categories" - name: cdRoms example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=cdRoms" - name: cluster/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=cluster/extId" - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=createTime" - name: customAttributes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=customAttributes" - name: description example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=description" - name: disks example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=disks" - name: enabledCpuFeatures example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=enabledCpuFeatures" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=extId" - name: generationUuid example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=generationUuid" - name: gpus example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=gpus" - name: guestCustomization example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestCustomization" - name: guestTools/availableVersion example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/availableVersion" - name: guestTools/capabilities example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/capabilities" - name: guestTools/guestInfo/dnsName/value example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestInfo/dnsName/value" - name: guestTools/guestInfo/guestOsBuildNumber example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestInfo/guestOsBuildNumber" - name: guestTools/guestInfo/guestOsFullName example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestInfo/guestOsFullName" - name: guestTools/guestInfo/installedVirtIoVersion example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestInfo/installedVirtIoVersion" - name: guestTools/guestInfo/isVmMobilityDriversInstalled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestInfo/isVmMobilityDriversInstalled" - name: guestTools/guestInfo/lastBootUpTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestInfo/lastBootUpTime" - name: guestTools/guestOsVersion example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/guestOsVersion" - name: guestTools/isCommunicationActiveOverSerialPort example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isCommunicationActiveOverSerialPort" - name: guestTools/isEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isEnabled" - name: guestTools/isInstalled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isInstalled" - name: guestTools/isIsoInserted example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isIsoInserted" - name: guestTools/isReachable example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isReachable" - name: guestTools/isVmMobilityDriversInstalled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isVmMobilityDriversInstalled" - name: guestTools/isVssSnapshotCapable example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/isVssSnapshotCapable" - name: guestTools/version example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=guestTools/version" - name: hardwareClockTimezone example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=hardwareClockTimezone" - name: host/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=host/extId" - name: isAgentVm example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isAgentVm" - name: isBrandingEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isBrandingEnabled" - name: isCpuHotplugEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isCpuHotplugEnabled" - name: isCpuPassthroughEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isCpuPassthroughEnabled" - name: isCrossClusterMigrationInProgress example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isCrossClusterMigrationInProgress" - name: isGpuConsoleEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isGpuConsoleEnabled" - name: isLiveMigrateCapable example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isLiveMigrateCapable" - name: isMemoryOvercommitEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isMemoryOvercommitEnabled" - name: isScsiControllerEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isScsiControllerEnabled" - name: isVcpuHardPinningEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isVcpuHardPinningEnabled" - name: isVgaConsoleEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=isVgaConsoleEnabled" - name: links example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=links" - name: machineType example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=machineType" - name: memorySizeBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=memorySizeBytes" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=name" - name: nics example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=nics" - name: numCoresPerSocket example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=numCoresPerSocket" - name: numNumaNodes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=numNumaNodes" - name: numSockets example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=numSockets" - name: numThreadsPerCore example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=numThreadsPerCore" - name: ownershipInfo example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=ownershipInfo" - name: pcieDevices example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=pcieDevices" - name: powerState example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=powerState" - name: project example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=project" - name: protectionPolicyState example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=protectionPolicyState" - name: protectionType example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=protectionType" - name: serialPorts example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=serialPorts" - name: source example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=source" - name: storageConfig/hydrationInfo/hydrationStatus example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=storageConfig/hydrationInfo/hydrationStatus" - name: storageConfig/isFlashModeEnabled example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=storageConfig/isFlashModeEnabled" - name: storageConfig/qosConfig example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=storageConfig/qosConfig" - name: storageConfig/storageLocationInfo/storageCluster/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=storageConfig/storageLocationInfo/storageCluster/extId" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=tenantId" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=updateTime" - name: vmGuestCustomizationStatus example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=vmGuestCustomizationStatus" - name: vtpmConfig example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms?$select=vtpmConfig" responses: "200": description: Returns the list of Virtual Machines present in the cluster. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Get operation x-permissions: operationName: View Existing Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin - name: Flow Admin - name: Flow Viewer - name: Flow Policy Author - name: NCM Connector x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListVmsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListVmsApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n int page =\ \ 0;\n \n int limit = 50;\n\n try {\n //\ \ Pass in parameters using the request builder object associated with the\ \ operation.\n AhvConfigListVmsApiResponse ahvConfigListVmsApiResponse\ \ = vmApi.listVms(ListVmsRequest.builder()\n .$page(page)\n\ \ .$limit(limit)\n .$filter(null)\n \ \ .$orderby(null)\n .$select(null)\n \ \ .build());\n\n System.out.println(ahvConfigListVmsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmApi = new VmApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; vmApi.listVms(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n page = 0\n \ \ \n limit = 50\n\n\n try:\n api_response = vm_api.list_vms(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vm.ListVmsRequest{ Page_: &page_, Limit_: &limit_,\ \ Filter_: nil, Orderby_: nil, Select_: nil }\n response, error := VmServiceApiInstance.ListVms(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.Vm)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n int page = 0;\n int limit = 50;\n String\ \ filter = \"string_sample_data\";\n String orderby = \"string_sample_data\"\ ;\n String select = \"string_sample_data\";\n\n // Create request\ \ object with parameters\n var request = new ListVmsRequest {\n \ \ Page = page,\n Limit = limit,\n Filter\ \ = filter,\n Orderby = orderby,\n Select = select\n\ \ };\n try {\n AhvConfigListVmsApiResponse ahvConfigListVmsApiResponse\ \ = vmApi.ListVms(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" post: tags: - Vm summary: Create a VM description: Creates a Virtual Machine with the provided configuration. operationId: createVm parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 07bdf150-b97b-44ae-8f05-282b0d181504 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' required: true responses: "202": description: The request to create a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Post operation x-permissions: operationName: Create New Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: Disaster Recovery Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.VmApi; import com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreateVmRequest; import com.nutanix.dp1.vmm.vmm.v4.ahv.config.Vm; import com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateVmApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. VmApi vmApi = new VmApi(apiClient); AhvConfigVm ahvConfigVm = new AhvConfigVm(); // AhvConfigVm object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateVmApiResponse createVmApiResponse = vmApi.createVm(CreateVmRequest.builder() .build(), ahvConfigVm); System.out.println(createVmApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, VmApi, Vm } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmApi = new VmApi(apiClientInstance); function sample() { let ahvConfigVm = new AhvConfigVm(); // AhvConfigVm object initializations here... ahvConfigVm = JSON.stringify(ahvConfigVm); vmApi.createVm(ahvConfigVm).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) vm_api = ntnx_vmm_py_client.VmApi(api_client=client) ahvConfigVm = ntnx_vmm_py_client.AhvConfigVm() # AhvConfigVm object initializations here... try: api_response = vm_api.create_vm(body=ahvConfigVm) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient VmServiceApiInstance *api.VmServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance) ctx := context.Background() ahvConfigVm := import1.NewAhvConfigVm() // AhvConfigVm object initializations here... request := vm.CreateVmRequest{ Body: ahvConfigVm } response, error := VmServiceApiInstance.CreateVm(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigVm ahvConfigVm = new AhvConfigVm();\n\ \n // AhvConfigVm object initializations here...\n\n\n // Create\ \ request object with parameters\n var request = new CreateVmRequest\ \ {\n Body = ahvConfigVm\n };\n try {\n \ \ CreateVmApiResponse createVmApiResponse = vmApi.CreateVm(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/customize-guest: post: tags: - Vm summary: Stage guest customization configuration details description: Stage a Sysprep or cloud-init configuration file to be used by the guest for the next boot. Note that the Sysprep command must be used to generalize the Windows VMs before triggering this API call. operationId: customizeGuestVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 77da1e0c-e364-4b1e-b3d2-dd84431b8f7f - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 07df4e0f-6118-4e04-ba17-4d4592b91dff requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestCustomizationParams' required: true responses: "202": description: The request to stage guest customization configuration details is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/customize-guest\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/customize-guest\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/customize-guest\ \ Post operation" x-permissions: operationName: Customise Virtual Machine Guest deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CustomizeGuestVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestCustomizationParams;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.CustomizeGuestVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestCustomizationParams\ \ guestCustomizationParams = new GuestCustomizationParams();\n\n \ \ // GuestCustomizationParams object initializations here...\n \n\ \ String extId = \"BeBE50Aa-5db0-8EBB-9333-DdbE2bCDEaaf\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ CustomizeGuestVmApiResponse customizeGuestVmApiResponse = vmApi.customizeGuestVm(CustomizeGuestVmRequest.builder()\n\ \ .extId(extId)\n .build(), guestCustomizationParams,\ \ opts);\n\n System.out.println(customizeGuestVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestCustomizationParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestCustomizationParams = new GuestCustomizationParams();\n\n // GuestCustomizationParams\ \ object initializations here...\n guestCustomizationParams = JSON.stringify(guestCustomizationParams);\n\ \n \n let extId = \"CCC4fAF1-A0CC-3079-EEf8-FbF6fa3Ddb5D\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.customizeGuestVm(extId,\ \ guestCustomizationParams, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestCustomizationParams\ \ = ntnx_vmm_py_client.GuestCustomizationParams()\n\n # GuestCustomizationParams\ \ object initializations here...\n \n ext_id = \"ceefEe88-bE8e-fFC0-Ec8D-FcdF4BaaC21D\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.customize_guest_vm(extId=ext_id,\ \ body=guestCustomizationParams, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestCustomizationParams := import1.NewGuestCustomizationParams()\n\ \n // GuestCustomizationParams object initializations here...\n\n \ \ \n extId := \"AE6b6E5c-99ac-deFb-b863-FF0Dc1320C7A\"\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.CustomizeGuestVmRequest{ ExtId: &extId, Body: guestCustomizationParams\ \ }\n response, error := VmServiceApiInstance.CustomizeGuestVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Bc5F6ab3-eCb3-39AF-A80a-3dcDdDDFfEFE/$actions/customize-guest" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/1DBcF0CC-d0E7-7ADD-c64D-c8eabFeefc5A/$actions/customize-guest" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestCustomizationParams guestCustomizationParams\ \ = new GuestCustomizationParams();\n\n // GuestCustomizationParams\ \ object initializations here...\n\n String extId = \"Cfe5Ea73-B530-5F67-bFCB-0fBFF4fAaA8f\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new CustomizeGuestVmRequest\ \ {\n ExtId = extId,\n Body = guestCustomizationParams,\n\ \ \n \n };\n try {\n CustomizeGuestVmApiResponse\ \ customizeGuestVmApiResponse = vmApi.CustomizeGuestVm(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-vm-disks: post: tags: - Vm summary: VmDisk migration between storage containers description: "Specifies the VmDisks of a VM for migration and the migration\ \ plan for them. If all the disks of a VM need to be migrated to the same\ \ storage container, only a single migration plan with only the external ID\ \ of the destination storage container is needed. If the disks are being\ \ migrated to different containers, one plan per disk needs to be specified." operationId: migrateVmDisks parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 6bb4c4f7-2c1d-4f5a-859d-64d3bbb9f55e - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f71f2739-7932-4b92-9723-753520862444 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DiskMigrationParams' required: true responses: "202": description: The request to migrate VmDisks between storage containers is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-vm-disks\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-vm-disks\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-vm-disks\ \ Post operation" x-permissions: operationName: Migrate Virtual Machine Disk deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 1 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.MigrateVmDisksRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.DiskMigrationParams;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.MigrateVmDisksApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n DiskMigrationParams\ \ diskMigrationParams = new DiskMigrationParams();\n\n // DiskMigrationParams\ \ object initializations here...\n \n String extId = \"C7bBd93b-a26b-dDe2-9cfF-dED9DfB09Cbb\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ MigrateVmDisksApiResponse migrateVmDisksApiResponse = vmApi.migrateVmDisks(MigrateVmDisksRequest.builder()\n\ \ .extId(extId)\n .build(), diskMigrationParams,\ \ opts);\n\n System.out.println(migrateVmDisksApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, DiskMigrationParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ diskMigrationParams = new DiskMigrationParams();\n\n // DiskMigrationParams\ \ object initializations here...\n diskMigrationParams = JSON.stringify(diskMigrationParams);\n\ \n \n let extId = \"d89DE497-06BB-EfF0-1DDd-DbABF478FceE\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.migrateVmDisks(extId,\ \ diskMigrationParams, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n diskMigrationParams\ \ = ntnx_vmm_py_client.DiskMigrationParams()\n\n # DiskMigrationParams\ \ object initializations here...\n \n ext_id = \"aAabDF77-64ED-c8d4-874F-E9C67ea4Aa26\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.migrate_vm_disks(extId=ext_id,\ \ body=diskMigrationParams, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n diskMigrationParams := import1.NewDiskMigrationParams()\n\ \n // DiskMigrationParams object initializations here...\n\n \n \ \ extId := \"c82Ac22F-Aacf-d60c-c7CE-DEFFAbaabDdF\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.MigrateVmDisksRequest{ ExtId: &extId, Body: diskMigrationParams\ \ }\n response, error := VmServiceApiInstance.MigrateVmDisks(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/3E92FD3b-abDa-8aaD-eEFa-bE7Ff70CeEBA/$actions/migrate-vm-disks" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"migrateDisks":{"plans":[{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"vmDisks":[{"diskExtId":"string","$objectType":"vmm.v4.ahv.config.MigrateDiskReference"}],"$objectType":"vmm.v4.ahv.config.ADSFDiskMigrationPlan"}],"$objectType":"vmm.v4.ahv.config.MigrationPlans"},"$objectType":"vmm.v4.ahv.config.DiskMigrationParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"migrateDisks":{"plans":[{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"vmDisks":[{"diskExtId":"string","$objectType":"vmm.v4.ahv.config.MigrateDiskReference"}],"$objectType":"vmm.v4.ahv.config.ADSFDiskMigrationPlan"}],"$objectType":"vmm.v4.ahv.config.MigrationPlans"},"$objectType":"vmm.v4.ahv.config.DiskMigrationParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/87A5cdBc-6Ad6-6048-632D-0bBA8DdB4B7E/$actions/migrate-vm-disks" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n DiskMigrationParams diskMigrationParams = new\ \ DiskMigrationParams();\n\n // DiskMigrationParams object initializations\ \ here...\n\n String extId = \"b6Bf6ff4-7eB3-cdBe-BE10-Eab0Af00CBfF\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new MigrateVmDisksRequest\ \ {\n ExtId = extId,\n Body = diskMigrationParams,\n\ \ \n \n };\n try {\n MigrateVmDisksApiResponse\ \ migrateVmDisksApiResponse = vmApi.MigrateVmDisks(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/revert: post: tags: - Vm summary: Revert the AHV VM. description: "Revert VM identified by {extId}. This does an in-place VM restore\ \ from a specified VM Recovery Point. The project, categories and VM owner\ \ reference will not be reverted as part of this operation by default." operationId: revertVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8d2b58cd-26f9-4efa-9f97-955129f3f109 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: dae11de5-9d34-443d-a741-bff4fcff1678 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.RevertParams' required: true responses: "202": description: "Request Accepted. Returning task ID to monitor the progress\ \ of VM revert operation. Once the task completes, the current VM's recovery\ \ point ID (created before this revert operation has started) may be found\ \ in the task completion details if created." headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/revert\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/revert\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/revert\ \ Post operation" x-permissions: operationName: Revert Existing Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Consumer - name: Developer - name: Operator - name: Project Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Disaster Recovery Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 1 timeUnit: seconds - type: Small count: 1 timeUnit: seconds - type: Large count: 1 timeUnit: seconds - type: XLarge count: 1 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.RevertVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.RevertParams;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.RevertVmApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigRevertParams\ \ ahvConfigRevertParams = new AhvConfigRevertParams();\n\n // AhvConfigRevertParams\ \ object initializations here...\n ahvConfigRevertParams.setVmRecoveryPointExtId(\"\ BCD089C8-0e6F-C3Cd-B1da-4Ee91B68c5ca\"); // required field\n \n\ \ String extId = \"4f0FEBee-Ff7c-a92f-1CbA-19B5E9Ee2aaD\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigRevertVmApiResponse ahvConfigRevertVmApiResponse = vmApi.revertVm(RevertVmRequest.builder()\n\ \ .extId(extId)\n .build(), ahvConfigRevertParams,\ \ opts);\n\n System.out.println(ahvConfigRevertVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, RevertParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigRevertParams = new AhvConfigRevertParams();\n\n // AhvConfigRevertParams\ \ object initializations here...\n ahvConfigRevertParams.setVmRecoveryPointExtId(\"\ E95debDC-bB76-70be-EE9C-fBdED6Dab2a2\"); // required field\n ahvConfigRevertParams\ \ = JSON.stringify(ahvConfigRevertParams);\n\n \n let extId = \"DfFA22fB-aDD0-BfaF-b6a3-2feD3cBC5baf\"\ ;\n\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.revertVm(extId,\ \ ahvConfigRevertParams, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigRevertParams\ \ = ntnx_vmm_py_client.AhvConfigRevertParams()\n\n # AhvConfigRevertParams\ \ object initializations here...\n ahvConfigRevertParams.vm_recovery_point_ext_id\ \ = \"dCEfECcE-08d4-5F4c-dd8B-CA0AcC1A5Aed\" # required field\n \n \ \ ext_id = \"E9EEA4db-c2E3-ABf2-E7a4-bAabBEcf5EdD\"\n\n \"\"\"\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = vm_api.revert_vm(extId=ext_id, body=ahvConfigRevertParams,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigRevertParams := import1.NewAhvConfigRevertParams()\n\ \n // AhvConfigRevertParams object initializations here...\n\n \n\ \ extId := \"C1fD1faA-F98b-5Bde-E6f9-dEe38BBFF58E\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.RevertVmRequest{ ExtId: &extId, Body: ahvConfigRevertParams\ \ }\n response, error := VmServiceApiInstance.RevertVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/befBD4Cf-aF19-7Dc5-AD9a-5dFa54Ed87aC/$actions/revert" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"vmRecoveryPointExtId":"string","overrideSpec":{"shouldRevertVmCategories":false,"shouldRevertVmOwner":false,"$objectType":"vmm.v4.ahv.config.VmRevertOverrideSpec"},"$objectType":"vmm.v4.ahv.config.RevertParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"vmRecoveryPointExtId":"string","overrideSpec":{"shouldRevertVmCategories":false,"shouldRevertVmOwner":false,"$objectType":"vmm.v4.ahv.config.VmRevertOverrideSpec"},"$objectType":"vmm.v4.ahv.config.RevertParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/eaF1Af66-BB8b-eAC9-aDBF-C8ECE78b43E5/$actions/revert" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigRevertParams ahvConfigRevertParams =\ \ new AhvConfigRevertParams();\n\n // AhvConfigRevertParams object\ \ initializations here...\n ahvConfigRevertParams.VmRecoveryPointExtId\ \ = \"316bbFFf-a317-C2c8-eC21-ed88ABaBAB7E\"; // required field\n\n \ \ String extId = \"C7C56e81-4Fd2-BdCD-EE9B-cBf0FadADEcF\";\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new RevertVmRequest {\n\ \ ExtId = extId,\n Body = ahvConfigRevertParams,\n\ \ \n \n };\n try {\n AhvConfigRevertVmApiResponse\ \ ahvConfigRevertVmApiResponse = vmApi.RevertVm(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate: post: tags: - Vm summary: Migrate a VM across clusters description: "Migrates a VM from the current cluster to a new target cluster.\ \ Supports the dry-run option, which if used results only in validation of\ \ the cross-cluster migration parameters and pre-requisites." operationId: crossClusterMigrateVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ede5124f-e771-4323-ac60-2a41ab318d3f - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 22415874-0c67-4318-8146-b4065ea724a8 - name: $dryrun in: query description: | A URL query parameter that allows long running operations to execute in a dry-run mode providing ability to identify trouble spots and system failures without performing the actual operation. Additionally this mode also offers a summary snapshot of the resultant system in order to better understand how things fit together. The operation runs in dry-run mode only if the provided value is true. required: false style: form explode: false schema: type: boolean description: | A URL query parameter that allows long running operations to execute in a dry-run mode providing ability to identify trouble spots and system failures without performing the actual operation. Additionally this mode also offers a summary snapshot of the resultant system in order to better understand how things fit together. The operation runs in dry-run mode only if the provided value is true. example: false requestBody: description: Input on how to migrate a VM across clusters. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmCrossClusterMigrateParams' required: true responses: "202": description: The request to migrate a VM across clusters is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate\ \ Post operation" x-permissions: operationName: Allow Cross Cluster VM Migration deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CrossClusterMigrateVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.AvailabilityZoneReference;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.VmCrossClusterMigrateParams;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.CrossClusterMigrateVmApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n VmCrossClusterMigrateParams\ \ vmCrossClusterMigrateParams = new VmCrossClusterMigrateParams();\n\n \ \ // VmCrossClusterMigrateParams object initializations here...\n\ \ vmCrossClusterMigrateParams.setIsLiveMigration(true); // required\ \ field\n vmCrossClusterMigrateParams.setTargetAvailabilityZone(new\ \ AvailabilityZoneReference()); // required field\n \n String\ \ extId = \"6A71E35d-Df7f-FFdf-2AeF-cc32ebAdaBdc\";\n \n boolean\ \ dryrun = true;\n\n /*\n Some Create, Update, and Delete\ \ operations generally require an If-Match header with a value to be passed\ \ in order to protect against concurrent updates.\n The value that\ \ needs to be sent in the If-Match header needs to be retrieved by performing\ \ a Read(Get) operation on the same resource.\n ETags can be retrieved\ \ by calling a static method of ApiClient as below:\n String eTag\ \ = ApiClient.getEtag(getResponse);\n HashMap opts\ \ = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH, eTag);\n \ \ */\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CrossClusterMigrateVmApiResponse\ \ crossClusterMigrateVmApiResponse = vmApi.crossClusterMigrateVm(CrossClusterMigrateVmRequest.builder()\n\ \ .extId(extId)\n .$dryrun(dryrun)\n \ \ .build(), vmCrossClusterMigrateParams, opts);\n\n \ \ System.out.println(crossClusterMigrateVmApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, AvailabilityZoneReference, VmCrossClusterMigrateParams\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ vmCrossClusterMigrateParams = new VmCrossClusterMigrateParams();\n\n \ \ // VmCrossClusterMigrateParams object initializations here...\n vmCrossClusterMigrateParams.setIsLiveMigration(true);\ \ // required field\n vmCrossClusterMigrateParams.setTargetAvailabilityZone(new\ \ AvailabilityZoneReference()); // required field\n vmCrossClusterMigrateParams\ \ = JSON.stringify(vmCrossClusterMigrateParams);\n\n \n let extId\ \ = \"CcC7EbAe-0Da3-EcDf-1d1E-2909b6e1e362\";\n\n // Construct Optional\ \ Parameters\n var opts = {};\n opts[\"$dryrun\"] = true;\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.crossClusterMigrateVm(extId, vmCrossClusterMigrateParams,\ \ opts, args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n vmCrossClusterMigrateParams\ \ = ntnx_vmm_py_client.VmCrossClusterMigrateParams()\n\n # VmCrossClusterMigrateParams\ \ object initializations here...\n vmCrossClusterMigrateParams.is_live_migration\ \ = True # required field\n vmCrossClusterMigrateParams.target_availability_zone\ \ = ntnx_vmm_py_client.AvailabilityZoneReference() # required field\n \ \ \n ext_id = \"AbA367eb-A37c-b4CE-fDDD-C2ABBA8398Ff\"\n \n dryrun\ \ = True\n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.cross_cluster_migrate_vm(extId=ext_id,\ \ body=vmCrossClusterMigrateParams, _dryrun=dryrun, if_match=etag_value)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n vmCrossClusterMigrateParams := import1.NewVmCrossClusterMigrateParams()\n\ \n // VmCrossClusterMigrateParams object initializations here...\n\n\ \ \n extId := \"2bB2Ab23-D9C6-EAAd-C0Eb-e3D69D1D9E3c\"\n \n \ \ dryrun_ := true\n\n /*\n Some Create, Update, and Delete operations\ \ generally require an If-Match header with a value to be passed in order\ \ to protect against concurrent updates.\n The value that needs to be\ \ sent in the If-Match header needs to be retrieved by performing a Read(Get)\ \ operation on the same resource.\n ETags can be retrieved by calling\ \ a static method of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.CrossClusterMigrateVmRequest{ ExtId: &extId,\ \ Body: vmCrossClusterMigrateParams, Dryrun_: &dryrun_ }\n response,\ \ error := VmServiceApiInstance.CrossClusterMigrateVm(ctx, &request, args)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/d9eFfdEd-ac6C-C4F8-d4b7-f1E4Be0F6DcF/$actions/migrate?$dryrun=true" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"targetAvailabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"targetCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"isLiveMigration":true,"overrides":{"overrideNicList":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"storageContainersMapping":[{"sourceStorageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"targetStorageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.StorageContainerMapping"}],"$objectType":"vmm.v4.ahv.config.VmCrossClusterMigrateOverrides"},"$objectType":"vmm.v4.ahv.config.VmCrossClusterMigrateParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"targetAvailabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"targetCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"isLiveMigration":true,"overrides":{"overrideNicList":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"storageContainersMapping":[{"sourceStorageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"targetStorageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.StorageContainerMapping"}],"$objectType":"vmm.v4.ahv.config.VmCrossClusterMigrateOverrides"},"$objectType":"vmm.v4.ahv.config.VmCrossClusterMigrateParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/dBfad6Fa-FcD6-c9E9-1AEC-7BD7a7B5A121/$actions/migrate?$dryrun=true" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n VmCrossClusterMigrateParams vmCrossClusterMigrateParams\ \ = new VmCrossClusterMigrateParams();\n\n // VmCrossClusterMigrateParams\ \ object initializations here...\n vmCrossClusterMigrateParams.IsLiveMigration\ \ = true; // required field\n vmCrossClusterMigrateParams.TargetAvailabilityZone\ \ = new AvailabilityZoneReference(); // required field\n\n String\ \ extId = \"Aaa4Cb7E-DBbd-06CD-82Cd-Cfba90Afc8d9\";\n boolean dryrun\ \ = true;\n\n /*\n Some Create, Update, and Delete operations\ \ generally require an If-Match header with a value to be passed in order\ \ to protect against concurrent updates.\n The value that needs to\ \ be sent in the If-Match header needs to be retrieved by performing a Read(Get)\ \ operation on the same resource.\n ETags can be retrieved by calling\ \ a static method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new CrossClusterMigrateVmRequest\ \ {\n ExtId = extId,\n Body = vmCrossClusterMigrateParams,\n\ \ Dryrun = dryrun,\n \n \n };\n\ \ try {\n CrossClusterMigrateVmApiResponse crossClusterMigrateVmApiResponse\ \ = vmApi.CrossClusterMigrateVm(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-to-host: post: tags: - Vm summary: Host to host VM migration description: Migrate a VM to another host within the same cluster. operationId: migrateVmToHost parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 253569b8-d0ba-474a-92c0-ba904bbeab3c - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 54c0ca2a-d8ba-45a3-9807-9a94afc569cb requestBody: description: The request body for migrating a VM from one host to another within a cluster. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmMigrateToHostParams' required: true responses: "202": description: The request to migrate a VM to another host within the cluster is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-to-host\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-to-host\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-to-host\ \ Post operation" x-permissions: operationName: Migrate Virtual Machine To Host deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.MigrateVmToHostRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.HostReference;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.VmMigrateToHostParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.MigrateVmToHostApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n VmMigrateToHostParams\ \ vmMigrateToHostParams = new VmMigrateToHostParams();\n\n // VmMigrateToHostParams\ \ object initializations here...\n vmMigrateToHostParams.setHost(new\ \ AhvConfigHostReference()); // required field\n \n String\ \ extId = \"42AcCcdc-79BF-b8EF-d7a6-FEd2F1BFFCFE\";\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header\ \ needs to be retrieved by performing a Read(Get) operation on the same\ \ resource.\n ETags can be retrieved by calling a static method of\ \ ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ MigrateVmToHostApiResponse migrateVmToHostApiResponse = vmApi.migrateVmToHost(MigrateVmToHostRequest.builder()\n\ \ .extId(extId)\n .build(), vmMigrateToHostParams,\ \ opts);\n\n System.out.println(migrateVmToHostApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, HostReference, VmMigrateToHostParams\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ vmMigrateToHostParams = new VmMigrateToHostParams();\n\n // VmMigrateToHostParams\ \ object initializations here...\n vmMigrateToHostParams.setHost(new\ \ AhvConfigHostReference()); // required field\n vmMigrateToHostParams\ \ = JSON.stringify(vmMigrateToHostParams);\n\n \n let extId = \"aC53756A-eD5c-bbBc-DBa3-Ff3eBB210c76\"\ ;\n\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.migrateVmToHost(extId,\ \ vmMigrateToHostParams, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n vmMigrateToHostParams\ \ = ntnx_vmm_py_client.VmMigrateToHostParams()\n\n # VmMigrateToHostParams\ \ object initializations here...\n vmMigrateToHostParams.host = ntnx_vmm_py_client.AhvConfigHostReference()\ \ # required field\n \n ext_id = \"563C2ccd-c8df-DBAe-bBBf-dB1bd9E69ea0\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.migrate_vm_to_host(extId=ext_id,\ \ body=vmMigrateToHostParams, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n vmMigrateToHostParams := import1.NewVmMigrateToHostParams()\n\ \n // VmMigrateToHostParams object initializations here...\n\n \n\ \ extId := \"DE84Ab9F-0Dd2-fCa7-c3b1-DfDa3AA7a86a\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.MigrateVmToHostRequest{ ExtId: &extId, Body: vmMigrateToHostParams\ \ }\n response, error := VmServiceApiInstance.MigrateVmToHost(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/2197B4c2-FDcB-DFEb-978e-1ae1b3fa0Fb0/$actions/migrate-to-host" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"$objectType":"vmm.v4.ahv.config.VmMigrateToHostParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"$objectType":"vmm.v4.ahv.config.VmMigrateToHostParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/DAf6cbfF-4ecA-b1c3-e806-9fBbcfe5D7BE/$actions/migrate-to-host" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n VmMigrateToHostParams vmMigrateToHostParams =\ \ new VmMigrateToHostParams();\n\n // VmMigrateToHostParams object\ \ initializations here...\n vmMigrateToHostParams.Host = new AhvConfigHostReference();\ \ // required field\n\n String extId = \"eA69AA1d-b226-eFBF-ACAE-a1DdBCfEcaD8\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new MigrateVmToHostRequest\ \ {\n ExtId = extId,\n Body = vmMigrateToHostParams,\n\ \ \n \n };\n try {\n MigrateVmToHostApiResponse\ \ migrateVmToHostApiResponse = vmApi.MigrateVmToHost(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/generate-console-token: post: tags: - Vm summary: Generate VM console token description: Generates a token to launch a VM console. operationId: generateConsoleTokenById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 0712b6cb-79de-41a6-910f-cf4ea62b1bd0 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 1f3ee0fe-4073-46ac-beca-0661207f36a0 responses: "202": description: The request to generate a VM console token is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/generate-console-token\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/generate-console-token\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/generate-console-token\ \ Post operation" x-permissions: operationName: Generate VM Console Token deploymentList: - ON_PREM - CLOUD roleList: - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - name: Super Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 10 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GenerateConsoleTokenByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GenerateConsoleTokenApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"E2EB3eBe-ebbA-BfAd-dEfc-EB9A0Dc88Ac2\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GenerateConsoleTokenApiResponse generateConsoleTokenApiResponse\ \ = vmApi.generateConsoleTokenById(GenerateConsoleTokenByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(generateConsoleTokenApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"Bd87Da2B-dB04-Fbc4-DdfC-BcE8aFFDeDeA\";\n\n\n\n\n\n\ \ vmApi.generateConsoleTokenById(extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"bEDbD3cC-f2d0-D5d9-dCBc-c9af0DA4bd36\"\ \n\n\n try:\n api_response = vm_api.generate_console_token_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"50fb3519-C9c3-Edc1-16E3-d0dF7CFDC4Af\"\ \n\n\n request := vm.GenerateConsoleTokenByIdRequest{ ExtId: &extId }\n\ \ response, error := VmServiceApiInstance.GenerateConsoleTokenById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/A6aBA8e6-7Cac-ADdf-4B1b-D0EAdbDfc87e/$actions/generate-console-token" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/FfADcE2a-a6cd-D9Bc-E5C5-e24ddcbA55cD/$actions/generate-console-token" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"c4897E8a-B5f9-3CEc-2c8E-bb6DdcFbdFAd\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GenerateConsoleTokenByIdRequest {\n ExtId = extId\n \ \ };\n try {\n GenerateConsoleTokenApiResponse generateConsoleTokenApiResponse\ \ = vmApi.GenerateConsoleTokenById(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/add-custom-attributes: post: tags: - Vm summary: Add to the VM's custom attributes description: Adds to the custom attributes of the VM. operationId: addVmCustomAttributes parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 7e335d13-9932-41e0-83f8-e6a46a8add33 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: ee8b5ec7-e49e-4616-b958-28b0d8c7f90f requestBody: description: A collection of user-defined key/value pairs as strings in the format 'key:value' representing custom attributes of the VM. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.UpdateCustomAttributesParams' required: true responses: "202": description: The request to add to the custom attributes of a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/add-custom-attributes\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/add-custom-attributes\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/add-custom-attributes\ \ Post operation" x-permissions: operationName: Update Virtual Machine Custom Attributes deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.AddVmCustomAttributesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateCustomAttributesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.AddVmCustomAttributesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n UpdateCustomAttributesParams\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n\ \ updateCustomAttributesParams.setCustomAttributes(new ArrayList<>());\ \ // required field\n \n String extId = \"9b1e636d-6b6D-28f5-DE5d-FA9DcED0e0Cb\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n AddVmCustomAttributesApiResponse\ \ addVmCustomAttributesApiResponse = vmApi.addVmCustomAttributes(AddVmCustomAttributesRequest.builder()\n\ \ .extId(extId)\n .build(), updateCustomAttributesParams);\n\ \n System.out.println(addVmCustomAttributesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, UpdateCustomAttributesParams } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n \ \ updateCustomAttributesParams.setCustomAttributes([]); // required field\n\ \ updateCustomAttributesParams = JSON.stringify(updateCustomAttributesParams);\n\ \n \n let extId = \"52BbCdde-F3cF-CcBB-e5cF-a62F17Cb96fB\";\n\n\n\n\ \n\n vmApi.addVmCustomAttributes(extId, updateCustomAttributesParams).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n updateCustomAttributesParams\ \ = ntnx_vmm_py_client.UpdateCustomAttributesParams()\n\n # UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.custom_attributes\ \ = [] # required field\n \n ext_id = \"fB1Eeb90-78fe-E230-3EDF-90cd2ce1dFad\"\ \n\n\n try:\n api_response = vm_api.add_vm_custom_attributes(extId=ext_id,\ \ body=updateCustomAttributesParams)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n updateCustomAttributesParams := import1.NewUpdateCustomAttributesParams()\n\ \n // UpdateCustomAttributesParams object initializations here...\n\n\ \ \n extId := \"FAa945eF-DbB0-578d-8Df2-4Caaeb7B3CBB\"\n\n\n request\ \ := vm.AddVmCustomAttributesRequest{ ExtId: &extId, Body: updateCustomAttributesParams\ \ }\n response, error := VmServiceApiInstance.AddVmCustomAttributes(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/dFBB8DBF-Cc66-be3d-E7Ab-AFB38f2Eba9D/$actions/add-custom-attributes" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/BCbdFEda-dEfd-7dD8-EFBe-BC1fFfaC5e98/$actions/add-custom-attributes" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n UpdateCustomAttributesParams updateCustomAttributesParams\ \ = new UpdateCustomAttributesParams();\n\n // UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.CustomAttributes\ \ = new ArrayList(); // required field\n\n String extId = \"a42E4620-8a8A-d0Fd-D4b0-eEEfbDBBFb4d\"\ ;\n\n // Create request object with parameters\n var request\ \ = new AddVmCustomAttributesRequest {\n ExtId = extId,\n \ \ Body = updateCustomAttributesParams\n };\n try {\n\ \ AddVmCustomAttributesApiResponse addVmCustomAttributesApiResponse\ \ = vmApi.AddVmCustomAttributes(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/remove-custom-attributes: post: tags: - Vm summary: Remove from the VM's custom attributes description: Removes from the custom attributes of the VM. operationId: removeVmCustomAttributes parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 26214aee-d88b-488d-91e5-d693910f5eb5 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: a539e56c-e14e-4376-abf8-b3068f7a08f3 requestBody: description: A collection of user-defined key/value pairs as strings in the format 'key:value' representing custom attributes of the VM. content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.UpdateCustomAttributesParams' required: true responses: "202": description: The request to remove from the custom attributes of a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/remove-custom-attributes\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/remove-custom-attributes\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/remove-custom-attributes\ \ Post operation" x-permissions: operationName: Update Virtual Machine Custom Attributes deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.RemoveVmCustomAttributesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateCustomAttributesParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.RemoveVmCustomAttributesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n UpdateCustomAttributesParams\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n\ \ updateCustomAttributesParams.setCustomAttributes(new ArrayList<>());\ \ // required field\n \n String extId = \"d7a7dac7-c2cc-4C44-6E87-FBEFcFad0A1A\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n RemoveVmCustomAttributesApiResponse\ \ removeVmCustomAttributesApiResponse = vmApi.removeVmCustomAttributes(RemoveVmCustomAttributesRequest.builder()\n\ \ .extId(extId)\n .build(), updateCustomAttributesParams);\n\ \n System.out.println(removeVmCustomAttributesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, UpdateCustomAttributesParams } from\ \ \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet apiClientInstance\ \ = new ApiClient();\n// IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host\ \ = 'localhost';\n// Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\napiClientInstance.port = '9440';\n\ // Max retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ updateCustomAttributesParams = new UpdateCustomAttributesParams();\n\n\ \ // UpdateCustomAttributesParams object initializations here...\n \ \ updateCustomAttributesParams.setCustomAttributes([]); // required field\n\ \ updateCustomAttributesParams = JSON.stringify(updateCustomAttributesParams);\n\ \n \n let extId = \"E8BC0ecA-Eb0e-edcB-fDed-F7dCf62B9eaC\";\n\n\n\n\ \n\n vmApi.removeVmCustomAttributes(extId, updateCustomAttributesParams).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n updateCustomAttributesParams\ \ = ntnx_vmm_py_client.UpdateCustomAttributesParams()\n\n # UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.custom_attributes\ \ = [] # required field\n \n ext_id = \"Ebfb54DA-802f-5DEB-5aFC-5aE3fa1772b2\"\ \n\n\n try:\n api_response = vm_api.remove_vm_custom_attributes(extId=ext_id,\ \ body=updateCustomAttributesParams)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n updateCustomAttributesParams := import1.NewUpdateCustomAttributesParams()\n\ \n // UpdateCustomAttributesParams object initializations here...\n\n\ \ \n extId := \"072AD9Be-e8eB-F1ae-aFda-F5FbEAfe4A43\"\n\n\n request\ \ := vm.RemoveVmCustomAttributesRequest{ ExtId: &extId, Body: updateCustomAttributesParams\ \ }\n response, error := VmServiceApiInstance.RemoveVmCustomAttributes(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/DBfF3968-3CbB-CEe0-eBAF-fCacA4bDAcDE/$actions/remove-custom-attributes" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.UpdateCustomAttributesParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/C2C2aC6d-BdA0-ab4E-0dBa-dac5FF6CbFAb/$actions/remove-custom-attributes" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n UpdateCustomAttributesParams updateCustomAttributesParams\ \ = new UpdateCustomAttributesParams();\n\n // UpdateCustomAttributesParams\ \ object initializations here...\n updateCustomAttributesParams.CustomAttributes\ \ = new ArrayList(); // required field\n\n String extId = \"446Db4b6-FBAb-53BC-ddb2-feEDF6ddedA7\"\ ;\n\n // Create request object with parameters\n var request\ \ = new RemoveVmCustomAttributesRequest {\n ExtId = extId,\n\ \ Body = updateCustomAttributesParams\n };\n try\ \ {\n RemoveVmCustomAttributesApiResponse removeVmCustomAttributesApiResponse\ \ = vmApi.RemoveVmCustomAttributes(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}: get: tags: - Vm summary: Get configuration details for the provided GPU device description: Retrieves configuration details for the provided GPU device attached to a virtual machine. operationId: getGpuById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: cd2977c2-20e7-46a3-93a5-f95a8da4ffff - name: extId in: path description: A globally unique identifier of a VM GPU of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 931376c9-aded-4475-a8b1-7d9ff5c56935 responses: "200": description: Returns the configuration details for the provided GPU device attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Gpu' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine GPU deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetGpuByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetGpuApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"fd6AAA12-cddC-aaab-FC97-2F28DbBFE83a\";\n \n String\ \ extId = \"C517ba3D-95fE-73bB-1D9C-AACAcAecb2cB\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetGpuApiResponse getGpuApiResponse =\ \ vmApi.getGpuById(GetGpuByIdRequest.builder()\n .vmExtId(vmExtId)\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getGpuApiResponse.toString());\n\n } catch\ \ (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"3Ee6BC6E-EBDE-0F03-aac7-09Ad7A4bdde5\";\n \n\ \ let extId = \"f18faAAf-FcFB-e730-B4DA-aDeCeCDc35Eb\";\n\n\n\n\n\n \ \ vmApi.getGpuById(vmExtId, extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ caDb61ce-BbD7-dEDB-22Dc-8fbeFacbaeDa\"\n \n ext_id = \"eFDFcBDB-8ca0-121C-bcF8-1d6eCCF661ed\"\ \n\n\n try:\n api_response = vm_api.get_gpu_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"E9FAdF72-FCEb-CFEf-FfeA-ba7f3ecEeeec\"\ \n \n extId := \"fBe072F8-7a5d-0eCd-DfCD-4A3df0b43c09\"\n\n\n request\ \ := vm.GetGpuByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.GetGpuById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.Gpu)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/fbd7fB9a-5CFB-4aaa-B7D4-91cd567e54Bb/gpus/DCbEba1a-1AFC-AA47-cCD4-e9fAAADdcbf3" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/BeF88FbA-E4aF-756F-7CA1-4D3ccF1F5C3e/gpus/Ad0cAEdF-7daA-9A8e-dBBc-Fcbb5a131706" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"B4cFcD64-a4bF-7FDf-cdBD-C961C3C62Ee2\"\ ;\n String extId = \"07Cbc7ca-4CF4-dbBd-f9c3-efdaBfdfebF9\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetGpuByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n GetGpuApiResponse getGpuApiResponse\ \ = vmApi.GetGpuById(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" delete: tags: - Vm summary: Remove a GPU device from a VM description: Removes the specified GPU device from a virtual machine operationId: deleteGpuById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: db0cede0-2352-497f-97d4-7c06260ddbb2 - name: extId in: path description: A globally unique identifier of a VM GPU of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5c554b8d-034c-453d-8978-ab65407f995a - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 1e99af4d-1afe-428a-b9d8-e55e265e1119 responses: "202": description: The request to remove a GPU device from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Delete operation" x-permissions: operationName: Delete Virtual Machine GPU deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeleteGpuByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteGpuApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"7BFaadbD-b9e3-E5cb-60be-AfAC705a5aFC\";\n \n String\ \ extId = \"3cC3fcAc-5aaC-638d-DbbF-3dDBfe8AEceF\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteGpuApiResponse deleteGpuApiResponse\ \ = vmApi.deleteGpuById(DeleteGpuByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n .build());\n\ \n System.out.println(deleteGpuApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"bACDca5c-4DFb-C5E7-fa9a-eD6E7073f7eD\";\n \n\ \ let extId = \"B9c50669-FbCB-8955-EBD7-1e8DBBEc2a5B\";\n\n\n\n\n\n \ \ vmApi.deleteGpuById(vmExtId, extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ ECAAd6e8-Ed4D-A1Ab-7E5c-DB7E7A67f27d\"\n \n ext_id = \"4CFb74B3-07fC-7737-2f3D-a3eFa9ad874b\"\ \n\n\n try:\n api_response = vm_api.delete_gpu_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"dbAC0dEB-DC2a-59A6-Eb4C-b2c9afd76703\"\ \n \n extId := \"4dEbAc32-ecc7-F2F8-eb79-9a9fbC965EB5\"\n\n\n request\ \ := vm.DeleteGpuByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.DeleteGpuById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/AF6F56Ca-EaC0-e9cb-dE23-aa55aFDfdBc4/gpus/dc7aFb7D-D4d9-EDEd-eaf7-dB0AaBaDcFcE" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/aEfFd9Ff-e6D5-34DB-21FF-d7DE450Caa2B/gpus/2cB9eAbe-8Ffc-BeEA-09ed-b958c9bbb2bC" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"BDcF93c5-BC6a-DeDD-B5eC-E9B8Bbc9CBDc\"\ ;\n String extId = \"6Ab159F5-dB73-FcdF-FaED-DabF23Eac1be\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteGpuByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n DeleteGpuApiResponse deleteGpuApiResponse\ \ = vmApi.DeleteGpuById(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus: get: tags: - Vm summary: List GPUs attached to a VM description: Lists the GPU devices attached to a virtual machine operationId: listGpusByVmId parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ff145317-8d86-4e41-923f-97bbc9662527 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: mode example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms/{vmExtId}/gpus?$filter=mode\ \ eq Vmm.Ahv.Config.GpuMode'PASSTHROUGH_GRAPHICS'" - name: vendor example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms/{vmExtId}/gpus?$filter=vendor\ \ eq Vmm.Ahv.Config.GpuVendor'NVIDIA'" responses: "200": description: Returns the list of GPU devices attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Gpu' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Get operation" x-permissions: operationName: View Virtual Machine GPU deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListGpusByVmIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListGpusApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"a7AC22Ad-7Dbc-EAF7-13FF-cd36BedAeBAc\";\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListGpusApiResponse listGpusApiResponse =\ \ vmApi.listGpusByVmId(ListGpusByVmIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .$page(page)\n .$limit(limit)\n\ \ .$filter(null)\n .build());\n\n \ \ System.out.println(listGpusApiResponse.toString());\n\n } catch\ \ (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"E2c782cD-07F2-AdBB-00EF-3c0BbdcDa52C\";\n\n //\ \ Construct Optional Parameters\n var opts = {};\n opts[\"$page\"\ ] = 0;\n opts[\"$limit\"] = 50;\n opts[\"$filter\"] = \"string_sample_data\"\ ;\n\n\n\n\n vmApi.listGpusByVmId(vmExtId, opts).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ E9EFfC9D-FFae-60D1-C97E-F442D2f9FB91\"\n \n page = 0\n \n limit\ \ = 50\n\n\n try:\n api_response = vm_api.list_gpus_by_vm_id(vmExtId=vm_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"3FEc3Bb0-4f7d-76d7-DAdA-db5ef1EBCEac\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := vm.ListGpusByVmIdRequest{\ \ VmExtId: &vmExtId, Page_: &page_, Limit_: &limit_, Filter_: nil }\n \ \ response, error := VmServiceApiInstance.ListGpusByVmId(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().([]import1.Gpu)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/dA1Fa47E-5e32-Dcb0-6CbC-CceCFcEa2e5f/gpus?$filter=string_sample_data&$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/c6AbffCb-088e-9Ed3-1eDe-DAAfc36e266c/gpus?$filter=string_sample_data&$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"AdED69ae-fFec-5c1c-dCa4-bCdEDbfDf188\"\ ;\n int page = 0;\n int limit = 50;\n String filter = \"\ string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListGpusByVmIdRequest {\n VmExtId\ \ = vmExtId,\n Page = page,\n Limit = limit,\n \ \ Filter = filter\n };\n try {\n ListGpusApiResponse\ \ listGpusApiResponse = vmApi.ListGpusByVmId(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - Vm summary: Attach a GPU device to a VM description: Attaches a GPU device to a virtual machine operationId: createGpu parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d95aa020-c441-482d-b20b-ea6ec8662531 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: bed9cd95-92ce-48b8-9cda-1a9f0ef1e967 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Gpu' required: true responses: "202": description: The request to attach a GPU device to a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Post operation" x-permissions: operationName: Create Virtual Machine GPU deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreateGpuRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.Gpu;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateGpuApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n Gpu gpu = Gpu.UNKNOWN;\n\ \n // Gpu object initializations here...\n \n String\ \ vmExtId = \"A675eeEb-E7aE-a8CB-5eDd-dD8cF9dC7Daf\";\n\n try {\n\ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n CreateGpuApiResponse createGpuApiResponse\ \ = vmApi.createGpu(CreateGpuRequest.builder()\n .vmExtId(vmExtId)\n\ \ .build(), gpu);\n\n System.out.println(createGpuApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, Gpu } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ gpu = Gpu.UNKNOWN;\n\n // Gpu object initializations here...\n gpu\ \ = JSON.stringify(gpu);\n\n \n let vmExtId = \"0C1cc5DA-eefc-B8cF-13BE-b02acD1c8bFa\"\ ;\n\n\n\n\n\n vmApi.createGpu(vmExtId, gpu).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n gpu = ntnx_vmm_py_client.Gpu._UNKNOWN\n\ \n # Gpu object initializations here...\n \n vm_ext_id = \"E1dC8dFd-Fb4A-a3a9-4cdC-9a9bd27d7f76\"\ \n\n\n try:\n api_response = vm_api.create_gpu(vmExtId=vm_ext_id,\ \ body=gpu)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n gpu := import1.NewGpu()\n\n // Gpu\ \ object initializations here...\n\n \n vmExtId := \"CFEaB2Fb-5Fda-eFa2-9C3b-F0A68ACaAf3a\"\ \n\n\n request := vm.CreateGpuRequest{ VmExtId: &vmExtId, Body: gpu }\n\ \ response, error := VmServiceApiInstance.CreateGpu(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/7ECFeDCa-1aED-DD4e-D81e-ffBC7B57DBDc/gpus" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/a91eB5F0-c9FB-32Ab-913A-09BD6Aa7aFa5/gpus" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n Gpu gpu = Gpu.UNKNOWN;\n\n // Gpu object\ \ initializations here...\n\n String vmExtId = \"8ec0153e-11D1-Bbb2-c0FB-3Ec3f2C5Ac4a\"\ ;\n\n // Create request object with parameters\n var request\ \ = new CreateGpuRequest {\n VmExtId = vmExtId,\n \ \ Body = gpu\n };\n try {\n CreateGpuApiResponse\ \ createGpuApiResponse = vmApi.CreateGpu(request);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/guest-tools: get: tags: - Vm summary: Get VM NGT configuration description: Retrieves the Nutanix Guest Tools configuration for a virtual machine. operationId: getGuestToolsById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 32603098-8c8d-4217-977a-e64501e425d2 responses: "200": description: Returns the Nutanix Guest Tools configuration for a virtual machine. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestTools' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Get operation" x-permissions: operationName: View Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetGuestToolsByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"bcA0B4A0-07be-5fdD-BeE4-66feaCa2DaAe\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetGuestToolsApiResponse getGuestToolsApiResponse\ \ = vmApi.getGuestToolsById(GetGuestToolsByIdRequest.builder()\n \ \ .extId(extId)\n .build());\n\n System.out.println(getGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"DE7ADe9E-7cbf-69C9-9C4C-58F2f0aba4eF\";\n\n\n\n\n\n\ \ vmApi.getGuestToolsById(extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"1cfBA3B0-ACE0-cD6d-02e6-36151FB4efA3\"\ \n\n\n try:\n api_response = vm_api.get_guest_tools_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"21F4e17F-edfa-ef36-e0bD-14d7D09BE1eA\"\ \n\n\n request := vm.GetGuestToolsByIdRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.GetGuestToolsById(ctx, &request)\n if\ \ error != nil {\n fmt.Println(error)\n return\n }\n \ \ data, _ := response.GetData().(import1.GuestTools)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/DCa4e9bA-aBaC-2Ad1-bc7B-DFd7BeB5Ecbb/guest-tools" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/BacFaAAC-8EDe-E9bA-54e0-EaCaDe63DBBC/guest-tools" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"cCEec636-CBB0-4f76-fde9-f1Cae52FE7fC\"\ ;\n\n // Create request object with parameters\n var request\ \ = new GetGuestToolsByIdRequest {\n ExtId = extId\n };\n\ \ try {\n GetGuestToolsApiResponse getGuestToolsApiResponse\ \ = vmApi.GetGuestToolsById(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" put: tags: - Vm summary: Update NGT configuration for a VM description: Updates the Nutanix Guest Tools configuration for a virtual machine. operationId: updateGuestToolsById parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d90fc535-df51-43ea-a14a-708eb8a191fd - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 245f53e6-0c08-40b7-88a3-89670d1889f9 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestTools' required: true responses: "202": description: The request to update NGT configuration for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Put operation" x-permissions: operationName: Update Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UpdateGuestToolsByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestTools;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestTools guestTools\ \ = new GuestTools();\n\n // GuestTools object initializations here...\n\ \ \n String extId = \"AD9cFF9e-aead-16Af-654A-5a61aaFBBE4a\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ UpdateGuestToolsApiResponse updateGuestToolsApiResponse = vmApi.updateGuestToolsById(UpdateGuestToolsByIdRequest.builder()\n\ \ .extId(extId)\n .build(), guestTools, opts);\n\ \n System.out.println(updateGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestTools } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestTools = new GuestTools();\n\n // GuestTools object initializations\ \ here...\n guestTools = JSON.stringify(guestTools);\n\n \n let\ \ extId = \"5744deB1-d3F9-afac-4428-BFd26a15Bdd1\";\n\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.updateGuestToolsById(extId, guestTools,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestTools = ntnx_vmm_py_client.GuestTools()\n\ \n # GuestTools object initializations here...\n \n ext_id = \"\ CD6cDaF6-D2fb-70e2-91CC-eDeAb51FbAbe\"\n\n \"\"\"\n Some Create, Update,\ \ and Delete operations generally require an If-Match header with a value\ \ to be passed in order to protect against concurrent updates.\n The\ \ value that needs to be sent in the If-Match header needs to be retrieved\ \ by performing a Read(Get) operation on the same resource.\n ETags can\ \ be retrieved by calling a static method of ApiClient as below:\n etag_value\ \ = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n try:\n \ \ api_response = vm_api.update_guest_tools_by_id(extId=ext_id, body=guestTools,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestTools := import1.NewGuestTools()\n\ \n // GuestTools object initializations here...\n\n \n extId :=\ \ \"F4883d99-Edaa-aaeA-d9ba-1C74D9FFBBeA\"\n\n /*\n Some Create, Update,\ \ and Delete operations generally require an If-Match header with a value\ \ to be passed in order to protect against concurrent updates.\n The\ \ value that needs to be sent in the If-Match header needs to be retrieved\ \ by performing a Read(Get) operation on the same resource.\n ETags can\ \ be retrieved by calling a static method of ApiClient as below:\n etagValue\ \ := ApiClientInstance.GetEtag(getResponse)\n */\n\n request := vm.UpdateGuestToolsByIdRequest{\ \ ExtId: &extId, Body: guestTools }\n response, error := VmServiceApiInstance.UpdateGuestToolsById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/87Cd1fdf-eB1c-Cdd8-FaDA-c2D8f0fE9297/guest-tools" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/a7eFfccf-C688-E1Fa-5f2e-0daAac9fFFbF/guest-tools" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestTools guestTools = new GuestTools();\n\n\ \ // GuestTools object initializations here...\n\n String extId\ \ = \"3BF2D1Ec-EDf0-EaE2-eA45-EcC5CAaFd5Ca\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.GetEtag(getResponse);\n \ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new UpdateGuestToolsByIdRequest\ \ {\n ExtId = extId,\n Body = guestTools,\n \ \ \n \n };\n try {\n UpdateGuestToolsApiResponse\ \ updateGuestToolsApiResponse = vmApi.UpdateGuestToolsById(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/install: post: tags: - Vm summary: Install NGT in a VM description: Installs Nutanix Guest Tools in a Virtual Machine by using the provided credentials. operationId: installVmGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: bcd854e2-ba14-4f08-a802-234e0409b899 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f55bedb4-2ce2-4c7a-8ae7-5af9eecbf4c0 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestToolsInstallConfig' required: true responses: "202": description: The request to install NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/install\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/install\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/install\ \ Post operation" x-permissions: operationName: Install Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.InstallVmGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestToolsInstallConfig;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.InstallVmGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestToolsInstallConfig\ \ guestToolsInstallConfig = new GuestToolsInstallConfig();\n\n //\ \ GuestToolsInstallConfig object initializations here...\n \n \ \ String extId = \"8CdF5bc0-Eaef-F9bE-cA1a-aDCfFe1ECdD7\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ InstallVmGuestToolsApiResponse installVmGuestToolsApiResponse = vmApi.installVmGuestTools(InstallVmGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), guestToolsInstallConfig,\ \ opts);\n\n System.out.println(installVmGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestToolsInstallConfig } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestToolsInstallConfig = new GuestToolsInstallConfig();\n\n // GuestToolsInstallConfig\ \ object initializations here...\n guestToolsInstallConfig = JSON.stringify(guestToolsInstallConfig);\n\ \n \n let extId = \"39d5DB2E-eCF7-CEFD-F9E1-6020bB3AfE57\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.installVmGuestTools(extId,\ \ guestToolsInstallConfig, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestToolsInstallConfig\ \ = ntnx_vmm_py_client.GuestToolsInstallConfig()\n\n # GuestToolsInstallConfig\ \ object initializations here...\n \n ext_id = \"E582A9bA-ABDC-aB0E-bBDF-FDfAffDd9dCF\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.install_vm_guest_tools(extId=ext_id,\ \ body=guestToolsInstallConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestToolsInstallConfig := import1.NewGuestToolsInstallConfig()\n\ \n // GuestToolsInstallConfig object initializations here...\n\n \n\ \ extId := \"Bb183fE6-DDaC-B4E9-4adb-DcbccAD0EF56\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.InstallVmGuestToolsRequest{ ExtId: &extId, Body: guestToolsInstallConfig\ \ }\n response, error := VmServiceApiInstance.InstallVmGuestTools(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Cf9bfe92-240A-cbA3-fac3-1EFabfdE1ABF/guest-tools/$actions/install" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"capabilities":["$UNKNOWN"],"credential":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.ahv.config.Credential"},"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.ahv.config.RebootPreferenceSchedule"},"$objectType":"vmm.v4.ahv.config.RebootPreference"},"$objectType":"vmm.v4.ahv.config.GuestToolsInstallConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"capabilities":["$UNKNOWN"],"credential":{"username":"test_user","password":"test_password","$objectType":"vmm.v4.ahv.config.Credential"},"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.ahv.config.RebootPreferenceSchedule"},"$objectType":"vmm.v4.ahv.config.RebootPreference"},"$objectType":"vmm.v4.ahv.config.GuestToolsInstallConfig"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/eCdDC6f7-c0c8-FAe0-Cba6-E044fab707F1/guest-tools/$actions/install" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestToolsInstallConfig guestToolsInstallConfig\ \ = new GuestToolsInstallConfig();\n\n // GuestToolsInstallConfig object\ \ initializations here...\n\n String extId = \"9EEAC3cc-9c7e-eF1B-a8CA-9bdeC2Ccd7BE\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new InstallVmGuestToolsRequest\ \ {\n ExtId = extId,\n Body = guestToolsInstallConfig,\n\ \ \n \n };\n try {\n InstallVmGuestToolsApiResponse\ \ installVmGuestToolsApiResponse = vmApi.InstallVmGuestTools(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/upgrade: post: tags: - Vm summary: Upgrade NGT inside a VM description: Trigger an in-guest upgrade of Nutanix Guest Tools. operationId: upgradeVmGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: bb113127-e8e3-4c07-b22d-07a350c5191e - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 8d808d7f-a54d-435e-815b-9e41643a522e requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestToolsUpgradeConfig' required: true responses: "202": description: The request to upgrade NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/upgrade\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/upgrade\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/upgrade\ \ Post operation" x-permissions: operationName: Upgrade Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UpgradeVmGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestToolsUpgradeConfig;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpgradeVmGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestToolsUpgradeConfig\ \ guestToolsUpgradeConfig = new GuestToolsUpgradeConfig();\n\n //\ \ GuestToolsUpgradeConfig object initializations here...\n \n \ \ String extId = \"B8caF0C3-6aAa-5D6A-Cd5b-ddaD2B6dDFD8\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ UpgradeVmGuestToolsApiResponse upgradeVmGuestToolsApiResponse = vmApi.upgradeVmGuestTools(UpgradeVmGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), guestToolsUpgradeConfig,\ \ opts);\n\n System.out.println(upgradeVmGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestToolsUpgradeConfig } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestToolsUpgradeConfig = new GuestToolsUpgradeConfig();\n\n // GuestToolsUpgradeConfig\ \ object initializations here...\n guestToolsUpgradeConfig = JSON.stringify(guestToolsUpgradeConfig);\n\ \n \n let extId = \"BFA88C10-bAda-7caB-CADA-6Ce2Fe737E9E\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.upgradeVmGuestTools(extId,\ \ guestToolsUpgradeConfig, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestToolsUpgradeConfig\ \ = ntnx_vmm_py_client.GuestToolsUpgradeConfig()\n\n # GuestToolsUpgradeConfig\ \ object initializations here...\n \n ext_id = \"Cac3BB0F-BdbC-f345-e50a-FcB1BCc8dF34\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.upgrade_vm_guest_tools(extId=ext_id,\ \ body=guestToolsUpgradeConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestToolsUpgradeConfig := import1.NewGuestToolsUpgradeConfig()\n\ \n // GuestToolsUpgradeConfig object initializations here...\n\n \n\ \ extId := \"DC32bbAf-e7Ad-eaF4-0Bc8-AbDbd4e0F659\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.UpgradeVmGuestToolsRequest{ ExtId: &extId, Body: guestToolsUpgradeConfig\ \ }\n response, error := VmServiceApiInstance.UpgradeVmGuestTools(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/cB2D37fc-25Af-f011-47a9-1CA56DDa7BE7/guest-tools/$actions/upgrade" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.ahv.config.RebootPreferenceSchedule"},"$objectType":"vmm.v4.ahv.config.RebootPreference"},"$objectType":"vmm.v4.ahv.config.GuestToolsUpgradeConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"rebootPreference":{"scheduleType":"$UNKNOWN","schedule":{"startTime":"2015-07-20T15:49:04-07:00","$objectType":"vmm.v4.ahv.config.RebootPreferenceSchedule"},"$objectType":"vmm.v4.ahv.config.RebootPreference"},"$objectType":"vmm.v4.ahv.config.GuestToolsUpgradeConfig"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/0E26f86B-eDfe-389F-BC7a-a6fa4733ACc3/guest-tools/$actions/upgrade" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestToolsUpgradeConfig guestToolsUpgradeConfig\ \ = new GuestToolsUpgradeConfig();\n\n // GuestToolsUpgradeConfig object\ \ initializations here...\n\n String extId = \"F1A8B6BC-25ae-3cEe-DBe8-aecB2E9dCe28\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new UpgradeVmGuestToolsRequest\ \ {\n ExtId = extId,\n Body = guestToolsUpgradeConfig,\n\ \ \n \n };\n try {\n UpgradeVmGuestToolsApiResponse\ \ upgradeVmGuestToolsApiResponse = vmApi.UpgradeVmGuestTools(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/insert-iso: post: tags: - Vm summary: Insert NGT ISO into an available CD-ROM for a VM description: Inserts the Nutanix Guest Tools installation and configuration ISO into a virtual machine. operationId: insertVmGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b01a2d90-4549-4c72-a5fa-78d5e166e008 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 8b85f6c2-0539-4e63-883d-89e96aa798b2 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestToolsInsertConfig' required: true responses: "202": description: The request to insert NGT ISO for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/insert-iso\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/insert-iso\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/insert-iso\ \ Post operation" x-permissions: operationName: Insert Virtual Machine NGT ISO deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.InsertVmGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestToolsInsertConfig;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.InsertVmGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestToolsInsertConfig\ \ guestToolsInsertConfig = new GuestToolsInsertConfig();\n\n // GuestToolsInsertConfig\ \ object initializations here...\n \n String extId = \"fACAeAa1-A1Cc-Aa5C-Fccc-bfbA35d2Fff2\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ InsertVmGuestToolsApiResponse insertVmGuestToolsApiResponse = vmApi.insertVmGuestTools(InsertVmGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), guestToolsInsertConfig,\ \ opts);\n\n System.out.println(insertVmGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestToolsInsertConfig } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestToolsInsertConfig = new GuestToolsInsertConfig();\n\n // GuestToolsInsertConfig\ \ object initializations here...\n guestToolsInsertConfig = JSON.stringify(guestToolsInsertConfig);\n\ \n \n let extId = \"2CebAF7C-04cf-e70C-6EAC-1Ffa780E1bD8\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.insertVmGuestTools(extId,\ \ guestToolsInsertConfig, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestToolsInsertConfig\ \ = ntnx_vmm_py_client.GuestToolsInsertConfig()\n\n # GuestToolsInsertConfig\ \ object initializations here...\n \n ext_id = \"fEfe4BDD-c61A-aea6-fA6c-bADbEBfc9Aff\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.insert_vm_guest_tools(extId=ext_id,\ \ body=guestToolsInsertConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestToolsInsertConfig := import1.NewGuestToolsInsertConfig()\n\ \n // GuestToolsInsertConfig object initializations here...\n\n \n\ \ extId := \"cB71fDad-0bEE-cDF4-04cB-E03CCE61eccA\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.InsertVmGuestToolsRequest{ ExtId: &extId, Body: guestToolsInsertConfig\ \ }\n response, error := VmServiceApiInstance.InsertVmGuestTools(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/F481daeC-F3A9-e7F3-9add-FbCfaf6E2fEf/guest-tools/$actions/insert-iso" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"capabilities":["$UNKNOWN"],"isConfigOnly":true,"$objectType":"vmm.v4.ahv.config.GuestToolsInsertConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"capabilities":["$UNKNOWN"],"isConfigOnly":true,"$objectType":"vmm.v4.ahv.config.GuestToolsInsertConfig"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/952AdE79-2B51-97fD-62F4-28FdecD6baaF/guest-tools/$actions/insert-iso" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestToolsInsertConfig guestToolsInsertConfig\ \ = new GuestToolsInsertConfig();\n\n // GuestToolsInsertConfig object\ \ initializations here...\n\n String extId = \"c8d8c0e5-5Fb9-baFf-e456-0e5a9aFeDfc3\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new InsertVmGuestToolsRequest\ \ {\n ExtId = extId,\n Body = guestToolsInsertConfig,\n\ \ \n \n };\n try {\n InsertVmGuestToolsApiResponse\ \ insertVmGuestToolsApiResponse = vmApi.InsertVmGuestTools(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/uninstall: post: tags: - Vm summary: Uninstall NGT from a VM description: Trigger an in-guest uninstallation of Nutanix Guest Tools. operationId: uninstallVmGuestTools parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 130de133-b3fd-4cd3-a768-2d60ec561b25 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 7e61e06c-b807-429e-b665-b38ad72e6f62 responses: "202": description: The request to uninstall NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/uninstall\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/uninstall\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/uninstall\ \ Post operation" x-permissions: operationName: Uninstall Virtual Machine NGT deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UninstallVmGuestToolsRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.UninstallVmGuestToolsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"03AE4Ab6-b2f4-De43-C2f7-F2504EC19AB6\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ UninstallVmGuestToolsApiResponse uninstallVmGuestToolsApiResponse = vmApi.uninstallVmGuestTools(UninstallVmGuestToolsRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(uninstallVmGuestToolsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"5E7B0D3C-0be1-dD34-DEE4-8aC8acAFaE6B\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.uninstallVmGuestTools(extId, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"c2FBF5Ae-e85e-84EA-c1Eb-9DE87d61dBaB\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.uninstall_vm_guest_tools(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"5BdCEad0-Ba3c-C68E-60BC-8A5CDe6fAEFb\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.UninstallVmGuestToolsRequest{ ExtId: &extId\ \ }\n response, error := VmServiceApiInstance.UninstallVmGuestTools(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/AaD5d24B-c1AD-abED-C8C2-f9FcaaeACe4D/guest-tools/$actions/uninstall" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/fd1fDFeb-AaDC-DcdC-cD99-FEEB6fAb2Eec/guest-tools/$actions/uninstall" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"E28dbaB9-bAae-Ff42-7caF-AaAEb2aBBCC3\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new UninstallVmGuestToolsRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n UninstallVmGuestToolsApiResponse uninstallVmGuestToolsApiResponse\ \ = vmApi.UninstallVmGuestTools(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}: get: tags: - Vm summary: Get configuration details for the provided network device description: Retrieves configuration details for the provided network device attached to a virtual machine. operationId: getNicById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 3cbc357a-ecca-4bb0-8d49-a400d091191f - name: extId in: path description: A globally unique identifier of a VM NIC of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: eb77851a-67cb-43c2-af0a-709b5f82f1e2 responses: "200": description: Returns the configuration details for the provided network device attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine NIC deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin - name: Flow Admin - name: Flow Viewer - name: Flow Policy Author - name: NCM Connector x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetNicByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetNicApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"A0CAfAa8-F30e-dBF6-f66c-d0c8D1DbDDfA\";\n \n String\ \ extId = \"d88EddB4-7986-EBf2-dde4-Cbeef4cb8Bd0\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetNicApiResponse getNicApiResponse =\ \ vmApi.getNicById(GetNicByIdRequest.builder()\n .vmExtId(vmExtId)\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getNicApiResponse.toString());\n\n } catch\ \ (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"2Ffb9f6d-aa2F-15Eb-019B-aecDCb8FAcbB\";\n \n\ \ let extId = \"ED6d7DBe-62f0-EFC9-be7d-9FF0185BBaE0\";\n\n\n\n\n\n \ \ vmApi.getNicById(vmExtId, extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ 4610dbc1-4cD5-E3C8-A5Fa-aAFa5dd4F3c9\"\n \n ext_id = \"C644CFE6-FD2d-beCA-FedC-BbAA0ad1a3Db\"\ \n\n\n try:\n api_response = vm_api.get_nic_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"93cadA5E-D43c-d8Ec-FDce-BC4fF856d8D7\"\ \n \n extId := \"1EC7cB6A-d80c-A0df-ECE3-DAB1b6dAda9a\"\n\n\n request\ \ := vm.GetNicByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.GetNicById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.Nic)\n fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Bad7E9aC-fEa9-CdCD-fEed-8Cbf95BF7dEc/nics/Cc0fa8bC-BDFf-dbd5-23eE-3EbDC1f5c370" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/1E73cE39-EbC2-66fD-3E83-B3FB99bf7cAE/nics/Bb417FE3-3cb5-edC7-c3C1-cd02AadAbFc8" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"6DcA40f6-f57f-B6c1-FbfC-Ecd6A6bEC9b6\"\ ;\n String extId = \"33D84AC7-1f7d-8DbB-5E9c-3fb7C43CBf6C\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetNicByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n GetNicApiResponse getNicApiResponse\ \ = vmApi.GetNicById(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" put: tags: - Vm summary: Update the configuration for the provided network device description: Updates the configuration details for the provided network device. operationId: updateNicById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: e2fe7c42-52cc-4a15-9797-054781e3b603 - name: extId in: path description: A globally unique identifier of a VM NIC of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: dc4f26a9-8041-46ae-baa0-1e664a64a4e9 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 3283e5c0-fa9e-4646-9af1-f84fdd5d0d75 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' required: true responses: "202": description: The request to update the configuration for the provided network device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Put operation" x-permissions: operationName: Update Virtual Machine NIC deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UpdateNicByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetNicByIdRequest;\nimport\ \ java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.Nic;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetNicApiResponse;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateNicApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigNic ahvConfigNic\ \ = new AhvConfigNic();\n\n // AhvConfigNic object initializations\ \ here...\n \n String vmExtId = \"d1De91b2-8Ab7-82dB-DbAa-D8fB59EEDDFD\"\ ;\n \n String extId = \"cA42Cb6A-Bbdd-bdEf-5D56-04c2dfD791e4\"\ ;\n\n // perform GET call\n GetNicApiResponse getResponse\ \ = null;\n try {\n getResponse = vmApi.getNicById(GetNicByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n } catch(RestClientException ex) {\n \ \ System.out.println(ex.getMessage());\n }\n // Extract\ \ E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateNicApiResponse\ \ updateNicApiResponse = vmApi.updateNicById(UpdateNicByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), ahvConfigNic, opts);\n\n System.out.println(updateNicApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, Nic, GetNicApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigNic = new AhvConfigNic();\n\n // AhvConfigNic object initializations\ \ here...\n ahvConfigNic = JSON.stringify(ahvConfigNic);\n\n \n \ \ let vmExtId = \"EEDae01E-7eab-eAdd-5ac1-BFbFEebF2eDC\";\n \n let\ \ extId = \"F7D46242-27CA-ba1F-24CD-426cA4BfA15e\";\n\n\n // Perform\ \ Get call\n vmApi.getNicById(vmExtId, extId).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ // Extract E-Tag Header\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n\n vmApi.updateNicById(vmExtId,\ \ extId, ahvConfigNic, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigNic = ntnx_vmm_py_client.AhvConfigNic()\n\ \n # AhvConfigNic object initializations here...\n \n vm_ext_id\ \ = \"17D0Dec3-cD95-5CCe-FC3F-0c2eec97d12e\"\n \n ext_id = \"F0c6fAae-eC80-fFBB-f058-a0Eed9EaCfB8\"\ \n\n try:\n api_response = vm_api.get_nic_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n except ntnx_vmm_py_client.rest.ApiException as e:\n\ \ print(e)\n # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_api.update_nic_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, body=ahvConfigNic, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigNic := import1.NewAhvConfigNic()\n\ \n // AhvConfigNic object initializations here...\n\n \n vmExtId\ \ := \"8f6a9Bdb-a73A-ABDc-d9B5-3DA0Ed0c3aFc\"\n \n extId := \"CDeBE6c8-d6BF-3AaE-bC85-fcc1bc0EC6Fc\"\ \n\n getRequest := vm.GetNicByIdRequest{ vmExtId: &vmExtId, extId: &extId\ \ }\n getResponse, err := VmServiceApiInstance.GetNicById(ctx, &getRequest)\n\ \ if err != nil {\n fmt.Println(err)\n return\n }\n\n\ \ // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vm.UpdateNicByIdRequest{ VmExtId: &vmExtId, ExtId: &extId,\ \ Body: ahvConfigNic }\n response, error := VmServiceApiInstance.UpdateNicById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/fBe8EDB3-3FfF-Adb2-cb8c-56dc8bDfFfFe/nics/eB6645eb-08cb-2CaA-bE8a-bdD376CABe0F" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/ecec113b-f5B4-aAB5-6DBb-50fcfc4cdFC8/nics/4D51Ec8F-E543-BFae-9BcD-Dfe8aeafCdAF" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Config;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmApi vmApi = new VmApi(client);\n\n AhvConfigNic ahvConfigNic\ \ = new AhvConfigNic();\n\n // AhvConfigNic object initializations\ \ here...\n\n String vmExtId = \"8cdaFbb4-CCFe-e336-9dF7-bd9bb8968cEE\"\ ;\n String extId = \"eFbCeF4d-4f8E-BADc-EaF4-9C95b3FbC5d3\";\n\n \ \ // perform GET call\n var getRequest = new GetNicByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ };\n var getRequest = new GetNicByIdRequest {\n VmExtId\ \ = vmExtId,\n ExtId = extId\n };\n try {\n \ \ GetNicApiResponse getResponse = vmApi.GetNicById(getRequestgetRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateNicByIdRequest {\n VmExtId = vmExtId,\n\ \ ExtId = extId,\n Body = ahvConfigNic,\n \ \ \n \n };\n try {\n UpdateNicApiResponse\ \ updateNicApiResponse = vmApi.UpdateNicById(request, opts);\n }\ \ catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Vm summary: Remove a network device from a VM description: Removes the specified network device from a virtual machine. operationId: deleteNicById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 944fe998-f22f-43a5-ac68-a30f1e3577dc - name: extId in: path description: A globally unique identifier of a VM NIC of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b2aa67de-9feb-4ba2-85ac-d3722977ab4e - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 0924dc37-0c0c-430e-9f54-09c44bc7abcb responses: "202": description: The request to remove a network device from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Delete operation" x-permissions: operationName: Delete Virtual Machine NIC deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeleteNicByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteNicApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"BBD80B95-08Cf-DeEc-aABd-fFEbFFffF445\";\n \n String\ \ extId = \"8E117f5d-bD8B-4fBB-fEF6-cAcA0439AfcC\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteNicApiResponse deleteNicApiResponse\ \ = vmApi.deleteNicById(DeleteNicByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n .build());\n\ \n System.out.println(deleteNicApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"5acafA79-D1c2-ebaB-CD37-cc4A991FFcAd\";\n \n\ \ let extId = \"aCBFA421-797c-1fF4-0BEA-6d2acE8C4639\";\n\n\n\n\n\n \ \ vmApi.deleteNicById(vmExtId, extId).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ B0C0EFAf-aCD9-FEE8-F774-C3D3DdeAd0B0\"\n \n ext_id = \"cE10Ca4B-BCdA-a1bf-aA3F-9EDfcAb7AD6a\"\ \n\n\n try:\n api_response = vm_api.delete_nic_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"Da72AbcA-0CFa-ddFf-bF8C-ccbB2a254BDe\"\ \n \n extId := \"C4ECEC5d-caDF-B7a2-b8B8-0B7cafbAEA53\"\n\n\n request\ \ := vm.DeleteNicByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.DeleteNicById(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Eb5EC11c-A2aC-2dbB-CCAd-EABdDFfaECce/nics/fc368A8e-a1BA-1fFC-9bDD-ddbdE165af20" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/eb42FdAB-59c8-9BCD-bCdA-AcdDdADDdc32/nics/dC8CfbB2-1a22-e7ad-3c02-c22aF7ae328D" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"FAeafBaB-5Cf5-8AFb-E38c-BFb3Bb3d76aF\"\ ;\n String extId = \"d2F7D2d7-eff1-aE71-9bdB-Ef8eBE2daAFE\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteNicByIdRequest {\n VmExtId = vmExtId,\n ExtId\ \ = extId\n };\n try {\n DeleteNicApiResponse deleteNicApiResponse\ \ = vmApi.DeleteNicById(request);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/nics: get: tags: - Vm summary: List network devices attached to a VM description: Lists the network devices attached to a virtual machine. operationId: listNicsByVmId parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 32e829ca-0045-4155-aacd-2a8a5bacb9b2 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms/{vmExtId}/nics?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: networkInfo/subnet/extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vms/{vmExtId}/nics?$filter=networkInfo/subnet/extId\ \ eq 'c899f9ec-5958-4d10-968f-53353f5ac272'" responses: "200": description: Returns the list of network devices attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Get operation" x-permissions: operationName: View Virtual Machine NIC deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Backup Admin - name: Flow Admin - name: Flow Viewer - name: Flow Policy Author - name: NCM Connector x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListNicsByVmIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListNicsApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"CEAc47b2-27E1-3F0F-17EA-1BDA8A3fdCcA\";\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListNicsApiResponse listNicsApiResponse =\ \ vmApi.listNicsByVmId(ListNicsByVmIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .$page(page)\n .$limit(limit)\n\ \ .$filter(null)\n .build());\n\n \ \ System.out.println(listNicsApiResponse.toString());\n\n } catch\ \ (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"Abce45CD-e0FB-Ca4b-FEe5-abeC1BdeEDaf\";\n\n //\ \ Construct Optional Parameters\n var opts = {};\n opts[\"$page\"\ ] = 0;\n opts[\"$limit\"] = 50;\n opts[\"$filter\"] = \"string_sample_data\"\ ;\n\n\n\n\n vmApi.listNicsByVmId(vmExtId, opts).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ cFA0cA4a-fDAB-CaEa-aEb7-E4b8441F6aEE\"\n \n page = 0\n \n limit\ \ = 50\n\n\n try:\n api_response = vm_api.list_nics_by_vm_id(vmExtId=vm_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"7Ed9DCff-b2a8-fc6c-EfFE-D7F92F7Ae4BA\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := vm.ListNicsByVmIdRequest{\ \ VmExtId: &vmExtId, Page_: &page_, Limit_: &limit_, Filter_: nil }\n \ \ response, error := VmServiceApiInstance.ListNicsByVmId(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().([]import1.Nic)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/94bACA7a-A24e-6bB0-BEe2-DD7DbeFBdFbE/nics?$filter=string_sample_data&$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/16B9f4aF-cFEF-98ef-ddC2-BAAfFBAB6bA6/nics?$filter=string_sample_data&$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"Ebc7bCCD-aFFF-fA2e-CBd4-83EB0DcCfd2b\"\ ;\n int page = 0;\n int limit = 50;\n String filter = \"\ string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListNicsByVmIdRequest {\n VmExtId\ \ = vmExtId,\n Page = page,\n Limit = limit,\n \ \ Filter = filter\n };\n try {\n ListNicsApiResponse\ \ listNicsApiResponse = vmApi.ListNicsByVmId(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - Vm summary: Create a network device for a VM description: Creates and attaches a network device to a virtual machine. operationId: createNic parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 604f0d9b-16c3-4bfa-bc65-169eb7ae0b77 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 81e7e685-8a30-47b5-b0d4-b6d200f193d5 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' required: true responses: "202": description: The request to create a network device for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Post operation" x-permissions: operationName: Create Virtual Machine NIC deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreateNicRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.Nic;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateNicApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigNic ahvConfigNic\ \ = new AhvConfigNic();\n\n // AhvConfigNic object initializations\ \ here...\n \n String vmExtId = \"bbAbdEEF-AdEe-742a-AF47-EAE256cDaefD\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CreateNicApiResponse\ \ createNicApiResponse = vmApi.createNic(CreateNicRequest.builder()\n \ \ .vmExtId(vmExtId)\n .build(), ahvConfigNic);\n\ \n System.out.println(createNicApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, Nic } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigNic = new AhvConfigNic();\n\n // AhvConfigNic object initializations\ \ here...\n ahvConfigNic = JSON.stringify(ahvConfigNic);\n\n \n \ \ let vmExtId = \"5d31fEae-ffF3-1d9a-daD1-09BEbfAcC469\";\n\n\n\n\n\n \ \ vmApi.createNic(vmExtId, ahvConfigNic).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigNic = ntnx_vmm_py_client.AhvConfigNic()\n\ \n # AhvConfigNic object initializations here...\n \n vm_ext_id\ \ = \"8BaeDC2D-eBF2-8ffd-d5db-afaC711FaabE\"\n\n\n try:\n api_response\ \ = vm_api.create_nic(vmExtId=vm_ext_id, body=ahvConfigNic)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigNic := import1.NewAhvConfigNic()\n\ \n // AhvConfigNic object initializations here...\n\n \n vmExtId\ \ := \"Ec2D5eB5-AD7b-A6B0-dBDF-C4BbdDB73AAF\"\n\n\n request := vm.CreateNicRequest{\ \ VmExtId: &vmExtId, Body: ahvConfigNic }\n response, error := VmServiceApiInstance.CreateNic(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/2ba4b31F-D4E6-FbAF-CbEC-Ee5aaCC39Eb3/nics" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/4Bffae77-B0cc-9dBb-5Dec-faECb86EB6BE/nics" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigNic ahvConfigNic = new AhvConfigNic();\n\ \n // AhvConfigNic object initializations here...\n\n String vmExtId\ \ = \"572f8C53-eAb9-56dc-01C5-Ea73Cef7eD0B\";\n\n // Create request\ \ object with parameters\n var request = new CreateNicRequest {\n\ \ VmExtId = vmExtId,\n Body = ahvConfigNic\n \ \ };\n try {\n CreateNicApiResponse createNicApiResponse\ \ = vmApi.CreateNic(request);\n } catch (ApiException ex) {\n \ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/assign-ip: post: tags: - Vm summary: Assign an IP address to the provided network device description: Assigns a specific IP address to a network device attached to a managed network. operationId: assignIpById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2f04c250-505e-427b-8cb4-dc45166e3d62 - name: extId in: path description: A globally unique identifier of a VM NIC of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ae674294-7dbd-472a-b17d-3462a0cc61ca - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 7c523a24-3da9-4119-acc2-7a0a3d273ca8 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.AssignIpParams' required: true responses: "202": description: The request to assign an IP address to the provided network device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/assign-ip\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/assign-ip\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/assign-ip\ \ Post operation" x-permissions: operationName: Assign Virtual Machine NIC IP deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.AssignIpByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.AssignIpParams;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.AssignIpApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AssignIpParams assignIpParams\ \ = new AssignIpParams();\n\n // AssignIpParams object initializations\ \ here...\n \n String vmExtId = \"4dF07FEb-a3e1-E4c7-dbbd-B3bFc6A67eAD\"\ ;\n \n String extId = \"5Bb3cc44-4Cc7-067D-56bD-Aaefd5BEe0Be\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AssignIpApiResponse assignIpApiResponse = vmApi.assignIpById(AssignIpByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), assignIpParams, opts);\n\n System.out.println(assignIpApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, AssignIpParams } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ assignIpParams = new AssignIpParams();\n\n // AssignIpParams object\ \ initializations here...\n assignIpParams = JSON.stringify(assignIpParams);\n\ \n \n let vmExtId = \"4BADCa4d-edDF-Cab2-dde1-7cd0cB9BBe1f\";\n \ \ \n let extId = \"bA13dCca-DdAc-eAa5-FaD2-BBcAF8DDEEEd\";\n\n\n \ \ /*\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.assignIpById(vmExtId,\ \ extId, assignIpParams, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n assignIpParams = ntnx_vmm_py_client.AssignIpParams()\n\ \n # AssignIpParams object initializations here...\n \n vm_ext_id\ \ = \"Eb2baD60-4ae6-db9F-Cd3B-faBAA5c41aBF\"\n \n ext_id = \"2AfF5daF-dcB2-D4B7-FE76-bdbD45D82Efd\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.assign_ip_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, body=assignIpParams, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n assignIpParams := import1.NewAssignIpParams()\n\ \n // AssignIpParams object initializations here...\n\n \n vmExtId\ \ := \"faB8f60e-FcEB-Cbb2-fDFf-7AcC0Cc1C222\"\n \n extId := \"dCaB8adF-0B18-EdAb-6f8B-AfDCd8adac47\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.AssignIpByIdRequest{ VmExtId: &vmExtId, ExtId:\ \ &extId, Body: assignIpParams }\n response, error := VmServiceApiInstance.AssignIpById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/2DABaC32-a1AD-d34A-Af2F-0CeDBbdbA78C/nics/AaAAdbaa-eCEF-ecAb-6e74-Ee561F05fbCc/$actions/assign-ip" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"$objectType":"vmm.v4.ahv.config.AssignIpParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"$objectType":"vmm.v4.ahv.config.AssignIpParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/dec4Bd8C-fB6b-1eBA-d3BF-caA8afCd6aEf/nics/baBCB84E-DF0d-cd7C-fEfb-AE2CDBc85F84/$actions/assign-ip" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AssignIpParams assignIpParams = new AssignIpParams();\n\ \n // AssignIpParams object initializations here...\n\n String\ \ vmExtId = \"BbCAef45-E8D2-dadA-aCDF-fF2FebD938eF\";\n String extId\ \ = \"BaC249cC-74ED-7e9E-eAeC-1bB5B5877Fe9\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.GetEtag(getResponse);\n \ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new AssignIpByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ Body = assignIpParams,\n \n \n };\n\ \ try {\n AssignIpApiResponse assignIpApiResponse = vmApi.AssignIpById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/release-ip: post: tags: - Vm summary: Release an assigned IP address from the provided network device description: Releases the IP address assignment from a network device attached to a managed network. operationId: releaseIpById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 17bd5abc-927e-465c-b91d-82fb9ff99967 - name: extId in: path description: A globally unique identifier of a VM NIC of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: af0ee34a-7b81-4727-8aeb-7dcd04279c84 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 4e920018-0d11-487f-a1aa-aef25c4a7497 responses: "202": description: The request to release an assigned IP address from the provided network device is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/release-ip\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/release-ip\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/release-ip\ \ Post operation" x-permissions: operationName: Release Virtual Machine NIC IP deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Backup Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ReleaseIpByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.ReleaseIpApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"dEfdbcfa-Fa6c-4bEB-aE7E-a3AEc8ce3eAa\";\n \n String\ \ extId = \"feCAC82f-CdBC-5Db5-C1FE-BD22efac353A\";\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header\ \ needs to be retrieved by performing a Read(Get) operation on the same\ \ resource.\n ETags can be retrieved by calling a static method of\ \ ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ ReleaseIpApiResponse releaseIpApiResponse = vmApi.releaseIpById(ReleaseIpByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), opts);\n\n System.out.println(releaseIpApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"FBdcCAFB-8711-4edC-fd6E-3a7056dDF1Ec\";\n \n\ \ let extId = \"ABbEAF3D-cf0F-d1f0-0fa2-d3bEdBDAdCd6\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.releaseIpById(vmExtId, extId, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ 75f0EA77-b099-Be61-FdAd-C4FccA1B96Ef\"\n \n ext_id = \"DeCA41ae-263c-3F3B-e8a0-8c0c7569ADE4\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.release_ip_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, if_match=etag_value)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"4FACBa6B-9FBD-2aFD-35B6-F3FEFF5cdb70\"\ \n \n extId := \"452fcdA0-EeCC-aF9A-5aDE-8bf0b986dfbd\"\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.ReleaseIpByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n\ \ response, error := VmServiceApiInstance.ReleaseIpById(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/dcfCB9BE-5BFe-fc0f-8489-f5aeccCaDB77/nics/C761f6F0-EBFe-ffBa-ebE2-8DF7DdADac9d/$actions/release-ip" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/44CCD470-eCEa-dDca-Cc48-B0fB8fAcC5d2/nics/18CfFaAd-ccdB-4e6C-A1Bb-9cceED118aEC/$actions/release-ip" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"dFb12Fd4-804a-dc3f-befE-b9e2ecddBD4e\"\ ;\n String extId = \"BE48BEc1-DAAa-527F-75A0-E45EdEcc074f\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ReleaseIpByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ \n \n };\n try {\n ReleaseIpApiResponse\ \ releaseIpApiResponse = vmApi.ReleaseIpById(request, opts);\n }\ \ catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/migrate: post: tags: - Vm summary: Migrate a network device to another subnet description: Migrates a network device attached to a Virtual Machine to another subnet. This can be used to move network devices between VLAN and VPC subnets. operationId: migrateNicById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2e8cb8db-3c37-4f85-a81e-e013faaf6f90 - name: extId in: path description: A globally unique identifier of a VM NIC of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 57baaab1-3c34-4102-8bc7-73dd2cd0eeec - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 8456e35a-50f0-496e-b593-3eb51bbde63b requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.MigrateNicConfig' required: true responses: "202": description: The request to migrate a network device to another subnet is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/migrate\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/migrate\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/migrate\ \ Post operation" x-permissions: operationName: Migrate Virtual Machine NIC deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Network Infra Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.MigrateNicByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.MigrateNicType;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.SubnetReference;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.MigrateNicConfig;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.MigrateNicApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n MigrateNicConfig migrateNicConfig\ \ = new MigrateNicConfig();\n\n // MigrateNicConfig object initializations\ \ here...\n migrateNicConfig.setMigrateType(MigrateNicType.UNKNOWN);\ \ // required field\n migrateNicConfig.setSubnet(new SubnetReference());\ \ // required field\n \n String vmExtId = \"eBDCf0f4-38AC-D2Ba-fcF2-ceBdddc2EecF\"\ ;\n \n String extId = \"1b2fBCdc-2Fb0-4CFe-cfCd-D0E2bF2Ddc1a\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ MigrateNicApiResponse migrateNicApiResponse = vmApi.migrateNicById(MigrateNicByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), migrateNicConfig, opts);\n\n System.out.println(migrateNicApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, MigrateNicType, SubnetReference, MigrateNicConfig\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ migrateNicConfig = new MigrateNicConfig();\n\n // MigrateNicConfig\ \ object initializations here...\n migrateNicConfig.setMigrateType(MigrateNicType.UNKNOWN);\ \ // required field\n migrateNicConfig.setSubnet(new SubnetReference());\ \ // required field\n migrateNicConfig = JSON.stringify(migrateNicConfig);\n\ \n \n let vmExtId = \"a06AB68e-ABD8-AeaB-a9da-2ABCCE256bCE\";\n \ \ \n let extId = \"ba5dCFd5-caB0-De7a-aBc8-fBAE8b49A0EE\";\n\n\n \ \ /*\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.migrateNicById(vmExtId,\ \ extId, migrateNicConfig, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n migrateNicConfig =\ \ ntnx_vmm_py_client.MigrateNicConfig()\n\n # MigrateNicConfig object\ \ initializations here...\n migrateNicConfig.migrate_type = ntnx_vmm_py_client.MigrateNicType._UNKNOWN\ \ # required field\n migrateNicConfig.subnet = ntnx_vmm_py_client.SubnetReference()\ \ # required field\n \n vm_ext_id = \"02acbAFD-B74A-1BaD-e0A2-B42Ea6B9d9AB\"\ \n \n ext_id = \"2B4ABb95-cBbD-f6fc-fFF3-2ae5eEdaaCD6\"\n\n \"\"\ \"\n Some Create, Update, and Delete operations generally require an\ \ If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.migrate_nic_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, body=migrateNicConfig, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n migrateNicConfig := import1.NewMigrateNicConfig()\n\ \n // MigrateNicConfig object initializations here...\n\n \n vmExtId\ \ := \"2fE2fb4A-7DFa-E2ee-D5Da-EaCCABfeCCaD\"\n \n extId := \"BAB12BEf-A349-FAFb-EbCc-AC95AE1d3CE4\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.MigrateNicByIdRequest{ VmExtId: &vmExtId, ExtId:\ \ &extId, Body: migrateNicConfig }\n response, error := VmServiceApiInstance.MigrateNicById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/bFdEfced-E6f7-E0Ce-b9E0-Af3C8cadE3Ae/nics/dF13EaeC-704a-E27d-003E-7c6B0b643DAc/$actions/migrate" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"migrateType":"$UNKNOWN","ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"$objectType":"vmm.v4.ahv.config.MigrateNicConfig"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"migrateType":"$UNKNOWN","ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"$objectType":"vmm.v4.ahv.config.MigrateNicConfig"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/61ECcEb7-36dD-Dada-ba6b-dB90b1ca87e7/nics/eeD25CBC-c3af-f3ec-ee19-bADFcA9abafa/$actions/migrate" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n MigrateNicConfig migrateNicConfig = new MigrateNicConfig();\n\ \n // MigrateNicConfig object initializations here...\n migrateNicConfig.MigrateType\ \ = MigrateNicType.UNKNOWN; // required field\n migrateNicConfig.Subnet\ \ = new SubnetReference(); // required field\n\n String vmExtId =\ \ \"aabCbecD-6E0D-DccA-CF0c-a1D3Bd9fbEAc\";\n String extId = \"EcCAe5Cb-a87e-AB5D-Ec0c-eFd78512Edf9\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new MigrateNicByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ Body = migrateNicConfig,\n \n \n };\n\ \ try {\n MigrateNicApiResponse migrateNicApiResponse\ \ = vmApi.MigrateNicById(request, opts);\n } catch (ApiException\ \ ex) {\n Console.WriteLine(ex.Message);\n }\n }\n\ \ }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/assign-owner: post: tags: - Vm summary: Assign owner of a VM description: Assign the owner of a virtual machine. operationId: assignVmOwner parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5ec8fa64-6099-4f83-b83c-cdb9bcc06f2d - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 4f9a2281-b572-4053-8f8a-7ceeb879ea6d requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.OwnershipInfo' required: true responses: "202": description: The request to assign an owner of a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/assign-owner\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/assign-owner\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/assign-owner\ \ Post operation" x-permissions: operationName: Assign Virtual Machine Owner deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.AssignVmOwnerRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.OwnershipInfo;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.AssignVmOwnerApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n AhvConfigOwnershipInfo\ \ ahvConfigOwnershipInfo = new AhvConfigOwnershipInfo();\n\n // AhvConfigOwnershipInfo\ \ object initializations here...\n \n String extId = \"Ab1de1CB-Fe9D-E51a-9Aaf-dC297f0afdDc\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigAssignVmOwnerApiResponse ahvConfigAssignVmOwnerApiResponse =\ \ vmApi.assignVmOwner(AssignVmOwnerRequest.builder()\n .extId(extId)\n\ \ .build(), ahvConfigOwnershipInfo, opts);\n\n \ \ System.out.println(ahvConfigAssignVmOwnerApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, OwnershipInfo } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ ahvConfigOwnershipInfo = new AhvConfigOwnershipInfo();\n\n // AhvConfigOwnershipInfo\ \ object initializations here...\n ahvConfigOwnershipInfo = JSON.stringify(ahvConfigOwnershipInfo);\n\ \n \n let extId = \"C30BDf1F-e5f8-FDFf-eaf0-24fE5f3cA73b\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.assignVmOwner(extId,\ \ ahvConfigOwnershipInfo, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n ahvConfigOwnershipInfo\ \ = ntnx_vmm_py_client.AhvConfigOwnershipInfo()\n\n # AhvConfigOwnershipInfo\ \ object initializations here...\n \n ext_id = \"FbfACd9d-a0C3-C1ef-cBb5-dd39cCbac77E\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.assign_vm_owner(extId=ext_id,\ \ body=ahvConfigOwnershipInfo, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n ahvConfigOwnershipInfo := import1.NewAhvConfigOwnershipInfo()\n\ \n // AhvConfigOwnershipInfo object initializations here...\n\n \n\ \ extId := \"EBEbeC3a-19bd-DD2D-f6bd-838eEaC1ee0e\"\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.AssignVmOwnerRequest{ ExtId: &extId, Body: ahvConfigOwnershipInfo\ \ }\n response, error := VmServiceApiInstance.AssignVmOwner(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/f3f07Dc9-fadb-c1dd-eEf9-abAA0df16a6F/$actions/assign-owner" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/C0cA45Dd-b6dB-bf5a-5cAA-C7Cfc5FccBBb/$actions/assign-owner" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n AhvConfigOwnershipInfo ahvConfigOwnershipInfo\ \ = new AhvConfigOwnershipInfo();\n\n // AhvConfigOwnershipInfo object\ \ initializations here...\n\n String extId = \"A8a3BBfD-7Bfa-fCAd-d3cf-CC3DBe4cfFfe\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new AssignVmOwnerRequest\ \ {\n ExtId = extId,\n Body = ahvConfigOwnershipInfo,\n\ \ \n \n };\n try {\n AhvConfigAssignVmOwnerApiResponse\ \ ahvConfigAssignVmOwnerApiResponse = vmApi.AssignVmOwner(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}: get: tags: - Vm summary: Get configuration details for the provided PCIe device description: Retrieves configuration details for the provided PCIe device attached to a virtual machine. operationId: getPcieDeviceById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: f0d68d04-2670-4035-a2f9-a1f9677d7c41 - name: extId in: path description: Globally unique identifier of a PCIe device of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 51c39033-9bb1-452f-8f94-5e25150e2190 responses: "200": description: Returns the requested configuration details. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDevice' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine PCIe Device deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetPcieDeviceByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetPcieDeviceApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"ACb3c3Ef-f13a-cdBa-C3aa-Bb0AfBDe8aca\";\n \n String\ \ extId = \"FAFEdD6D-C2A8-FBD4-a8c0-6Fa07AA1bF73\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetPcieDeviceApiResponse getPcieDeviceApiResponse\ \ = vmApi.getPcieDeviceById(GetPcieDeviceByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(getPcieDeviceApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"aEBfcaf9-DBBB-ddAd-C22f-e1CEFCfA0e49\";\n \n\ \ let extId = \"c31bDB4C-ED10-51e0-FcbC-84D0f70f0dad\";\n\n\n\n\n\n \ \ vmApi.getPcieDeviceById(vmExtId, extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ 97c5c62d-d7Ad-df1c-f9Db-f2e3acACec7B\"\n \n ext_id = \"4Be43bdB-2DFa-fd60-abe1-cEaDcA1DBcd9\"\ \n\n\n try:\n api_response = vm_api.get_pcie_device_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"6c53244b-ae51-fEB2-d08C-dE14dAfFADAD\"\ \n \n extId := \"aDbd4AFa-CcBd-C20B-F4Bf-DaEABB14A64B\"\n\n\n request\ \ := vm.GetPcieDeviceByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n \ \ response, error := VmServiceApiInstance.GetPcieDeviceById(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.PcieDevice)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/DcA6F8AE-cae2-ce2B-AeCf-8F1B3e99a20A/pcie-devices/ef03D71C-D091-21fa-6cCC-ef2a3EAebB5F" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/5CEb1DCb-aBDe-bdFC-b8Bd-8Cc6d90e9C2e/pcie-devices/EB0a4fdE-4cff-be3a-0dD7-0BF4dabAbEFd" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"61ccaF7b-b0Ba-24Ae-aE61-Fb36De6EFeEa\"\ ;\n String extId = \"8e7Bd5BF-7E43-e593-cb9A-c9b9c0f8bA50\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetPcieDeviceByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n GetPcieDeviceApiResponse\ \ getPcieDeviceApiResponse = vmApi.GetPcieDeviceById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Vm summary: Remove a PCIe device from a VM description: Removes the specified PCIe device from a virtual machine. operationId: deletePcieDeviceById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 274cbb0d-5528-4989-96f0-e2d8e44b528e - name: extId in: path description: Globally unique identifier of a PCIe device of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 24d094e6-aad1-4a30-904b-c49cad7cc02c - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 47ac3e8c-14f8-45e1-aa83-b8f35c2df166 responses: "202": description: The request to remove a PCIe device from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Delete operation" x-permissions: operationName: Delete Virtual Machine PCIe Device deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeletePcieDeviceByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeletePcieDeviceApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"2bB5060C-C13A-339E-CB91-d54e2e594F85\";\n \n String\ \ extId = \"e3BcddE6-cdEa-f365-8FaB-41Ce3e0faa11\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeletePcieDeviceApiResponse deletePcieDeviceApiResponse\ \ = vmApi.deletePcieDeviceById(DeletePcieDeviceByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(deletePcieDeviceApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"decBe9FE-0a9a-77d5-Eb8E-AadB3A4DddFc\";\n \n\ \ let extId = \"DdBafe3D-8eB4-dfee-bCdC-dE1D7cFFb1B1\";\n\n\n\n\n\n \ \ vmApi.deletePcieDeviceById(vmExtId, extId).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ eFAEe4eC-9fEA-CBbc-D2Fe-D1cAcdEb1EC3\"\n \n ext_id = \"D99fC3F9-2baa-90bB-D43b-fE44B33d2cFB\"\ \n\n\n try:\n api_response = vm_api.delete_pcie_device_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"aaFcbeD4-cacB-EAf7-1fFF-F2DDEcFA28cE\"\ \n \n extId := \"DfeCAc02-3fa4-7Be8-40De-6d60AE0dB78f\"\n\n\n request\ \ := vm.DeletePcieDeviceByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n\ \ response, error := VmServiceApiInstance.DeletePcieDeviceById(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/efDcB87C-df80-9EBf-FAF3-Ab9f93cebF8b/pcie-devices/2c0AfE5e-9ba3-dbe9-DFC7-6b94eaED1373" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/d2D557dB-A4CF-9C4e-eeA1-3FfdecE72Ddc/pcie-devices/0f4D45C2-31A6-aa61-8feD-2bDd66f5D3B3" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"eDC48cbd-02fc-B45C-AeAb-d5AeCCAAeDfa\"\ ;\n String extId = \"Cee1D114-af34-B7DD-1aEc-DD2C57c68bEB\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeletePcieDeviceByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n DeletePcieDeviceApiResponse\ \ deletePcieDeviceApiResponse = vmApi.DeletePcieDeviceById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices: get: tags: - Vm summary: List PCIe devices attached to a VM description: Lists all the PCIe devices attached to a virtual machine. operationId: listPcieDevicesByVmId parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 96f6f847-1bbc-4f20-ad05-0734a2636a0b - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns a list of PCIe devices attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDevice' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Get operation" x-permissions: operationName: View Virtual Machine PCIe Device deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListPcieDevicesByVmIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListPcieDevicesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"5FFDBf7B-AaF7-aabB-4017-ebC81fbc3FA2\";\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListPcieDevicesApiResponse listPcieDevicesApiResponse\ \ = vmApi.listPcieDevicesByVmId(ListPcieDevicesByVmIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .$page(page)\n \ \ .$limit(limit)\n .build());\n\n System.out.println(listPcieDevicesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"dDF797C6-A2df-edfa-99C0-5Fd86d2eF7Db\";\n\n //\ \ Construct Optional Parameters\n var opts = {};\n opts[\"$page\"\ ] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmApi.listPcieDevicesByVmId(vmExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ EFEa4fDD-fB8d-AebF-AcFc-d5d8dFeaEAa5\"\n \n page = 0\n \n limit\ \ = 50\n\n\n try:\n api_response = vm_api.list_pcie_devices_by_vm_id(vmExtId=vm_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"8B3d57ad-9D85-5FC8-CCF1-A15aFc56fDcf\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := vm.ListPcieDevicesByVmIdRequest{\ \ VmExtId: &vmExtId, Page_: &page_, Limit_: &limit_ }\n response, error\ \ := VmServiceApiInstance.ListPcieDevicesByVmId(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().([]import1.PcieDevice)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/fB2e11B4-ad0C-6E12-2b2D-e3eb1AdFEDFf/pcie-devices?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/d8Fbd3A9-DfB4-A72d-cc3e-CADAcD9FaB9e/pcie-devices?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"fEc868Db-dAEa-3918-CA36-aDc0D3Be1AA6\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListPcieDevicesByVmIdRequest\ \ {\n VmExtId = vmExtId,\n Page = page,\n \ \ Limit = limit\n };\n try {\n ListPcieDevicesApiResponse\ \ listPcieDevicesApiResponse = vmApi.ListPcieDevicesByVmId(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - Vm summary: Create a PCIe device for a VM description: Creates and attaches a PCIe device to a virtual machine. operationId: createPcieDevice parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: bb51279b-cb95-4475-9ea0-89e0a2034d49 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 1ade5a98-753d-45e6-b5c5-96088db0666c requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDevice' required: true responses: "202": description: The request to create a PCIe device for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Post operation" x-permissions: operationName: Create Virtual Machine PCIe Device deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreatePcieDeviceRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.PcieDevice;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreatePcieDeviceApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n PcieDevice pcieDevice\ \ = new PcieDevice();\n\n // PcieDevice object initializations here...\n\ \ \n String vmExtId = \"11aeCBAd-DefA-a7ED-884a-AeAD1B0CABB6\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CreatePcieDeviceApiResponse\ \ createPcieDeviceApiResponse = vmApi.createPcieDevice(CreatePcieDeviceRequest.builder()\n\ \ .vmExtId(vmExtId)\n .build(), pcieDevice);\n\ \n System.out.println(createPcieDeviceApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, PcieDevice } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ pcieDevice = new PcieDevice();\n\n // PcieDevice object initializations\ \ here...\n pcieDevice = JSON.stringify(pcieDevice);\n\n \n let\ \ vmExtId = \"Ca3Ff9BE-F8f8-E7E1-eaEf-e2ecfDbb595f\";\n\n\n\n\n\n vmApi.createPcieDevice(vmExtId,\ \ pcieDevice).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n pcieDevice = ntnx_vmm_py_client.PcieDevice()\n\ \n # PcieDevice object initializations here...\n \n vm_ext_id =\ \ \"dFD5EEA0-07d3-0d1f-d8F3-CC0F71EC5baA\"\n\n\n try:\n api_response\ \ = vm_api.create_pcie_device(vmExtId=vm_ext_id, body=pcieDevice)\n \ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n pcieDevice := import1.NewPcieDevice()\n\ \n // PcieDevice object initializations here...\n\n \n vmExtId\ \ := \"bfe0ABfE-dDbA-BfB2-DfA7-b0Ac3Ea7Bb4F\"\n\n\n request := vm.CreatePcieDeviceRequest{\ \ VmExtId: &vmExtId, Body: pcieDevice }\n response, error := VmServiceApiInstance.CreatePcieDevice(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/2aDDDeaB-CDBd-Ebc5-BBf3-fC7BBA5bBfaa/pcie-devices" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/0e971FBa-C0ac-2E7D-eBdc-5E22e1ADeA5B/pcie-devices" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n PcieDevice pcieDevice = new PcieDevice();\n\n\ \ // PcieDevice object initializations here...\n\n String vmExtId\ \ = \"4DE4b3dD-F1ec-e4FF-Ff3c-ebB8E6baEEeC\";\n\n // Create request\ \ object with parameters\n var request = new CreatePcieDeviceRequest\ \ {\n VmExtId = vmExtId,\n Body = pcieDevice\n \ \ };\n try {\n CreatePcieDeviceApiResponse createPcieDeviceApiResponse\ \ = vmApi.CreatePcieDevice(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-on: post: tags: - Vm summary: Turn on a VM description: Turns a Virtual Machine on. operationId: powerOnVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: e731e375-c1de-4a2b-8c86-19a8b6968f3a - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: c9e25797-0e07-4d92-adc9-30986058cfd3 responses: "202": description: The request to turn on a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-on\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-on\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-on\ \ Post operation" x-permissions: operationName: Power On Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.PowerOnVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.PowerOnVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"aF3CD7BC-D54C-D005-cBfF-F7dbf7bCDDCF\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigPowerOnVmApiResponse ahvConfigPowerOnVmApiResponse = vmApi.powerOnVm(PowerOnVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(ahvConfigPowerOnVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"FEd5c7cB-df8F-b1Fe-37A4-F7ABeCcd60BB\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.powerOnVm(extId, args).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"bbd21A8c-b8bb-180D-4BcC-De2eF8fc1FdD\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.power_on_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"7E0Ce1EC-EDCE-cf6B-3b6E-5FcDb7aBB9CA\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.PowerOnVmRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.PowerOnVm(ctx, &request, args)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/cdE7f6DF-9fDE-52cC-C4fF-157Bf8E8fBbe/$actions/power-on" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/eBB04CCD-d2Fe-4fDa-d2d6-4A2Aa4b5C5CD/$actions/power-on" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"E2Eacc0B-EE93-Afcd-fea7-931dbD0bAEfA\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new PowerOnVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n AhvConfigPowerOnVmApiResponse ahvConfigPowerOnVmApiResponse\ \ = vmApi.PowerOnVm(request, opts);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-cycle: post: tags: - Vm summary: Force a power cycle for a VM description: "Force a power-cycle for a virtual machine. This operation is equivalent\ \ to requesting a VM power-off followed by the VM power-on. Power cycling\ \ a VM is slower than resetting it, but it will be creating a fresh instance\ \ of the virtual machine. When resetting, the same instance is restarted within\ \ the context of the running VM instance." operationId: powerCycleVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8cc3d7c2-81dc-42c5-b479-a64cae47a793 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 54d946c7-ff1e-4ccd-9735-fde008ef6fa6 responses: "202": description: The request to force a power cycle for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-cycle\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-cycle\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-cycle\ \ Post operation" x-permissions: operationName: Power Cycle Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.PowerCycleVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.PowerCycleVmApiResponse;\nimport\ \ org.springframework.web.client.RestClientException;\n\npublic class JavaSdkSample\ \ {\n public static void main(String[] args) {\n // Configure\ \ the client\n ApiClient apiClient = new ApiClient();\n //\ \ IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"e8dFeA57-CFaf-5Fb6-6a8b-F2325DbDeCe5\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ PowerCycleVmApiResponse powerCycleVmApiResponse = vmApi.powerCycleVm(PowerCycleVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(powerCycleVmApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"4d6e71BD-A6D2-9aC8-3FEe-7eCE2bC4BeC6\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.powerCycleVm(extId, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"c5BB4Aaf-a0Ab-C738-B7fF-e1EEbA6EfDda\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.power_cycle_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"2e9D34A5-0fBb-ADF8-C2da-25BBAfdCAc01\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.PowerCycleVmRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.PowerCycleVm(ctx, &request, args)\n if\ \ error != nil {\n fmt.Println(error)\n return\n }\n \ \ data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/3d3BAFE1-B120-Dea8-BDc6-dcB2ce8ACc8c/$actions/power-cycle" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/3f6FE20b-aDDb-FE2d-f1Eb-FEFF1e9C76A7/$actions/power-cycle" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"Ad1F4F2C-cdEc-a71A-8bC3-FdF28b14b4a2\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new PowerCycleVmRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n PowerCycleVmApiResponse powerCycleVmApiResponse\ \ = vmApi.PowerCycleVm(request, opts);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-off: post: tags: - Vm summary: Force power off a VM description: "Forceably shuts down a virtual machine which is equivalent to\ \ removing the power cable. Note: The forced shutdown may result in data loss\ \ if any operations are in progress during the shutdown." operationId: powerOffVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 336d8b29-d9cd-43ea-9ea3-5554d35962de - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f67b8523-d721-4c74-97b6-ace7c3941e9f responses: "202": description: The request to force power off a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-off\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-off\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-off\ \ Post operation" x-permissions: operationName: Power Off Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Backup Admin - name: NCM Connector x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.PowerOffVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.PowerOffVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"F32dDA3c-ce5B-Ff54-e9A2-fC7F0FeCf1aD\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigPowerOffVmApiResponse ahvConfigPowerOffVmApiResponse = vmApi.powerOffVm(PowerOffVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(ahvConfigPowerOffVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"eb754B3a-AABb-Bbee-aD66-e8a3BDEbbe30\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.powerOffVm(extId, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"DaFc0ccA-DDCf-2CfD-0Cc7-c04Dd2CfdeAa\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.power_off_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"df0Aa8dc-e7a6-ccf0-94fA-E64d5ECB3c4B\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.PowerOffVmRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.PowerOffVm(ctx, &request, args)\n if\ \ error != nil {\n fmt.Println(error)\n return\n }\n \ \ data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/dfB3e4Ce-aA7f-Ba2e-Db7a-3be46DaDedE9/$actions/power-off" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/9Bb8A7FB-C7cA-853A-218D-34e8F49CeE00/$actions/power-off" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"aA9ebBc2-5A63-e01D-22bB-BDb2210D5b57\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new PowerOffVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n AhvConfigPowerOffVmApiResponse ahvConfigPowerOffVmApiResponse\ \ = vmApi.PowerOffVm(request, opts);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/reset: post: tags: - Vm summary: Reset a VM immediately description: "Force reset of a Virtual Machine, without waiting for the guest\ \ VM to shutdown itself. Resetting a VM is faster than power-cycle as the\ \ reset occurs within the context of the running virtual machine instance\ \ rather than creating a fresh instance." operationId: resetVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: dd1c4721-7df2-4a4c-b872-0e4acedb78a5 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 2e65e1ba-a1b8-4b3f-9006-4edb0ede5654 responses: "202": description: The request to reset a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/reset\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/reset\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/reset\ \ Post operation" x-permissions: operationName: Reset Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ResetVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.ResetVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"EADc4e06-04c7-fcbE-7A6A-Cb2Ff04eF2FE\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigResetVmApiResponse ahvConfigResetVmApiResponse = vmApi.resetVm(ResetVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(ahvConfigResetVmApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"293EFeea-A9E5-658A-f4C1-0cf1DA16FCf8\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.resetVm(extId, args).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"892Fbc0b-9D9c-6C86-F2fc-D45eD5f629B1\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.reset_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"f77ddF6e-dBCd-20ED-afeE-CCFe9070BBF5\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.ResetVmRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.ResetVm(ctx, &request, args)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/3BabF68a-ecdE-9eCb-Ffa9-80d8D52E4C8a/$actions/reset" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/AcAAeCfe-73a9-5DAd-9e2A-8f8b0ebc357e/$actions/reset" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"9c3AECE5-0EfE-Da2A-DaD9-6f793dAAcefe\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ResetVmRequest {\n \ \ ExtId = extId,\n \n \n };\n \ \ try {\n AhvConfigResetVmApiResponse ahvConfigResetVmApiResponse\ \ = vmApi.ResetVm(request, opts);\n } catch (ApiException ex) {\n\ \ Console.WriteLine(ex.Message);\n }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/shutdown: post: tags: - Vm summary: Shutdown the VM using ACPI description: Collaborative shutdown of a Virtual Machine through the ACPI support in the operating system. operationId: shutdownVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 40ca3d2a-daf3-4de9-969d-b25e5175c223 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 27c1ecaa-24d3-4321-801d-2903c76800f5 responses: "202": description: The request to shutdown the VM using ACPI is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" x-permissions: operationName: ACPI Shutdown Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ShutdownVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.ShutdownVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"CCaCEAfD-Dc0f-D115-E4d2-19C3eD57c73d\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigShutdownVmApiResponse ahvConfigShutdownVmApiResponse = vmApi.shutdownVm(ShutdownVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(ahvConfigShutdownVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"bdaEDe14-aeAD-A049-fd2e-Aaae7bbFa62A\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.shutdownVm(extId, args).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"ddb6EB93-af18-1dDC-DCEA-8C4dc7F3d2Ae\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.shutdown_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"FEB1aECc-11C4-eeaB-DD7B-e1a87207aFAC\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.ShutdownVmRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.ShutdownVm(ctx, &request, args)\n if\ \ error != nil {\n fmt.Println(error)\n return\n }\n \ \ data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/828Bb7fb-6C78-3aE2-7af0-fCFeC984Ab66/$actions/shutdown" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/DEF2Ed2D-211e-5BBb-f01e-FbCec1cced9B/$actions/shutdown" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"2AFbAe9c-7582-6B7E-AbDF-d801C1fAfAa4\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ShutdownVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n AhvConfigShutdownVmApiResponse ahvConfigShutdownVmApiResponse\ \ = vmApi.ShutdownVm(request, opts);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown: post: tags: - Vm summary: Shutdown the VM using NGT description: "Collaborative shutdown of a Virtual Machine, requesting Nutanix\ \ Guest Tools to trigger a shutdown from within the VM." operationId: shutdownGuestVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5e99854c-21a1-44b9-9358-76647ff9860f - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: e693ffa8-88e0-47ee-a59b-bd27ebeed0dc requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestPowerOptions' required: true responses: "202": description: The request to shutdown the VM using NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" x-permissions: operationName: Guest Shutdown Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ShutdownGuestVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestPowerOptions;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.ShutdownVmApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestPowerOptions guestPowerOptions\ \ = new GuestPowerOptions();\n\n // GuestPowerOptions object initializations\ \ here...\n \n String extId = \"A0e35cE9-66cB-6B5a-a1dD-CBd2647b94fF\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ AhvConfigShutdownVmApiResponse ahvConfigShutdownVmApiResponse = vmApi.shutdownGuestVm(ShutdownGuestVmRequest.builder()\n\ \ .extId(extId)\n .build(), guestPowerOptions,\ \ opts);\n\n System.out.println(ahvConfigShutdownVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestPowerOptions } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestPowerOptions = new GuestPowerOptions();\n\n // GuestPowerOptions\ \ object initializations here...\n guestPowerOptions = JSON.stringify(guestPowerOptions);\n\ \n \n let extId = \"cee0CeB0-3Afd-dF78-c52f-C1eedb7bFfe6\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.shutdownGuestVm(extId,\ \ guestPowerOptions, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestPowerOptions =\ \ ntnx_vmm_py_client.GuestPowerOptions()\n\n # GuestPowerOptions object\ \ initializations here...\n \n ext_id = \"F1cE6FDB-A550-feE6-1890-a35CFb1dd14B\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.shutdown_guest_vm(extId=ext_id,\ \ body=guestPowerOptions, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestPowerOptions := import1.NewGuestPowerOptions()\n\ \n // GuestPowerOptions object initializations here...\n\n \n extId\ \ := \"0Ccf71a7-DaF0-57B4-0BBa-EF3C9fcCf4eA\"\n\n /*\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.ShutdownGuestVmRequest{ ExtId: &extId, Body: guestPowerOptions\ \ }\n response, error := VmServiceApiInstance.ShutdownGuestVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/6CBB0bB1-3f99-3FaA-e1AB-B0AdBDCA2bc9/$actions/guest-shutdown" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"guestPowerStateTransitionConfig":{"shouldEnableScriptExec":true,"shouldFailOnScriptFailure":true,"$objectType":"vmm.v4.ahv.config.GuestPowerStateTransitionConfig"},"$objectType":"vmm.v4.ahv.config.GuestPowerOptions"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"guestPowerStateTransitionConfig":{"shouldEnableScriptExec":true,"shouldFailOnScriptFailure":true,"$objectType":"vmm.v4.ahv.config.GuestPowerStateTransitionConfig"},"$objectType":"vmm.v4.ahv.config.GuestPowerOptions"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/7dBe1a1C-C5Ae-bC4b-3EDd-e8e088f59cc0/$actions/guest-shutdown" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestPowerOptions guestPowerOptions = new GuestPowerOptions();\n\ \n // GuestPowerOptions object initializations here...\n\n String\ \ extId = \"6BeaA0BF-FD5c-0BAe-5173-713eCDeCDbd2\";\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header\ \ needs to be retrieved by performing a Read(Get) operation on the same\ \ resource.\n ETags can be retrieved by calling a static method of\ \ ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ShutdownGuestVmRequest\ \ {\n ExtId = extId,\n Body = guestPowerOptions,\n\ \ \n \n };\n try {\n AhvConfigShutdownVmApiResponse\ \ ahvConfigShutdownVmApiResponse = vmApi.ShutdownGuestVm(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/reboot: post: tags: - Vm summary: Reboot a VM using ACPI description: Collaborative reboot of a Virtual Machine through the ACPI support in the operating system. operationId: rebootVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 21e31449-4b1f-466a-a4ba-d512e88ad83c - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 45a5be50-027a-4175-afe0-958830df8c93 responses: "202": description: The request to reboot a VM using ACPI is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" x-permissions: operationName: ACPI Reboot Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.RebootVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.RebootVmApiResponse;\nimport org.springframework.web.client.RestClientException;\n\ \npublic class JavaSdkSample {\n public static void main(String[] args)\ \ {\n // Configure the client\n ApiClient apiClient = new\ \ ApiClient();\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ apiClient.setHost(\"localhost\");\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ apiClient.setPort(9440);\n // Interval in ms to use during\ \ retry attempts\n apiClient.setRetryInterval(5000);\n //\ \ Max retry attempts while reconnecting on a loss of connection\n \ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect to\ \ the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String extId\ \ = \"D0Ce8Dc8-607e-e75F-3f15-8c2f4eCf58D0\";\n\n /*\n Some\ \ Create, Update, and Delete operations generally require an If-Match header\ \ with a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to\ \ be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient\ \ as below:\n String eTag = ApiClient.getEtag(getResponse);\n \ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ RebootVmApiResponse rebootVmApiResponse = vmApi.rebootVm(RebootVmRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(rebootVmApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let extId = \"ADcDddFF-Aa30-FA6e-B01a-d2DEe0ECe1Fc\";\n\n\n /*\n\ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n */\n vmApi.rebootVm(extId, args).then(({data, response})\ \ => {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n ext_id = \"CFf9FC43-BcEA-bc61-1beE-5F720D80ceAE\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.reboot_vm(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n extId := \"abF7FeDC-DBfb-82EB-fAAF-1C5Ef7C8fE9f\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vm.RebootVmRequest{ ExtId: &extId }\n response,\ \ error := VmServiceApiInstance.RebootVm(ctx, &request, args)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/9ab8a778-cCDf-3DC8-A4aF-C56fa379CbDd/$actions/reboot" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/66dF1DBc-fd2c-4FBa-85fe-2Be6bAbfF3AE/$actions/reboot" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String extId = \"Cd51beC9-8bEE-fC68-68ef-41AbD25dde2a\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new RebootVmRequest {\n\ \ ExtId = extId,\n \n \n };\n \ \ try {\n RebootVmApiResponse rebootVmApiResponse = vmApi.RebootVm(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot: post: tags: - Vm summary: Restart the VM using NGT description: "Collaborative reboot of a Virtual Machine, requesting Nutanix\ \ Guest Tools to trigger a reboot from within the VM." operationId: rebootGuestVm parameters: - name: extId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 93f008e4-f515-4c44-b261-25517ddaced3 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: c4e5df6a-dd85-454a-9373-1fff794cc3ff requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestPowerOptions' required: true responses: "202": description: The request to restart the VM using NGT is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" x-permissions: operationName: Guest Reboot Virtual Machine deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.RebootGuestVmRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.config.GuestPowerOptions;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.RebootVmApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n GuestPowerOptions guestPowerOptions\ \ = new GuestPowerOptions();\n\n // GuestPowerOptions object initializations\ \ here...\n \n String extId = \"2e21E4be-5ecf-CCF0-7d31-CE6d9e6ab97d\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ RebootVmApiResponse rebootVmApiResponse = vmApi.rebootGuestVm(RebootGuestVmRequest.builder()\n\ \ .extId(extId)\n .build(), guestPowerOptions,\ \ opts);\n\n System.out.println(rebootVmApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, GuestPowerOptions } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ guestPowerOptions = new GuestPowerOptions();\n\n // GuestPowerOptions\ \ object initializations here...\n guestPowerOptions = JSON.stringify(guestPowerOptions);\n\ \n \n let extId = \"E1d5DeE3-Bb7C-E7Dc-F4DD-4A60DaAe8ddc\";\n\n\n\ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmApi.rebootGuestVm(extId,\ \ guestPowerOptions, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n guestPowerOptions =\ \ ntnx_vmm_py_client.GuestPowerOptions()\n\n # GuestPowerOptions object\ \ initializations here...\n \n ext_id = \"9cE6af7d-CeC0-deFa-17eA-F2CD13a8c6EE\"\ \n\n \"\"\"\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n etag_value = ApiClient.get_etag(get_api_response)\n\ \ \"\"\"\n\n try:\n api_response = vm_api.reboot_guest_vm(extId=ext_id,\ \ body=guestPowerOptions, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n guestPowerOptions := import1.NewGuestPowerOptions()\n\ \n // GuestPowerOptions object initializations here...\n\n \n extId\ \ := \"E8fDEe5b-3b6D-10d5-60CB-aBFEbbb4B3Bd\"\n\n /*\n Some Create,\ \ Update, and Delete operations generally require an If-Match header with\ \ a value to be passed in order to protect against concurrent updates.\n\ \ The value that needs to be sent in the If-Match header needs to be\ \ retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etagValue := ApiClientInstance.GetEtag(getResponse)\n */\n\n \ \ request := vm.RebootGuestVmRequest{ ExtId: &extId, Body: guestPowerOptions\ \ }\n response, error := VmServiceApiInstance.RebootGuestVm(ctx, &request,\ \ args)\n if error != nil {\n fmt.Println(error)\n return\n\ \ }\n data, _ := response.GetData().(import2.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/0aFdDCaA-c5A3-f1E4-C7BB-3c32B7c95AD7/$actions/guest-reboot" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"guestPowerStateTransitionConfig":{"shouldEnableScriptExec":true,"shouldFailOnScriptFailure":true,"$objectType":"vmm.v4.ahv.config.GuestPowerStateTransitionConfig"},"$objectType":"vmm.v4.ahv.config.GuestPowerOptions"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"guestPowerStateTransitionConfig":{"shouldEnableScriptExec":true,"shouldFailOnScriptFailure":true,"$objectType":"vmm.v4.ahv.config.GuestPowerStateTransitionConfig"},"$objectType":"vmm.v4.ahv.config.GuestPowerOptions"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/eEAdA7f5-0eab-faB1-7EfD-BAAeAFb030E2/$actions/guest-reboot" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n GuestPowerOptions guestPowerOptions = new GuestPowerOptions();\n\ \n // GuestPowerOptions object initializations here...\n\n String\ \ extId = \"2D6f8dB7-1dF1-Deab-DBFd-0CC0dD97ffFf\";\n\n /*\n \ \ Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header\ \ needs to be retrieved by performing a Read(Get) operation on the same\ \ resource.\n ETags can be retrieved by calling a static method of\ \ ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new RebootGuestVmRequest\ \ {\n ExtId = extId,\n Body = guestPowerOptions,\n\ \ \n \n };\n try {\n RebootVmApiResponse\ \ rebootVmApiResponse = vmApi.RebootGuestVm(request, opts);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}: get: tags: - Vm summary: Get configuration details for the provided serial port description: Retrieves configuration details for the provided serial port attached to a virtual machine. operationId: getSerialPortById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: cfbd0963-965b-4029-8b56-7a4ef6a399eb - name: extId in: path description: The globally unique identifier of a serial port of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: fc3cffe6-256e-4f64-9590-512989b432b7 responses: "200": description: Return the configuration details for the provided serial port attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Get operation" x-permissions: operationName: View Virtual Machine Serial Port deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 20 timeUnit: seconds - type: Large count: 25 timeUnit: seconds - type: XLarge count: 25 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetSerialPortByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetSerialPortApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"3fAC9cCD-8fa5-caC9-92fB-73FA1eCFd4DD\";\n \n String\ \ extId = \"3fEcD6A9-2E7E-62Cc-0Eff-d2aFF6C7b203\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetSerialPortApiResponse getSerialPortApiResponse\ \ = vmApi.getSerialPortById(GetSerialPortByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(getSerialPortApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"1FCaaDC5-ED68-0C7F-1eaD-3f3F835Ada5b\";\n \n\ \ let extId = \"B966eEBe-0E26-67Bb-BeBc-13FbdcfcdEa0\";\n\n\n\n\n\n \ \ vmApi.getSerialPortById(vmExtId, extId).then(({data, response}) => {\n\ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ CDDbEafE-a0eF-cBBf-F791-bA07adBcdf96\"\n \n ext_id = \"a6b411Dc-43bf-FaeD-00bA-DdF8c22c48cB\"\ \n\n\n try:\n api_response = vm_api.get_serial_port_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"E16Ec1eF-31cd-C5fd-b61F-4E2D0fdaCFc2\"\ \n \n extId := \"edCddBFB-d4F1-578C-C1b1-eb1b3BbF85bf\"\n\n\n request\ \ := vm.GetSerialPortByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n \ \ response, error := VmServiceApiInstance.GetSerialPortById(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.SerialPort)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Cd15235B-0BaC-53FB-FdbE-fBebf04EEC45/serial-ports/bB4FD923-dC80-CecC-Fa98-F6B6dFfeddfB" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/81c7A2Cf-Cded-fF89-A48d-c5CdBb3ebF38/serial-ports/D3cd0dea-CbF7-ef52-d2ed-bdEAeA5bd4E6" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"D14FFBee-CEDa-985a-Fc03-E3BDcEEAC4ae\"\ ;\n String extId = \"AdaebbB9-CBD1-2ff0-E3cC-b6ebbdAB5cEe\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetSerialPortByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n GetSerialPortApiResponse\ \ getSerialPortApiResponse = vmApi.GetSerialPortById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - Vm summary: Update the configuration for the provided serial port description: Updates the configuration details for the provided serial port. operationId: updateSerialPortById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 820aacc9-5aa1-4c77-97d4-b6017051156b - name: extId in: path description: The globally unique identifier of a serial port of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 084b4ac9-d735-4d62-b1a0-d2a9e4e5051d - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 3691ba3d-2f4a-4d25-ad4e-b022429dcc0d requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' required: true responses: "202": description: The request to update the configuration for the provided serial port is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Put operation" x-permissions: operationName: Update Virtual Machine Serial Port deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.UpdateSerialPortByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.Vm.GetSerialPortByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.SerialPort;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetSerialPortApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateSerialPortApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n SerialPort serialPort\ \ = new SerialPort();\n\n // SerialPort object initializations here...\n\ \ \n String vmExtId = \"CDe9eF0a-aC12-7a8f-FCAe-e6D40d9f62e1\"\ ;\n \n String extId = \"Ae7Bc7eD-b8BB-cAbe-Aebc-EFEB29D9deBA\"\ ;\n\n // perform GET call\n GetSerialPortApiResponse getResponse\ \ = null;\n try {\n getResponse = vmApi.getSerialPortById(GetSerialPortByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n } catch(RestClientException ex) {\n \ \ System.out.println(ex.getMessage());\n }\n // Extract\ \ E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateSerialPortApiResponse\ \ updateSerialPortApiResponse = vmApi.updateSerialPortById(UpdateSerialPortByIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build(), serialPort, opts);\n\n System.out.println(updateSerialPortApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, SerialPort, GetSerialPortApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ serialPort = new SerialPort();\n\n // SerialPort object initializations\ \ here...\n serialPort = JSON.stringify(serialPort);\n\n \n let\ \ vmExtId = \"e3BD34Ac-debC-Df2F-CCB9-dEDAAcE991bc\";\n \n let extId\ \ = \"AAAbF1e6-bbE2-f3dc-8CaD-afDe21dbe74b\";\n\n\n // Perform Get call\n\ \ vmApi.getSerialPortById(vmExtId, extId).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ // Extract E-Tag Header\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n\n vmApi.updateSerialPortById(vmExtId,\ \ extId, serialPort, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n serialPort = ntnx_vmm_py_client.SerialPort()\n\ \n # SerialPort object initializations here...\n \n vm_ext_id =\ \ \"B1B8beCB-FFCC-BC7f-DaE8-fAFf0decDaEe\"\n \n ext_id = \"6ebFfcCe-F4cd-35c7-0F7B-b865AbDeaCFD\"\ \n\n try:\n api_response = vm_api.get_serial_port_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n except ntnx_vmm_py_client.rest.ApiException as e:\n\ \ print(e)\n # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_api.update_serial_port_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id, body=serialPort, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n serialPort := import1.NewSerialPort()\n\ \n // SerialPort object initializations here...\n\n \n vmExtId\ \ := \"0ECACFc5-bfDA-c7F6-E2FE-Ae9cBa6A4dc5\"\n \n extId := \"C13Fe7C6-93ce-6b4c-146D-CD45DdD54E8C\"\ \n\n getRequest := vm.GetSerialPortByIdRequest{ vmExtId: &vmExtId, extId:\ \ &extId }\n getResponse, err := VmServiceApiInstance.GetSerialPortById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vm.UpdateSerialPortByIdRequest{ VmExtId: &vmExtId, ExtId:\ \ &extId, Body: serialPort }\n response, error := VmServiceApiInstance.UpdateSerialPortById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/FEc4CCe9-C07F-3D3B-Da9A-fdA767DAEeFc/serial-ports/68a0f90d-6dd4-ACeA-e8aE-de3cFAbAd8eF" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/Ccc732fE-AaBF-43ED-4e4B-23BD5a9ebF51/serial-ports/bC9b69FF-eAd8-FE82-350C-be2ef7FFA5ed" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Config;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmApi vmApi = new VmApi(client);\n\n SerialPort serialPort =\ \ new SerialPort();\n\n // SerialPort object initializations here...\n\ \n String vmExtId = \"A66dc3cd-3CEA-37dd-cE5d-BbF1afc3f23A\";\n \ \ String extId = \"BaeFcCFE-FEbA-b1AB-b52f-69aEF404EA22\";\n\n \ \ // perform GET call\n var getRequest = new GetSerialPortByIdRequest\ \ {\n VmExtId = vmExtId,\n ExtId = extId,\n \ \ };\n var getRequest = new GetSerialPortByIdRequest {\n \ \ VmExtId = vmExtId,\n ExtId = extId\n };\n \ \ try {\n GetSerialPortApiResponse getResponse = vmApi.GetSerialPortById(getRequestgetRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateSerialPortByIdRequest {\n VmExtId = vmExtId,\n\ \ ExtId = extId,\n Body = serialPort,\n \ \ \n \n };\n try {\n UpdateSerialPortApiResponse\ \ updateSerialPortApiResponse = vmApi.UpdateSerialPortById(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - Vm summary: Remove a serial port from a VM description: Removes the specified serial port from a virtual machine. operationId: deleteSerialPortById parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 134edd6b-4d7a-4f3a-9a7b-cd4f63514566 - name: extId in: path description: The globally unique identifier of a serial port of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: cafad429-84e2-42cb-8bcb-01db2364e93c - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: a41ef11e-7b62-42e1-ae08-e8e454810675 responses: "202": description: The request to remove a serial port from a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Delete operation" x-permissions: operationName: Delete Virtual Machine Serial Port deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 15 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.DeleteSerialPortByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteSerialPortApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"37aBEE3f-cC96-E53C-dabd-aAbfc0e6B9c7\";\n \n String\ \ extId = \"F1Fcddbc-fCc6-5CBc-A2c6-CbCC49Ad1E4e\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n DeleteSerialPortApiResponse deleteSerialPortApiResponse\ \ = vmApi.deleteSerialPortById(DeleteSerialPortByIdRequest.builder()\n \ \ .vmExtId(vmExtId)\n .extId(extId)\n \ \ .build());\n\n System.out.println(deleteSerialPortApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"af5cdEEF-12DA-ED1f-86C5-abCF4Dbf6eC4\";\n \n\ \ let extId = \"bB9C09Ca-5dF7-ea5d-Cd7A-3cb5ddFaF032\";\n\n\n\n\n\n \ \ vmApi.deleteSerialPortById(vmExtId, extId).then(({data, response}) =>\ \ {\n console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ a4dB41f2-aEce-ceed-AfcA-EC08eDD32dBa\"\n \n ext_id = \"68Ed1a28-2483-AdaD-A7dB-321F5Abd8eb0\"\ \n\n\n try:\n api_response = vm_api.delete_serial_port_by_id(vmExtId=vm_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"c963ddCc-dD7b-1e76-04dB-5D755dFBBfd8\"\ \n \n extId := \"7Cedb6Fe-F5fa-CcBA-d9cA-aCacfE4eB7f6\"\n\n\n request\ \ := vm.DeleteSerialPortByIdRequest{ VmExtId: &vmExtId, ExtId: &extId }\n\ \ response, error := VmServiceApiInstance.DeleteSerialPortById(ctx, &request)\n\ \ if error != nil {\n fmt.Println(error)\n return\n \ \ }\n data, _ := response.GetData().(import1.TaskReference)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/f4A8Aafc-a1e4-2edc-AaAC-e64d8412Aa8A/serial-ports/CE5acE9b-7A21-Fcda-ACc9-eDFeedDeCA6E" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/a4BA6AfC-Bc5d-ae9D-De3d-48Fe5feB7a3D/serial-ports/DdC2EDBe-aBBc-FC6B-24Dc-36D5f51eE3d8" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"DAeCe9f7-Bc30-A6Ef-D0bE-EFe7aDDeee7c\"\ ;\n String extId = \"a05daabe-1EAA-FE4E-01C4-DcB9D27eed39\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteSerialPortByIdRequest {\n VmExtId = vmExtId,\n \ \ ExtId = extId\n };\n try {\n DeleteSerialPortApiResponse\ \ deleteSerialPortApiResponse = vmApi.DeleteSerialPortById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports: get: tags: - Vm summary: List serial ports attached to a VM description: Lists the serial ports attached to a virtual machine. operationId: listSerialPortsByVmId parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: fef1fb24-df9c-448d-adae-dbd211a69e2f - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of serial ports attached to a VM. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Get operation" x-permissions: operationName: View Virtual Machine Serial Port deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: VPC Admin - name: Storage Admin - name: Network Infra Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 7 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.ListSerialPortsByVmIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListSerialPortsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n \n String vmExtId\ \ = \"DAbCCcE8-4CA5-774f-7Ca7-27BbbfC06FB3\";\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListSerialPortsApiResponse listSerialPortsApiResponse\ \ = vmApi.listSerialPortsByVmId(ListSerialPortsByVmIdRequest.builder()\n\ \ .vmExtId(vmExtId)\n .$page(page)\n \ \ .$limit(limit)\n .build());\n\n System.out.println(listSerialPortsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n\n \ \ \n let vmExtId = \"caA46937-4A69-20Ad-40A0-F4ba523Aeb9a\";\n\n //\ \ Construct Optional Parameters\n var opts = {};\n opts[\"$page\"\ ] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmApi.listSerialPortsByVmId(vmExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n \n vm_ext_id = \"\ EBaEAbDa-2EFb-dCDC-3fbf-78Cd9adAf1CE\"\n \n page = 0\n \n limit\ \ = 50\n\n\n try:\n api_response = vm_api.list_serial_ports_by_vm_id(vmExtId=vm_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n \n vmExtId := \"ADAf3ADC-beb9-aB63-4e0F-dDfE9fB7BdB8\"\ \n \n page_ := 0\n \n limit_ := 50\n\n\n request := vm.ListSerialPortsByVmIdRequest{\ \ VmExtId: &vmExtId, Page_: &page_, Limit_: &limit_ }\n response, error\ \ := VmServiceApiInstance.ListSerialPortsByVmId(ctx, &request)\n if error\ \ != nil {\n fmt.Println(error)\n return\n }\n data,\ \ _ := response.GetData().([]import1.SerialPort)\n fmt.Println(data)\n\ \n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/Bd0Fb3Af-FFc0-77de-E3E3-01bb9aA2f756/serial-ports?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/2FAFd6ac-ECcf-4Bce-0ADB-9D05ACFdb0eB/serial-ports?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n String vmExtId = \"bDAdC0b3-3B4f-2efD-F7ED-5C33F0C4CaDb\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListSerialPortsByVmIdRequest\ \ {\n VmExtId = vmExtId,\n Page = page,\n \ \ Limit = limit\n };\n try {\n ListSerialPortsApiResponse\ \ listSerialPortsApiResponse = vmApi.ListSerialPortsByVmId(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - Vm summary: Create a serial port for a VM description: Creates and attaches a serial port device to a virtual machine. operationId: createSerialPort parameters: - name: vmExtId in: path description: A globally unique identifier of a VM of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2c3ed9a6-7a20-46d1-9c2a-9575199dd490 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 90747197-9ed2-45a5-a918-2f5c34bd58e8 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' required: true responses: "202": description: The request to create a serial port for a VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Post operation" x-permissions: operationName: Create Virtual Machine Serial Port deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: User - name: Consumer - name: Developer - name: Operator - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 5 timeUnit: seconds - type: Small count: 8 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.8" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.Vm.CreateSerialPortRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.SerialPort;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateSerialPortApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmApi vmApi = new VmApi(apiClient);\n\n SerialPort serialPort\ \ = new SerialPort();\n\n // SerialPort object initializations here...\n\ \ \n String vmExtId = \"E37BcDa3-BFbe-caEC-3bde-9AFB7EC681aB\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n CreateSerialPortApiResponse\ \ createSerialPortApiResponse = vmApi.createSerialPort(CreateSerialPortRequest.builder()\n\ \ .vmExtId(vmExtId)\n .build(), serialPort);\n\ \n System.out.println(createSerialPortApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmApi, SerialPort } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmApi = new VmApi(apiClientInstance);\n\nfunction sample() {\n let\ \ serialPort = new SerialPort();\n\n // SerialPort object initializations\ \ here...\n serialPort = JSON.stringify(serialPort);\n\n \n let\ \ vmExtId = \"ECBCAF6e-df66-DF9a-16BD-cc3fffeff74e\";\n\n\n\n\n\n vmApi.createSerialPort(vmExtId,\ \ serialPort).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_api\ \ = ntnx_vmm_py_client.VmApi(api_client=client)\n serialPort = ntnx_vmm_py_client.SerialPort()\n\ \n # SerialPort object initializations here...\n \n vm_ext_id =\ \ \"2efCA730-d7AB-b4Fa-1ae2-fFcDD0afFe74\"\n\n\n try:\n api_response\ \ = vm_api.create_serial_port(vmExtId=vm_ext_id, body=serialPort)\n \ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vm\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmServiceApiInstance\ \ *api.VmServiceApi\n)\n\nfunc main() {\n ApiClientInstance = client.NewApiClient()\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n ApiClientInstance.Host\ \ = \"localhost\"\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n ApiClientInstance.Port\ \ = 9440\n // Interval in ms to use during retry attempts\n ApiClientInstance.RetryInterval\ \ = 5 * time.Second\n // Max retry attempts while reconnecting on a loss\ \ of connection\n ApiClientInstance.MaxRetryAttempts = 5\n // UserName\ \ to connect to the cluster\n ApiClientInstance.Username = \"username\"\ \n // Password to connect to the cluster\n ApiClientInstance.Password\ \ = \"password\"\n // Please add authorization information here if needed.\n\ \ VmServiceApiInstance = api.NewVmServiceApi(ApiClientInstance)\n \ \ ctx := context.Background()\n\n serialPort := import1.NewSerialPort()\n\ \n // SerialPort object initializations here...\n\n \n vmExtId\ \ := \"61FDa43F-aFB1-4594-Af72-AbDEBd3eCE2f\"\n\n\n request := vm.CreateSerialPortRequest{\ \ VmExtId: &vmExtId, Body: serialPort }\n response, error := VmServiceApiInstance.CreateSerialPort(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vms/a159e09D-a3e5-Eaeb-9fba-ffAdC4Aed37E/serial-ports" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vms/Cd4fD6E9-dfCa-5bc6-2A57-bfaf6c6f54B8/serial-ports" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmApi vmApi = new\ \ VmApi(client);\n\n SerialPort serialPort = new SerialPort();\n\n\ \ // SerialPort object initializations here...\n\n String vmExtId\ \ = \"328FEddA-1FCE-9aDe-e5e8-b5bE9fBEA4a5\";\n\n // Create request\ \ object with parameters\n var request = new CreateSerialPortRequest\ \ {\n VmExtId = vmExtId,\n Body = serialPort\n \ \ };\n try {\n CreateSerialPortApiResponse createSerialPortApiResponse\ \ = vmApi.CreateSerialPort(request);\n } catch (ApiException ex)\ \ {\n Console.WriteLine(ex.Message);\n }\n }\n }\n\ }\n" /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}: get: tags: - VmAntiAffinityPolicies summary: Get VM-VM anti-affinity policy based on the provided external identifier description: Fetches the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier. operationId: getVmAntiAffinityPolicyById parameters: - name: extId in: path description: A globally unique identifier of a VM-VM anti-affinity policy of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 55a67b7b-0632-411c-b07c-0038ba46478b responses: "200": description: Returns the requested VM-VM anti-affinity policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicy' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Get operation" x-permissions: operationName: View VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.GetVmAntiAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmAntiAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n \n String extId = \"0EEbFA38-3Eb3-2a45-3baE-E3dCaC57CBFE\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetVmAntiAffinityPolicyApiResponse\ \ getVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.getVmAntiAffinityPolicyById(GetVmAntiAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getVmAntiAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmAntiAffinityPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"8F4DdbAA-616B-AbDd-DaDE-1e51D4aebA6e\"\ ;\n\n\n\n\n\n vmAntiAffinityPoliciesApi.getVmAntiAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ \n ext_id = \"c97CE7b7-D5e4-f19D-99B1-089BAC0688d6\"\n\n\n try:\n\ \ api_response = vm_anti_affinity_policies_api.get_vm_anti_affinity_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"fadA1cEA-Cb2A-F0fE-ceae-df88A2f36dD3\"\ \n\n\n request := vmantiaffinitypolicies.GetVmAntiAffinityPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := VmAntiAffinityPoliciesServiceApiInstance.GetVmAntiAffinityPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmAntiAffinityPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/bc3dCCae-267D-6bBc-17dB-5dC7ff8ca32d" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/f8b2E1b5-5e2C-f51D-c7D7-FC222d18fb9D" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmAntiAffinityPoliciesApi\ \ vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\n\ \ String extId = \"23Fdaced-6DeB-2D74-5deb-f1d5Ef7Ac6DC\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetVmAntiAffinityPolicyByIdRequest {\n ExtId = extId\n \ \ };\n try {\n GetVmAntiAffinityPolicyApiResponse getVmAntiAffinityPolicyApiResponse\ \ = vmAntiAffinityPoliciesApi.GetVmAntiAffinityPolicyById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - VmAntiAffinityPolicies summary: Update VM-VM anti-affinity policy description: Updates the requested VM-VM anti-affinity policy. operationId: updateVmAntiAffinityPolicyById parameters: - name: extId in: path description: A globally unique identifier of a VM-VM anti-affinity policy of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 99bf2231-a7d6-4b24-a53b-a48525f7df6c - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 3b416db0-fe8d-491e-83de-c953b3c47426 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicy' required: true responses: "202": description: The request to update the VM-VM anti-affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Put operation" x-permissions: operationName: Update VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.UpdateVmAntiAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.GetVmAntiAffinityPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.policies.VmAntiAffinityPolicy;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmAntiAffinityPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.UpdateVmAntiAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n VmAntiAffinityPolicy vmAntiAffinityPolicy = new VmAntiAffinityPolicy();\n\ \n // VmAntiAffinityPolicy object initializations here...\n \ \ \n String extId = \"f093eADA-ee2d-F90E-18dB-A1A027ffdeD5\";\n\ \n // perform GET call\n GetVmAntiAffinityPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = vmAntiAffinityPoliciesApi.getVmAntiAffinityPolicyById(GetVmAntiAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateVmAntiAffinityPolicyApiResponse\ \ updateVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.updateVmAntiAffinityPolicyById(UpdateVmAntiAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), vmAntiAffinityPolicy,\ \ opts);\n\n System.out.println(updateVmAntiAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmAntiAffinityPoliciesApi, VmAntiAffinityPolicy,\ \ GetVmAntiAffinityPolicyApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let vmAntiAffinityPolicy = new VmAntiAffinityPolicy();\n\ \n // VmAntiAffinityPolicy object initializations here...\n vmAntiAffinityPolicy\ \ = JSON.stringify(vmAntiAffinityPolicy);\n\n \n let extId = \"c324BD35-aEad-FccB-Fc3d-acD6b7C7b4aA\"\ ;\n\n\n // Perform Get call\n vmAntiAffinityPoliciesApi.getVmAntiAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmAntiAffinityPoliciesApi.updateVmAntiAffinityPolicyById(extId,\ \ vmAntiAffinityPolicy, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n\ \ console.log(`Error is: ${error}`);\n });\n });\n\n\ }\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ vmAntiAffinityPolicy = ntnx_vmm_py_client.VmAntiAffinityPolicy()\n\n\ \ # VmAntiAffinityPolicy object initializations here...\n \n ext_id\ \ = \"efCbCA4C-f4BE-CDBe-8a9D-fff72A5bc3D8\"\n\n try:\n api_response\ \ = vm_anti_affinity_policies_api.get_vm_anti_affinity_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_anti_affinity_policies_api.update_vm_anti_affinity_policy_by_id(extId=ext_id,\ \ body=vmAntiAffinityPolicy, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n vmAntiAffinityPolicy := import1.NewVmAntiAffinityPolicy()\n\ \n // VmAntiAffinityPolicy object initializations here...\n\n \n \ \ extId := \"1faDBdFf-Aa8A-e4D8-31ad-aFe9eD84fDC5\"\n\n getRequest\ \ := vmantiaffinitypolicies.GetVmAntiAffinityPolicyByIdRequest{ extId: &extId\ \ }\n getResponse, err := VmAntiAffinityPoliciesServiceApiInstance.GetVmAntiAffinityPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmantiaffinitypolicies.UpdateVmAntiAffinityPolicyByIdRequest{\ \ ExtId: &extId, Body: vmAntiAffinityPolicy }\n response, error := VmAntiAffinityPoliciesServiceApiInstance.UpdateVmAntiAffinityPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/cf9A3d3F-0911-bDF5-A6c5-Ac5780ddC7A8" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestAntiAffinitypolicy","description":"Descriptionforyourantiaffinitypolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"$objectType":"vmm.v4.ahv.policies.VmAntiAffinityPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestAntiAffinitypolicy","description":"Descriptionforyourantiaffinitypolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"$objectType":"vmm.v4.ahv.policies.VmAntiAffinityPolicy"} \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/6dd5294A-e7bC-E9EF-aD17-e4A6AeD0Aca8" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Policies;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\ \n VmAntiAffinityPolicy vmAntiAffinityPolicy = new VmAntiAffinityPolicy();\n\ \n // VmAntiAffinityPolicy object initializations here...\n\n \ \ String extId = \"cb994F8C-EE9F-e23F-FEDB-6ACF8eBB63f5\";\n\n //\ \ perform GET call\n var getRequest = new GetVmAntiAffinityPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmAntiAffinityPolicyApiResponse\ \ getResponse = vmAntiAffinityPoliciesApi.GetVmAntiAffinityPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateVmAntiAffinityPolicyByIdRequest {\n ExtId\ \ = extId,\n Body = vmAntiAffinityPolicy,\n \n \ \ \n };\n try {\n UpdateVmAntiAffinityPolicyApiResponse\ \ updateVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.UpdateVmAntiAffinityPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - VmAntiAffinityPolicies summary: Delete VM-VM anti-affinity policy description: Deletes the requested VM-VM anti-affinity policy. operationId: deleteVmAntiAffinityPolicyById parameters: - name: extId in: path description: A globally unique identifier of a VM-VM anti-affinity policy of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8a16b348-2338-4f34-bdee-94ec7c58316b - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 5d1830f1-c221-42d8-838c-ada9abfbf9bf responses: "202": description: The request to delete the policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.DeleteVmAntiAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.GetVmAntiAffinityPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmAntiAffinityPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.DeleteVmAntiAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n \n String extId = \"aCaB7Cce-cd8C-EEAe-5C77-DDa0Fa9eCf0c\"\ ;\n\n // perform GET call\n GetVmAntiAffinityPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = vmAntiAffinityPoliciesApi.getVmAntiAffinityPolicyById(GetVmAntiAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteVmAntiAffinityPolicyApiResponse\ \ deleteVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.deleteVmAntiAffinityPolicyById(DeleteVmAntiAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(deleteVmAntiAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmAntiAffinityPoliciesApi, GetVmAntiAffinityPolicyApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"d15C7A8B-DdfC-9BCa-d2fc-dE3880AcF2fB\"\ ;\n\n\n // Perform Get call\n vmAntiAffinityPoliciesApi.getVmAntiAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmAntiAffinityPoliciesApi.deleteVmAntiAffinityPolicyById(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ \n ext_id = \"d8AAEAfb-1ADa-aaAc-Eb4b-D50c6EbEd77b\"\n\n try:\n\ \ api_response = vm_anti_affinity_policies_api.get_vm_anti_affinity_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_anti_affinity_policies_api.delete_vm_anti_affinity_policy_by_id(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"7C3D37DB-a522-dFFF-aDff-2aBFdBFFe174\"\ \n\n getRequest := vmantiaffinitypolicies.GetVmAntiAffinityPolicyByIdRequest{\ \ extId: &extId }\n getResponse, err := VmAntiAffinityPoliciesServiceApiInstance.GetVmAntiAffinityPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmantiaffinitypolicies.DeleteVmAntiAffinityPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := VmAntiAffinityPoliciesServiceApiInstance.DeleteVmAntiAffinityPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/3EAFFeAe-6B1B-BeCC-cEe6-CB31cF3aB7ec" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/2bfdD6dC-c4Bf-f21e-2DB7-CEf14ACF3a4e" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Policies;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\ \n String extId = \"4FE2A9f5-61EE-7c2a-9deA-242dDd7E2fA9\";\n\n \ \ // perform GET call\n var getRequest = new GetVmAntiAffinityPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmAntiAffinityPolicyApiResponse\ \ getResponse = vmAntiAffinityPoliciesApi.GetVmAntiAffinityPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new DeleteVmAntiAffinityPolicyByIdRequest {\n ExtId\ \ = extId,\n \n \n };\n try {\n \ \ DeleteVmAntiAffinityPolicyApiResponse deleteVmAntiAffinityPolicyApiResponse\ \ = vmAntiAffinityPoliciesApi.DeleteVmAntiAffinityPolicyById(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-anti-affinity-policies: get: tags: - VmAntiAffinityPolicies summary: List VM-VM anti-affinity policies description: List VM-VM anti-affinity policies. operationId: listVmAntiAffinityPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies?$filter=name\ \ eq 'Test Anti Affinity policy'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies?$orderby=name" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies?$orderby=updateTime" responses: "200": description: Returns the list of VM-VM anti-affinity policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Get operation x-permissions: operationName: View VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.ListVmAntiAffinityPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmAntiAffinityPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmAntiAffinityPoliciesApiResponse\ \ listVmAntiAffinityPoliciesApiResponse = vmAntiAffinityPoliciesApi.listVmAntiAffinityPolicies(ListVmAntiAffinityPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .build());\n\n System.out.println(listVmAntiAffinityPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmAntiAffinityPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; vmAntiAffinityPoliciesApi.listVmAntiAffinityPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_anti_affinity_policies_api.list_vm_anti_affinity_policies(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vmantiaffinitypolicies.ListVmAntiAffinityPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil }\n response,\ \ error := VmAntiAffinityPoliciesServiceApiInstance.ListVmAntiAffinityPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmAntiAffinityPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmAntiAffinityPoliciesApi\ \ vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\n\ \ int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n\n // Create request\ \ object with parameters\n var request = new ListVmAntiAffinityPoliciesRequest\ \ {\n Page = page,\n Limit = limit,\n Filter\ \ = filter,\n Orderby = orderby\n };\n try {\n\ \ ListVmAntiAffinityPoliciesApiResponse listVmAntiAffinityPoliciesApiResponse\ \ = vmAntiAffinityPoliciesApi.ListVmAntiAffinityPolicies(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - VmAntiAffinityPolicies summary: Create VM-VM anti-affinity policy description: Creates a VM-VM anti-affinity policy. operationId: createVmAntiAffinityPolicy parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: dfcf3a89-124b-4bd1-872b-83654713bb06 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicy' required: true responses: "202": description: The request to create the VM-VM anti-affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Post operation x-permissions: operationName: Create VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi; import com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.CreateVmAntiAffinityPolicyRequest; import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.VmAntiAffinityPolicy; import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.CreateVmAntiAffinityPolicyApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient); VmAntiAffinityPolicy vmAntiAffinityPolicy = new VmAntiAffinityPolicy(); // VmAntiAffinityPolicy object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateVmAntiAffinityPolicyApiResponse createVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.createVmAntiAffinityPolicy(CreateVmAntiAffinityPolicyRequest.builder() .build(), vmAntiAffinityPolicy); System.out.println(createVmAntiAffinityPolicyApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, VmAntiAffinityPoliciesApi, VmAntiAffinityPolicy } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance); function sample() { let vmAntiAffinityPolicy = new VmAntiAffinityPolicy(); // VmAntiAffinityPolicy object initializations here... vmAntiAffinityPolicy = JSON.stringify(vmAntiAffinityPolicy); vmAntiAffinityPoliciesApi.createVmAntiAffinityPolicy(vmAntiAffinityPolicy).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) vm_anti_affinity_policies_api = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client) vmAntiAffinityPolicy = ntnx_vmm_py_client.VmAntiAffinityPolicy() # VmAntiAffinityPolicy object initializations here... try: api_response = vm_anti_affinity_policies_api.create_vm_anti_affinity_policy(body=vmAntiAffinityPolicy) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient VmAntiAffinityPoliciesServiceApiInstance *api.VmAntiAffinityPoliciesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance) ctx := context.Background() vmAntiAffinityPolicy := import1.NewVmAntiAffinityPolicy() // VmAntiAffinityPolicy object initializations here... request := vmantiaffinitypolicies.CreateVmAntiAffinityPolicyRequest{ Body: vmAntiAffinityPolicy } response, error := VmAntiAffinityPoliciesServiceApiInstance.CreateVmAntiAffinityPolicy(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestAntiAffinitypolicy","description":"Descriptionforyourantiaffinitypolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"$objectType":"vmm.v4.ahv.policies.VmAntiAffinityPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestAntiAffinitypolicy","description":"Descriptionforyourantiaffinitypolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"$objectType":"vmm.v4.ahv.policies.VmAntiAffinityPolicy"} \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmAntiAffinityPoliciesApi\ \ vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\n\ \ VmAntiAffinityPolicy vmAntiAffinityPolicy = new VmAntiAffinityPolicy();\n\ \n // VmAntiAffinityPolicy object initializations here...\n\n\n \ \ // Create request object with parameters\n var request = new\ \ CreateVmAntiAffinityPolicyRequest {\n Body = vmAntiAffinityPolicy\n\ \ };\n try {\n CreateVmAntiAffinityPolicyApiResponse\ \ createVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.CreateVmAntiAffinityPolicy(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{vmAntiAffinityPolicyExtId}/vm-compliance-states: get: tags: - VmAntiAffinityPolicies summary: List compliance states of VMs in the VM-VM anti-affinity policy based on the provided external identifier description: Lists compliance states of VMs in the VM-VM anti-affinity policy of the provided VM-VM anti-affinity policy external identifier. operationId: listVmAntiAffinityPolicyVmComplianceStates parameters: - name: vmAntiAffinityPolicyExtId in: path description: A globally unique identifier of a VM-VM anti-affinity policy of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 7b3b1a6b-5457-485e-8402-2c349ba7f4c7 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns a list of requested complaince states of VMs. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicyVmComplianceState' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{vmAntiAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{vmAntiAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{vmAntiAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" x-permissions: operationName: View VM Anti Affinity Policy VM Compliance States deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.ListVmAntiAffinityPolicyVmComplianceStatesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmAntiAffinityPolicyVmComplianceStatesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n \n String vmAntiAffinityPolicyExtId = \"BCBA06B8-De5c-d9bB-692b-DEBa2ed80d2c\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmAntiAffinityPolicyVmComplianceStatesApiResponse\ \ listVmAntiAffinityPolicyVmComplianceStatesApiResponse = vmAntiAffinityPoliciesApi.listVmAntiAffinityPolicyVmComplianceStates(ListVmAntiAffinityPolicyVmComplianceStatesRequest.builder()\n\ \ .vmAntiAffinityPolicyExtId(vmAntiAffinityPolicyExtId)\n\ \ .$page(page)\n .$limit(limit)\n \ \ .build());\n\n System.out.println(listVmAntiAffinityPolicyVmComplianceStatesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmAntiAffinityPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmAntiAffinityPolicyExtId = \"B0A94dDf-1eaF-aeCE-8e68-B1ecfaCf9b5F\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmAntiAffinityPoliciesApi.listVmAntiAffinityPolicyVmComplianceStates(vmAntiAffinityPolicyExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ \n vm_anti_affinity_policy_ext_id = \"a86cA8da-705D-Adfa-3dAD-252FAAe2f9B6\"\ \n \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_anti_affinity_policies_api.list_vm_anti_affinity_policy_vm_compliance_states(vmAntiAffinityPolicyExtId=vm_anti_affinity_policy_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmAntiAffinityPolicyExtId\ \ := \"F3bfF72d-D6Bd-CEf1-c6f4-4794Dce7d4Ac\"\n \n page_ := 0\n \ \ \n limit_ := 50\n\n\n request := vmantiaffinitypolicies.ListVmAntiAffinityPolicyVmComplianceStatesRequest{\ \ VmAntiAffinityPolicyExtId: &vmAntiAffinityPolicyExtId, Page_: &page_,\ \ Limit_: &limit_ }\n response, error := VmAntiAffinityPoliciesServiceApiInstance.ListVmAntiAffinityPolicyVmComplianceStates(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmAntiAffinityPolicyVmComplianceState)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/ffa2c8bc-E9e6-baad-F1F7-cdd3aeAa20E3/vm-compliance-states?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-anti-affinity-policies/23d3DeD0-dF43-Ea8e-a4E4-fadcaAeA37c7/vm-compliance-states?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmAntiAffinityPoliciesApi\ \ vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\n\ \ String vmAntiAffinityPolicyExtId = \"4fcb6bdA-dFfE-5CAa-c6fD-B013Ddef74bB\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListVmAntiAffinityPolicyVmComplianceStatesRequest\ \ {\n VmAntiAffinityPolicyExtId = vmAntiAffinityPolicyExtId,\n\ \ Page = page,\n Limit = limit\n };\n \ \ try {\n ListVmAntiAffinityPolicyVmComplianceStatesApiResponse\ \ listVmAntiAffinityPolicyVmComplianceStatesApiResponse = vmAntiAffinityPoliciesApi.ListVmAntiAffinityPolicyVmComplianceStates(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies: get: tags: - VmAntiAffinityPolicies summary: List legacy VM-VM anti-affinity policies description: List legacy VM-VM anti-affinity policies. The legacy VM-VM anti-affinity policies refer to the anti-affinity policies configured using VM groups through aCLI in Prism Element. operationId: listLegacyVmAntiAffinityPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies?$filter=name\ \ eq 'Legacy VM anti affinity policy'" responses: "200": description: Returns a list of legacy VM-VM anti-affinity policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.LegacyVmAntiAffinityPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies Get operation x-permissions: operationName: View Legacy VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.ListLegacyVmAntiAffinityPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListLegacyVmAntiAffinityPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListLegacyVmAntiAffinityPoliciesApiResponse\ \ listLegacyVmAntiAffinityPoliciesApiResponse = vmAntiAffinityPoliciesApi.listLegacyVmAntiAffinityPolicies(ListLegacyVmAntiAffinityPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .build());\n\n System.out.println(listLegacyVmAntiAffinityPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmAntiAffinityPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; vmAntiAffinityPoliciesApi.listLegacyVmAntiAffinityPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_anti_affinity_policies_api.list_legacy_vm_anti_affinity_policies(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vmantiaffinitypolicies.ListLegacyVmAntiAffinityPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil }\n response, error :=\ \ VmAntiAffinityPoliciesServiceApiInstance.ListLegacyVmAntiAffinityPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.LegacyVmAntiAffinityPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies?$filter=string_sample_data&$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies?$filter=string_sample_data&$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmAntiAffinityPoliciesApi\ \ vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\n\ \ int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n\n // Create request object with parameters\n var request\ \ = new ListLegacyVmAntiAffinityPoliciesRequest {\n Page = page,\n\ \ Limit = limit,\n Filter = filter\n };\n \ \ try {\n ListLegacyVmAntiAffinityPoliciesApiResponse listLegacyVmAntiAffinityPoliciesApiResponse\ \ = vmAntiAffinityPoliciesApi.ListLegacyVmAntiAffinityPolicies(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/{extId}: delete: tags: - VmAntiAffinityPolicies summary: Delete legacy VM-VM anti-affinity policy description: Deletes the legacy VM-VM anti-affinity policy. The legacy VM-VM anti-affinity policies refer to the anti-affinity policies configured using VM groups through aCLI in Prism Element. operationId: deleteLegacyVmAntiAffinityPolicyById parameters: - name: extId in: path description: External ID of the legacy VM-VM Anti-Affinity policy of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5f5cfdd1-ac52-45e0-a0a0-f269d7f5be6a - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: f27ab5b6-625f-4112-b783-4d066e9d5541 responses: "202": description: The request to delete a legacy VM-VM anti-affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete Legacy VM Anti Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "7.0" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmAntiAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmAntiAffinityPolicies.DeleteLegacyVmAntiAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.DeleteLegacyVmAntiAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmAntiAffinityPoliciesApi vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClient);\n\ \n \n String extId = \"0efD33C1-cAeA-a39D-ccd1-daeceAaffAbA\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteLegacyVmAntiAffinityPolicyApiResponse\ \ deleteLegacyVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.deleteLegacyVmAntiAffinityPolicyById(DeleteLegacyVmAntiAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(deleteLegacyVmAntiAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmAntiAffinityPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"b7F1ebDe-cA28-1BbB-2FAB-C2bc34C7A889\"\ ;\n\n\n\n\n\n vmAntiAffinityPoliciesApi.deleteLegacyVmAntiAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_anti_affinity_policies_api\ \ = ntnx_vmm_py_client.VmAntiAffinityPoliciesApi(api_client=client)\n \ \ \n ext_id = \"22eaaaE9-38cE-BEEC-d1F1-50acE99C4aCc\"\n\n\n try:\n\ \ api_response = vm_anti_affinity_policies_api.delete_legacy_vm_anti_affinity_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmantiaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmAntiAffinityPoliciesServiceApiInstance\ \ *api.VmAntiAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmAntiAffinityPoliciesServiceApiInstance = api.NewVmAntiAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"fd9fccB6-3D31-d9EC-DcDd-c0dAdCAcB4ac\"\ \n\n\n request := vmantiaffinitypolicies.DeleteLegacyVmAntiAffinityPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := VmAntiAffinityPoliciesServiceApiInstance.DeleteLegacyVmAntiAffinityPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/f3fa9FDF-DAF5-aEae-a0ED-33c2C4BEbBAA" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/6891031C-43aB-AbC8-8A26-E0BD11a94bF7" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmAntiAffinityPoliciesApi\ \ vmAntiAffinityPoliciesApi = new VmAntiAffinityPoliciesApi(client);\n\n\ \ String extId = \"6fa414AE-c5b0-aefc-5E7f-E7DA7ccE5AA9\";\n\n \ \ // Create request object with parameters\n var request = new\ \ DeleteLegacyVmAntiAffinityPolicyByIdRequest {\n ExtId = extId\n\ \ };\n try {\n DeleteLegacyVmAntiAffinityPolicyApiResponse\ \ deleteLegacyVmAntiAffinityPolicyApiResponse = vmAntiAffinityPoliciesApi.DeleteLegacyVmAntiAffinityPolicyById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}: get: tags: - VmGuestCustomizationProfiles summary: Get the VM Guest Customization Profile configuration based on the provided external identifier description: Retrieves the VM Guest Customization Profile configuration of the provided VM Guest Customization Profile external identifier. operationId: getVmGuestCustomizationProfileById parameters: - name: extId in: path description: A globally unique identifier of a VM Guest Customization Profile in UUID format. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 48fc7321-2cb9-48c7-afb0-4762dd4d1c71 responses: "200": description: Returns the VM Guest Customization Profile details. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationProfile' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Get operation" x-permissions: operationName: View VM Guest Customization Profile deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 12 timeUnit: seconds - type: Large count: 15 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmGuestCustomizationProfilesApi;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.GetVmGuestCustomizationProfileByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetVmGuestCustomizationProfileApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi = new\ \ VmGuestCustomizationProfilesApi(apiClient);\n\n \n String\ \ extId = \"efb099cd-Cc05-1bFe-Bfa8-B1A6F1F6bcf2\";\n\n try {\n \ \ // Pass in parameters using the request builder object associated\ \ with the operation.\n GetVmGuestCustomizationProfileApiResponse\ \ getVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.getVmGuestCustomizationProfileById(GetVmGuestCustomizationProfileByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getVmGuestCustomizationProfileApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmGuestCustomizationProfilesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"b5bb9f1e-DFeB-fe6F-ac0F-dA7BeB0a5d0E\"\ ;\n\n\n\n\n\n vmGuestCustomizationProfilesApi.getVmGuestCustomizationProfileById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_guest_customization_profiles_api\ \ = ntnx_vmm_py_client.VmGuestCustomizationProfilesApi(api_client=client)\n\ \ \n ext_id = \"A2daCa7d-Ee3D-3afC-A8ff-Ba9C5bDf82FC\"\n\n\n try:\n\ \ api_response = vm_guest_customization_profiles_api.get_vm_guest_customization_profile_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmguestcustomizationprofiles\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmGuestCustomizationProfilesServiceApiInstance\ \ *api.VmGuestCustomizationProfilesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmGuestCustomizationProfilesServiceApiInstance = api.NewVmGuestCustomizationProfilesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"149DfF6A-F9bD-ed5B-f7Aa-1bC11bfbD028\"\ \n\n\n request := vmguestcustomizationprofiles.GetVmGuestCustomizationProfileByIdRequest{\ \ ExtId: &extId }\n response, error := VmGuestCustomizationProfilesServiceApiInstance.GetVmGuestCustomizationProfileById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmGuestCustomizationProfile)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles/C4EAB5a6-59Fc-AAf5-2Bb9-6aeaBf9acbfa" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles/63d6398f-DcE4-DED8-CDf7-ebAf5aDcdCFb" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmGuestCustomizationProfilesApi\ \ vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(client);\n\ \n String extId = \"bfE19cAD-CaCf-Dfd6-CBDF-Cf7CC41aabd3\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetVmGuestCustomizationProfileByIdRequest {\n ExtId = extId\n\ \ };\n try {\n GetVmGuestCustomizationProfileApiResponse\ \ getVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.GetVmGuestCustomizationProfileById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - VmGuestCustomizationProfiles summary: Update VM Guest Customization Profile description: Updates the specified VM Guest Customization Profile. operationId: updateVmGuestCustomizationProfileById parameters: - name: extId in: path description: A globally unique identifier of a VM Guest Customization Profile in UUID format. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 654b05f3-124a-47d2-ba1a-b97128e001ec - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 68001aeb-7896-4ad8-827f-a3ecb8c505e3 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationProfile' required: true responses: "202": description: The request to update the VM Guest Customization Profile is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Put operation" x-permissions: operationName: Update VM Guest Customization Profile deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmGuestCustomizationProfilesApi;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.UpdateVmGuestCustomizationProfileByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.GetVmGuestCustomizationProfileByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.VmGuestCustomizationProfile;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetVmGuestCustomizationProfileApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.UpdateVmGuestCustomizationProfileApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi = new\ \ VmGuestCustomizationProfilesApi(apiClient);\n\n VmGuestCustomizationProfile\ \ vmGuestCustomizationProfile = new VmGuestCustomizationProfile();\n\n \ \ // VmGuestCustomizationProfile object initializations here...\n\ \ \n String extId = \"c7A36bce-B1fa-fadF-FA0f-cd8A4bcB8E73\"\ ;\n\n // perform GET call\n GetVmGuestCustomizationProfileApiResponse\ \ getResponse = null;\n try {\n getResponse = vmGuestCustomizationProfilesApi.getVmGuestCustomizationProfileById(GetVmGuestCustomizationProfileByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateVmGuestCustomizationProfileApiResponse\ \ updateVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.updateVmGuestCustomizationProfileById(UpdateVmGuestCustomizationProfileByIdRequest.builder()\n\ \ .extId(extId)\n .build(), vmGuestCustomizationProfile,\ \ opts);\n\n System.out.println(updateVmGuestCustomizationProfileApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmGuestCustomizationProfilesApi, VmGuestCustomizationProfile,\ \ GetVmGuestCustomizationProfileApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(apiClientInstance);\n\ \nfunction sample() {\n let vmGuestCustomizationProfile = new VmGuestCustomizationProfile();\n\ \n // VmGuestCustomizationProfile object initializations here...\n \ \ vmGuestCustomizationProfile = JSON.stringify(vmGuestCustomizationProfile);\n\ \n \n let extId = \"D64ffC2e-fC2b-8736-B19d-dCCcF6BD59E0\";\n\n\n\ \ // Perform Get call\n vmGuestCustomizationProfilesApi.getVmGuestCustomizationProfileById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmGuestCustomizationProfilesApi.updateVmGuestCustomizationProfileById(extId,\ \ vmGuestCustomizationProfile, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n\ \ console.log(`Error is: ${error}`);\n });\n });\n\n\ }\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_guest_customization_profiles_api\ \ = ntnx_vmm_py_client.VmGuestCustomizationProfilesApi(api_client=client)\n\ \ vmGuestCustomizationProfile = ntnx_vmm_py_client.VmGuestCustomizationProfile()\n\ \n # VmGuestCustomizationProfile object initializations here...\n \ \ \n ext_id = \"A1C32edC-EdfC-4FaF-d9bC-deF1cbEbc7Ec\"\n\n try:\n\ \ api_response = vm_guest_customization_profiles_api.get_vm_guest_customization_profile_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_guest_customization_profiles_api.update_vm_guest_customization_profile_by_id(extId=ext_id,\ \ body=vmGuestCustomizationProfile, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmguestcustomizationprofiles\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmGuestCustomizationProfilesServiceApiInstance\ \ *api.VmGuestCustomizationProfilesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmGuestCustomizationProfilesServiceApiInstance = api.NewVmGuestCustomizationProfilesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n vmGuestCustomizationProfile := import1.NewVmGuestCustomizationProfile()\n\ \n // VmGuestCustomizationProfile object initializations here...\n\n\ \ \n extId := \"BFF7A94A-34ed-ff0a-91Db-Ef43Bcc5DA5a\"\n\n getRequest\ \ := vmguestcustomizationprofiles.GetVmGuestCustomizationProfileByIdRequest{\ \ extId: &extId }\n getResponse, err := VmGuestCustomizationProfilesServiceApiInstance.GetVmGuestCustomizationProfileById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmguestcustomizationprofiles.UpdateVmGuestCustomizationProfileByIdRequest{\ \ ExtId: &extId, Body: vmGuestCustomizationProfile }\n response, error\ \ := VmGuestCustomizationProfilesServiceApiInstance.UpdateVmGuestCustomizationProfileById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles/6DcadeFb-DDFD-c7Cf-DAB3-59b7f5eDB3AE" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"WindowsProfile","description":"DescriptionforyourGuestCustomizationProfile","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"config":{"customization":{"generalSettings":{"computerName":{},"timezone":"GreenwichStandardTime","administratorPassword":"abc@123","autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettings"},"windowsProductKey":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","registeredOwner":"Admin","registeredOrganization":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettings"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":"en-US","systemLocale":"en-US","uiLanguage":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettings"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroup"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfig"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfig"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettings"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParams"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfig"},"$objectType":"vmm.v4.ahv.config.VmGuestCustomizationProfile"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"WindowsProfile","description":"DescriptionforyourGuestCustomizationProfile","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"config":{"customization":{"generalSettings":{"computerName":{},"timezone":"GreenwichStandardTime","administratorPassword":"abc@123","autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettings"},"windowsProductKey":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","registeredOwner":"Admin","registeredOrganization":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettings"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":"en-US","systemLocale":"en-US","uiLanguage":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettings"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroup"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfig"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfig"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettings"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParams"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfig"},"$objectType":"vmm.v4.ahv.config.VmGuestCustomizationProfile"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles/D9abdF6b-3b65-a73b-dEd6-18C71Aab8B6B" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Config;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi =\ \ new VmGuestCustomizationProfilesApi(client);\n\n VmGuestCustomizationProfile\ \ vmGuestCustomizationProfile = new VmGuestCustomizationProfile();\n\n \ \ // VmGuestCustomizationProfile object initializations here...\n\n\ \ String extId = \"DFc85116-347B-0bFa-EAAB-Aa7d55e20cfe\";\n\n \ \ // perform GET call\n var getRequest = new GetVmGuestCustomizationProfileByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmGuestCustomizationProfileApiResponse\ \ getResponse = vmGuestCustomizationProfilesApi.GetVmGuestCustomizationProfileById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateVmGuestCustomizationProfileByIdRequest {\n \ \ ExtId = extId,\n Body = vmGuestCustomizationProfile,\n\ \ \n \n };\n try {\n UpdateVmGuestCustomizationProfileApiResponse\ \ updateVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.UpdateVmGuestCustomizationProfileById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - VmGuestCustomizationProfiles summary: Delete VM Guest Customization Profile description: Deletes the specified VM Guest Customization Profile. operationId: deleteVmGuestCustomizationProfileById parameters: - name: extId in: path description: A globally unique identifier of a VM Guest Customization Profile in UUID format. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 8e4f09ad-cdde-4e3c-b02c-bb62435bb3ee - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: df143fae-4761-4c15-9078-795855c3a17b responses: "202": description: The request to delete the specific VM Guest Customization Profile is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Delete operation" x-permissions: operationName: Delete VM Guest Customization Profile deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmGuestCustomizationProfilesApi;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.DeleteVmGuestCustomizationProfileByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.GetVmGuestCustomizationProfileByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetVmGuestCustomizationProfileApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteVmGuestCustomizationProfileApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi = new\ \ VmGuestCustomizationProfilesApi(apiClient);\n\n \n String\ \ extId = \"efbDF7f4-E0df-5E9B-a61A-BF4F3a9F0aCc\";\n\n // perform\ \ GET call\n GetVmGuestCustomizationProfileApiResponse getResponse\ \ = null;\n try {\n getResponse = vmGuestCustomizationProfilesApi.getVmGuestCustomizationProfileById(GetVmGuestCustomizationProfileByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteVmGuestCustomizationProfileApiResponse\ \ deleteVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.deleteVmGuestCustomizationProfileById(DeleteVmGuestCustomizationProfileByIdRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(deleteVmGuestCustomizationProfileApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmGuestCustomizationProfilesApi, GetVmGuestCustomizationProfileApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"a8cBBb59-41Db-93Cb-Fd36-fDA9d5BCf90F\"\ ;\n\n\n // Perform Get call\n vmGuestCustomizationProfilesApi.getVmGuestCustomizationProfileById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmGuestCustomizationProfilesApi.deleteVmGuestCustomizationProfileById(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_guest_customization_profiles_api\ \ = ntnx_vmm_py_client.VmGuestCustomizationProfilesApi(api_client=client)\n\ \ \n ext_id = \"af5dEbB7-ebF1-B8c8-Ec4a-A7ff2bFcBcf2\"\n\n try:\n\ \ api_response = vm_guest_customization_profiles_api.get_vm_guest_customization_profile_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_guest_customization_profiles_api.delete_vm_guest_customization_profile_by_id(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmguestcustomizationprofiles\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmGuestCustomizationProfilesServiceApiInstance\ \ *api.VmGuestCustomizationProfilesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmGuestCustomizationProfilesServiceApiInstance = api.NewVmGuestCustomizationProfilesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"ef4DFDA2-aD1f-FD3A-7c4b-CCbC5A9aA770\"\ \n\n getRequest := vmguestcustomizationprofiles.GetVmGuestCustomizationProfileByIdRequest{\ \ extId: &extId }\n getResponse, err := VmGuestCustomizationProfilesServiceApiInstance.GetVmGuestCustomizationProfileById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmguestcustomizationprofiles.DeleteVmGuestCustomizationProfileByIdRequest{\ \ ExtId: &extId }\n response, error := VmGuestCustomizationProfilesServiceApiInstance.DeleteVmGuestCustomizationProfileById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles/7Edc89aA-a4a5-aCff-3b54-Cff8cec3DCC0" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles/AFc5BF7a-bF0e-a8eb-A1dF-7d72eAC6dbc0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Config;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi =\ \ new VmGuestCustomizationProfilesApi(client);\n\n String extId = \"\ Dc2Ec26e-bfE8-CAaD-Dc1d-7dB9BCcE9C2C\";\n\n // perform GET call\n\ \ var getRequest = new GetVmGuestCustomizationProfileByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmGuestCustomizationProfileApiResponse\ \ getResponse = vmGuestCustomizationProfilesApi.GetVmGuestCustomizationProfileById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new DeleteVmGuestCustomizationProfileByIdRequest {\n \ \ ExtId = extId,\n \n \n };\n try\ \ {\n DeleteVmGuestCustomizationProfileApiResponse deleteVmGuestCustomizationProfileApiResponse\ \ = vmGuestCustomizationProfilesApi.DeleteVmGuestCustomizationProfileById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vm-guest-customization-profiles: get: tags: - VmGuestCustomizationProfiles summary: List VM Guest Customization Profiles description: Lists VM Guest Customization Profiles. operationId: listVmGuestCustomizationProfiles parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$filter=name\ \ eq 'Windows Profile'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$orderby=name" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$orderby=updateTime" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: config example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=config" - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=createTime" - name: createdBy example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=createdBy" - name: description example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=description" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=extId" - name: links example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=links" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=name" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=tenantId" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=updateTime" - name: updatedBy example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$select=updatedBy" responses: "200": description: Returns a list of all the VM Guest Customization Profiles. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationProfile' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Get operation x-permissions: operationName: View VM Guest Customization Profile deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmGuestCustomizationProfilesApi;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.ListVmGuestCustomizationProfilesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListVmGuestCustomizationProfilesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi = new\ \ VmGuestCustomizationProfilesApi(apiClient);\n\n \n int page\ \ = 0;\n \n int limit = 50;\n\n try {\n \ \ // Pass in parameters using the request builder object associated with\ \ the operation.\n ListVmGuestCustomizationProfilesApiResponse\ \ listVmGuestCustomizationProfilesApiResponse = vmGuestCustomizationProfilesApi.listVmGuestCustomizationProfiles(ListVmGuestCustomizationProfilesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(listVmGuestCustomizationProfilesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmGuestCustomizationProfilesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; vmGuestCustomizationProfilesApi.listVmGuestCustomizationProfiles(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_guest_customization_profiles_api\ \ = ntnx_vmm_py_client.VmGuestCustomizationProfilesApi(api_client=client)\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_guest_customization_profiles_api.list_vm_guest_customization_profiles(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmguestcustomizationprofiles\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmGuestCustomizationProfilesServiceApiInstance\ \ *api.VmGuestCustomizationProfilesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmGuestCustomizationProfilesServiceApiInstance = api.NewVmGuestCustomizationProfilesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vmguestcustomizationprofiles.ListVmGuestCustomizationProfilesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_:\ \ nil }\n response, error := VmGuestCustomizationProfilesServiceApiInstance.ListVmGuestCustomizationProfiles(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmGuestCustomizationProfile)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmGuestCustomizationProfilesApi\ \ vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(client);\n\ \n int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n String select =\ \ \"string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListVmGuestCustomizationProfilesRequest {\n \ \ Page = page,\n Limit = limit,\n Filter\ \ = filter,\n Orderby = orderby,\n Select = select\n\ \ };\n try {\n ListVmGuestCustomizationProfilesApiResponse\ \ listVmGuestCustomizationProfilesApiResponse = vmGuestCustomizationProfilesApi.ListVmGuestCustomizationProfiles(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - VmGuestCustomizationProfiles summary: Create a VM Guest Customization Profile description: Creates a new VM Guest Customization profile with the provided configuration. operationId: createVmGuestCustomizationProfile parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 774bbf07-2bb0-4caf-ae13-e94a9e40c5bf requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationProfile' required: true responses: "202": description: The request to create a new VM Guest Customization Profile is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Post operation x-permissions: operationName: Create VM Guest Customization Profile deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 3 timeUnit: seconds - type: Large count: 4 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.VmGuestCustomizationProfilesApi; import com.nutanix.dp1.vmm.vmm.v4.request.VmGuestCustomizationProfiles.CreateVmGuestCustomizationProfileRequest; import com.nutanix.dp1.vmm.vmm.v4.ahv.config.VmGuestCustomizationProfile; import com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateVmGuestCustomizationProfileApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. VmGuestCustomizationProfilesApi vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(apiClient); VmGuestCustomizationProfile vmGuestCustomizationProfile = new VmGuestCustomizationProfile(); // VmGuestCustomizationProfile object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateVmGuestCustomizationProfileApiResponse createVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.createVmGuestCustomizationProfile(CreateVmGuestCustomizationProfileRequest.builder() .build(), vmGuestCustomizationProfile); System.out.println(createVmGuestCustomizationProfileApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, VmGuestCustomizationProfilesApi, VmGuestCustomizationProfile } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(apiClientInstance); function sample() { let vmGuestCustomizationProfile = new VmGuestCustomizationProfile(); // VmGuestCustomizationProfile object initializations here... vmGuestCustomizationProfile = JSON.stringify(vmGuestCustomizationProfile); vmGuestCustomizationProfilesApi.createVmGuestCustomizationProfile(vmGuestCustomizationProfile).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) vm_guest_customization_profiles_api = ntnx_vmm_py_client.VmGuestCustomizationProfilesApi(api_client=client) vmGuestCustomizationProfile = ntnx_vmm_py_client.VmGuestCustomizationProfile() # VmGuestCustomizationProfile object initializations here... try: api_response = vm_guest_customization_profiles_api.create_vm_guest_customization_profile(body=vmGuestCustomizationProfile) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmguestcustomizationprofiles" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient VmGuestCustomizationProfilesServiceApiInstance *api.VmGuestCustomizationProfilesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. VmGuestCustomizationProfilesServiceApiInstance = api.NewVmGuestCustomizationProfilesServiceApi(ApiClientInstance) ctx := context.Background() vmGuestCustomizationProfile := import1.NewVmGuestCustomizationProfile() // VmGuestCustomizationProfile object initializations here... request := vmguestcustomizationprofiles.CreateVmGuestCustomizationProfileRequest{ Body: vmGuestCustomizationProfile } response, error := VmGuestCustomizationProfilesServiceApiInstance.CreateVmGuestCustomizationProfile(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"WindowsProfile","description":"DescriptionforyourGuestCustomizationProfile","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"config":{"customization":{"generalSettings":{"computerName":{},"timezone":"GreenwichStandardTime","administratorPassword":"abc@123","autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettings"},"windowsProductKey":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","registeredOwner":"Admin","registeredOrganization":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettings"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":"en-US","systemLocale":"en-US","uiLanguage":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettings"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroup"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfig"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfig"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettings"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParams"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfig"},"$objectType":"vmm.v4.ahv.config.VmGuestCustomizationProfile"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"WindowsProfile","description":"DescriptionforyourGuestCustomizationProfile","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.config.UserReference"},"config":{"customization":{"generalSettings":{"computerName":{},"timezone":"GreenwichStandardTime","administratorPassword":"abc@123","autoLogonSettings":{"logonCount":0,"$objectType":"vmm.v4.ahv.config.VmGcProfileAutoLogonSettings"},"windowsProductKey":"ABCD1-EFGH2-IJKL3-MNOP4-QRST5","registeredOwner":"Admin","registeredOrganization":"Nutanix","$objectType":"vmm.v4.ahv.config.VmGcProfileGeneralSettings"},"firstLogonCommands":["cmd.exe/cechoSettingupenvironment"],"localeSettings":{"userLocale":"en-US","systemLocale":"en-US","uiLanguage":"en-US","$objectType":"vmm.v4.ahv.config.VmGcProfileLocaleSettings"},"workgroupOrDomainInfo":{"name":"string","$objectType":"vmm.v4.ahv.config.VmGcProfileWorkgroup"},"networkSettings":{"nicConfigList":[{"dnsConfig":{"preferredDnsServerAddress":"0.0.0.0","alternateDnsServerAddresses":["0.0.0.0"],"$objectType":"vmm.v4.ahv.config.VmGcProfileDnsConfig"},"ipv4Config":{},"$objectType":"vmm.v4.ahv.config.VmGcProfileNicConfig"}],"$objectType":"vmm.v4.ahv.config.VmGcProfileNetworkSettings"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepParams"},"$objectType":"vmm.v4.ahv.config.VmGcProfileSysprepConfig"},"$objectType":"vmm.v4.ahv.config.VmGuestCustomizationProfile"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-guest-customization-profiles" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmGuestCustomizationProfilesApi\ \ vmGuestCustomizationProfilesApi = new VmGuestCustomizationProfilesApi(client);\n\ \n VmGuestCustomizationProfile vmGuestCustomizationProfile = new VmGuestCustomizationProfile();\n\ \n // VmGuestCustomizationProfile object initializations here...\n\n\ \n // Create request object with parameters\n var request\ \ = new CreateVmGuestCustomizationProfileRequest {\n Body = vmGuestCustomizationProfile\n\ \ };\n try {\n CreateVmGuestCustomizationProfileApiResponse\ \ createVmGuestCustomizationProfileApiResponse = vmGuestCustomizationProfilesApi.CreateVmGuestCustomizationProfile(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}: get: tags: - VmHostAffinityPolicies summary: Get the VM-host affinity policy details description: Fetches the VM-host affinity policy configuration for the provided VM-host affinity policy external identifier. operationId: getVmHostAffinityPolicyById parameters: - name: extId in: path description: The external ID (UUID) of the VM-host affinity policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 2994d300-918d-49fd-a20d-060ce39b7512 responses: "200": description: Returns the VM-host affinity policy details. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicy' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Get operation" x-permissions: operationName: View VM Host Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.GetVmHostAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmHostAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient);\n\ \n \n String extId = \"0FFbdEbb-a2A8-d3cA-f0Fc-9FccEbce95CF\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetVmHostAffinityPolicyApiResponse\ \ getVmHostAffinityPolicyApiResponse = vmHostAffinityPoliciesApi.getVmHostAffinityPolicyById(GetVmHostAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getVmHostAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmHostAffinityPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"Ccdca4bC-8816-2feb-c2Ca-3A8aac9863dF\"\ ;\n\n\n\n\n\n vmHostAffinityPoliciesApi.getVmHostAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_host_affinity_policies_api\ \ = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client)\n \ \ \n ext_id = \"CECc8fF8-E4c5-FeBC-Ee16-6bAB242371d1\"\n\n\n try:\n\ \ api_response = vm_host_affinity_policies_api.get_vm_host_affinity_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmHostAffinityPoliciesServiceApiInstance\ \ *api.VmHostAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"dcaBcFDc-3C35-8B2e-E7cB-d1a8E9E4FCDC\"\ \n\n\n request := vmhostaffinitypolicies.GetVmHostAffinityPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := VmHostAffinityPoliciesServiceApiInstance.GetVmHostAffinityPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmHostAffinityPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/C0cBD6c8-9cD9-2b49-f221-Ac7cBefFF75D" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/d42Ae9C3-DEF5-ac8a-ec5e-3cAd4Ffc2fc5" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmHostAffinityPoliciesApi\ \ vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\n\ \ String extId = \"AEFf48Dc-d1F4-6184-6C63-d4bDC8c0FAfc\";\n\n \ \ // Create request object with parameters\n var request = new\ \ GetVmHostAffinityPolicyByIdRequest {\n ExtId = extId\n \ \ };\n try {\n GetVmHostAffinityPolicyApiResponse getVmHostAffinityPolicyApiResponse\ \ = vmHostAffinityPoliciesApi.GetVmHostAffinityPolicyById(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - VmHostAffinityPolicies summary: Update the VM-host affinity policy description: Updates the configuration of the VM-host affinity policy with the given external identifier. operationId: updateVmHostAffinityPolicyById parameters: - name: extId in: path description: The external ID (UUID) of the VM-host affinity policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: f2f6d677-88fe-46e3-9b9d-ae0be4cc97a9 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 34356395-e5d3-4428-a970-bade2d34ebbe requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicy' required: true responses: "202": description: The request to update the VM-host affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Put operation" x-permissions: operationName: Update VM Host Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.UpdateVmHostAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.GetVmHostAffinityPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.policies.VmHostAffinityPolicy;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmHostAffinityPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.UpdateVmHostAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient);\n\ \n VmHostAffinityPolicy vmHostAffinityPolicy = new VmHostAffinityPolicy();\n\ \n // VmHostAffinityPolicy object initializations here...\n \ \ \n String extId = \"19BFeee0-0dcd-CFb5-1243-ACe808C2ccFa\";\n\ \n // perform GET call\n GetVmHostAffinityPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = vmHostAffinityPoliciesApi.getVmHostAffinityPolicyById(GetVmHostAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateVmHostAffinityPolicyApiResponse\ \ updateVmHostAffinityPolicyApiResponse = vmHostAffinityPoliciesApi.updateVmHostAffinityPolicyById(UpdateVmHostAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), vmHostAffinityPolicy,\ \ opts);\n\n System.out.println(updateVmHostAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmHostAffinityPoliciesApi, VmHostAffinityPolicy,\ \ GetVmHostAffinityPolicyApiResponse } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let vmHostAffinityPolicy = new VmHostAffinityPolicy();\n\ \n // VmHostAffinityPolicy object initializations here...\n vmHostAffinityPolicy\ \ = JSON.stringify(vmHostAffinityPolicy);\n\n \n let extId = \"A02Dccc3-C4ca-ede7-452A-CdBf84EB31Ab\"\ ;\n\n\n // Perform Get call\n vmHostAffinityPoliciesApi.getVmHostAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmHostAffinityPoliciesApi.updateVmHostAffinityPolicyById(extId,\ \ vmHostAffinityPolicy, args).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n\ \ console.log(`Error is: ${error}`);\n });\n });\n\n\ }\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_host_affinity_policies_api\ \ = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client)\n \ \ vmHostAffinityPolicy = ntnx_vmm_py_client.VmHostAffinityPolicy()\n\n\ \ # VmHostAffinityPolicy object initializations here...\n \n ext_id\ \ = \"C0a83bEf-ea0d-DEdc-F2eC-1aDd7f81C951\"\n\n try:\n api_response\ \ = vm_host_affinity_policies_api.get_vm_host_affinity_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_host_affinity_policies_api.update_vm_host_affinity_policy_by_id(extId=ext_id,\ \ body=vmHostAffinityPolicy, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmHostAffinityPoliciesServiceApiInstance\ \ *api.VmHostAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n vmHostAffinityPolicy := import1.NewVmHostAffinityPolicy()\n\ \n // VmHostAffinityPolicy object initializations here...\n\n \n \ \ extId := \"3dDa06F4-Abec-29c8-Fd72-BCcf3ddD11B0\"\n\n getRequest\ \ := vmhostaffinitypolicies.GetVmHostAffinityPolicyByIdRequest{ extId: &extId\ \ }\n getResponse, err := VmHostAffinityPoliciesServiceApiInstance.GetVmHostAffinityPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmhostaffinitypolicies.UpdateVmHostAffinityPolicyByIdRequest{\ \ ExtId: &extId, Body: vmHostAffinityPolicy }\n response, error := VmHostAffinityPoliciesServiceApiInstance.UpdateVmHostAffinityPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/DAaA8b12-0DbA-4eff-6Cc1-EBc74c752B73" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestHostAffinitypolicy","description":"Descriptionforyourhostaffinitypolicy.","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"lastUpdatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"vmCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"hostCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numVms":0,"numHosts":0,"numCompliantVms":0,"numNonCompliantVms":0,"$objectType":"vmm.v4.ahv.policies.VmHostAffinityPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestHostAffinitypolicy","description":"Descriptionforyourhostaffinitypolicy.","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"lastUpdatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"vmCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"hostCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numVms":0,"numHosts":0,"numCompliantVms":0,"numNonCompliantVms":0,"$objectType":"vmm.v4.ahv.policies.VmHostAffinityPolicy"} \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/dcC6A7e8-2bfc-55bb-f7b3-bCcddDCcfffa" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Policies;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\ \n VmHostAffinityPolicy vmHostAffinityPolicy = new VmHostAffinityPolicy();\n\ \n // VmHostAffinityPolicy object initializations here...\n\n \ \ String extId = \"DE7D0d36-58fe-0D2E-Aefb-dDdFFe2BcEe2\";\n\n //\ \ perform GET call\n var getRequest = new GetVmHostAffinityPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmHostAffinityPolicyApiResponse\ \ getResponse = vmHostAffinityPoliciesApi.GetVmHostAffinityPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateVmHostAffinityPolicyByIdRequest {\n ExtId\ \ = extId,\n Body = vmHostAffinityPolicy,\n \n \ \ \n };\n try {\n UpdateVmHostAffinityPolicyApiResponse\ \ updateVmHostAffinityPolicyApiResponse = vmHostAffinityPoliciesApi.UpdateVmHostAffinityPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - VmHostAffinityPolicies summary: Delete a VM-host affinity policy description: Deletes the VM-host affinity policy with the given external identifier. operationId: deleteVmHostAffinityPolicyById parameters: - name: extId in: path description: The external ID (UUID) of the VM-host affinity policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: e262f022-9440-4f1a-bf40-2ffd763c6005 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 565a1165-64ec-4bf7-a5c0-26159b8b9479 responses: "202": description: The request to delete the specific VM-host affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete VM Host Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.DeleteVmHostAffinityPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.GetVmHostAffinityPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmHostAffinityPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.DeleteVmHostAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient);\n\ \n \n String extId = \"5CfDb1Df-EBaD-beA9-6EAC-0CBF4ee2aca9\"\ ;\n\n // perform GET call\n GetVmHostAffinityPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = vmHostAffinityPoliciesApi.getVmHostAffinityPolicyById(GetVmHostAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteVmHostAffinityPolicyApiResponse\ \ deleteVmHostAffinityPolicyApiResponse = vmHostAffinityPoliciesApi.deleteVmHostAffinityPolicyById(DeleteVmHostAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(deleteVmHostAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmHostAffinityPoliciesApi, GetVmHostAffinityPolicyApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"6a9ecfb2-bbDC-cDAB-cFDb-33BcfEbdBC80\"\ ;\n\n\n // Perform Get call\n vmHostAffinityPoliciesApi.getVmHostAffinityPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmHostAffinityPoliciesApi.deleteVmHostAffinityPolicyById(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_host_affinity_policies_api\ \ = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client)\n \ \ \n ext_id = \"CdCcf2FD-b15E-c87d-cFae-fdB9bff4785D\"\n\n try:\n\ \ api_response = vm_host_affinity_policies_api.get_vm_host_affinity_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_host_affinity_policies_api.delete_vm_host_affinity_policy_by_id(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmHostAffinityPoliciesServiceApiInstance\ \ *api.VmHostAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"De4bE4D6-bEDF-Efbe-29EC-BB3DB3C7bff0\"\ \n\n getRequest := vmhostaffinitypolicies.GetVmHostAffinityPolicyByIdRequest{\ \ extId: &extId }\n getResponse, err := VmHostAffinityPoliciesServiceApiInstance.GetVmHostAffinityPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmhostaffinitypolicies.DeleteVmHostAffinityPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := VmHostAffinityPoliciesServiceApiInstance.DeleteVmHostAffinityPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/dBDfcd55-f0F1-370E-c9Ae-3a3B7eECef30" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/615AE9Ba-dAE1-f374-5Af4-66c7b45C218F" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Policies;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\ \n String extId = \"E6ABAfF3-Ec0F-2baD-7aBb-DbAABbeec5cb\";\n\n \ \ // perform GET call\n var getRequest = new GetVmHostAffinityPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmHostAffinityPolicyApiResponse\ \ getResponse = vmHostAffinityPoliciesApi.GetVmHostAffinityPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new DeleteVmHostAffinityPolicyByIdRequest {\n ExtId\ \ = extId,\n \n \n };\n try {\n \ \ DeleteVmHostAffinityPolicyApiResponse deleteVmHostAffinityPolicyApiResponse\ \ = vmHostAffinityPoliciesApi.DeleteVmHostAffinityPolicyById(request, opts);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}/$actions/re-enforce: post: tags: - VmHostAffinityPolicies summary: Re-enforce the VM-host affinity policy description: Re-enforces the VM-host affinity policy on all the VMs associated with the policy. operationId: reEnforceVmHostAffinityPolicyById parameters: - name: extId in: path description: The external ID (UUID) of the VM-host affinity policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: cdcac6a6-f8df-4154-9675-d78a25ca7585 - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 58c277fc-66fc-4f2f-8029-8b54c59035ab responses: "202": description: The request to re-enforce the VM-host affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}/$actions/re-enforce\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}/$actions/re-enforce\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}/$actions/re-enforce\ \ Post operation" x-permissions: operationName: Reenforce VM Host Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.ReEnforceVmHostAffinityPolicyByIdRequest;\n\ \nimport java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ReEnforceVmHostAffinityPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient);\n\ \n \n String extId = \"DbFDbA8D-393a-A871-f3D1-c4eBf930FA8A\"\ ;\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in\ \ the If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n String eTag = ApiClient.getEtag(getResponse);\n\ \ HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n */\n try {\n // Pass in parameters using\ \ the request builder object associated with the operation.\n \ \ ReEnforceVmHostAffinityPolicyApiResponse reEnforceVmHostAffinityPolicyApiResponse\ \ = vmHostAffinityPoliciesApi.reEnforceVmHostAffinityPolicyById(ReEnforceVmHostAffinityPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(reEnforceVmHostAffinityPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmHostAffinityPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"Db8E7dC0-0D10-FbFE-B4B2-aA482e7E9dCd\"\ ;\n\n\n /*\n Some Create, Update, and Delete operations generally\ \ require an If-Match header with a value to be passed in order to protect\ \ against concurrent updates.\n The value that needs to be sent in the\ \ If-Match header needs to be retrieved by performing a Read(Get) operation\ \ on the same resource.\n ETags can be retrieved by calling a static\ \ method of ApiClient as below:\n let etagValue = ApiClient.getEtag(data);\n\ \ let args = {\"If-Match\" : etagValue};\n */\n vmHostAffinityPoliciesApi.reEnforceVmHostAffinityPolicyById(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_host_affinity_policies_api\ \ = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client)\n \ \ \n ext_id = \"eEFaf55a-d0af-19fD-c6c7-B9B6FcC8EFaD\"\n\n \"\"\"\ \n Some Create, Update, and Delete operations generally require an If-Match\ \ header with a value to be passed in order to protect against concurrent\ \ updates.\n The value that needs to be sent in the If-Match header needs\ \ to be retrieved by performing a Read(Get) operation on the same resource.\n\ \ ETags can be retrieved by calling a static method of ApiClient as below:\n\ \ etag_value = ApiClient.get_etag(get_api_response)\n \"\"\"\n\n \ \ try:\n api_response = vm_host_affinity_policies_api.re_enforce_vm_host_affinity_policy_by_id(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmHostAffinityPoliciesServiceApiInstance\ \ *api.VmHostAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"Cfd5c81A-D6CD-BC0F-e86d-6BbfD4dF00Cd\"\ \n\n /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \ */\n\n request := vmhostaffinitypolicies.ReEnforceVmHostAffinityPolicyByIdRequest{\ \ ExtId: &extId }\n response, error := VmHostAffinityPoliciesServiceApiInstance.ReEnforceVmHostAffinityPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/aFe7aBE1-9BBE-E3cb-FAAa-f4FDF8fAc0aA/$actions/re-enforce" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/F96CB1bf-EBFc-6f6e-5deE-BDeB2dFdD8FB/$actions/re-enforce" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmHostAffinityPoliciesApi\ \ vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\n\ \ String extId = \"ABC8CCeE-BdeB-A7FE-cadc-fd6Ca110dC88\";\n\n \ \ /*\n Some Create, Update, and Delete operations generally require\ \ an If-Match header with a value to be passed in order to protect against\ \ concurrent updates.\n The value that needs to be sent in the If-Match\ \ header needs to be retrieved by performing a Read(Get) operation on the\ \ same resource.\n ETags can be retrieved by calling a static method\ \ of ApiClient as below:\n String eTag = ApiClient.GetEtag(getResponse);\n\ \ Dictionary opts = new Dictionary();\n\ \ opts[\"If-Match\"] = eTag;\n */\n // Create request\ \ object with parameters\n var request = new ReEnforceVmHostAffinityPolicyByIdRequest\ \ {\n ExtId = extId,\n \n \n };\n\ \ try {\n ReEnforceVmHostAffinityPolicyApiResponse reEnforceVmHostAffinityPolicyApiResponse\ \ = vmHostAffinityPoliciesApi.ReEnforceVmHostAffinityPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-host-affinity-policies: get: tags: - VmHostAffinityPolicies summary: List all the VM-Host Affinity policies description: Lists all the VM-Host Affinity policies. operationId: listVmHostAffinityPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies?$filter=name\ \ eq 'Test Host Affinity policy'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies?$orderby=name" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies?$orderby=updateTime" responses: "200": description: Returns a list of all the VM-host affinity policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Get operation x-permissions: operationName: View VM Host Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.ListVmHostAffinityPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmHostAffinityPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmHostAffinityPoliciesApiResponse\ \ listVmHostAffinityPoliciesApiResponse = vmHostAffinityPoliciesApi.listVmHostAffinityPolicies(ListVmHostAffinityPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .build());\n\n System.out.println(listVmHostAffinityPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmHostAffinityPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; vmHostAffinityPoliciesApi.listVmHostAffinityPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_host_affinity_policies_api\ \ = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client)\n \ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_host_affinity_policies_api.list_vm_host_affinity_policies(_page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmHostAffinityPoliciesServiceApiInstance\ \ *api.VmHostAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vmhostaffinitypolicies.ListVmHostAffinityPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil }\n response,\ \ error := VmHostAffinityPoliciesServiceApiInstance.ListVmHostAffinityPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmHostAffinityPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmHostAffinityPoliciesApi\ \ vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\n\ \ int page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n\n // Create request\ \ object with parameters\n var request = new ListVmHostAffinityPoliciesRequest\ \ {\n Page = page,\n Limit = limit,\n Filter\ \ = filter,\n Orderby = orderby\n };\n try {\n\ \ ListVmHostAffinityPoliciesApiResponse listVmHostAffinityPoliciesApiResponse\ \ = vmHostAffinityPoliciesApi.ListVmHostAffinityPolicies(request);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" post: tags: - VmHostAffinityPolicies summary: Create a new VM-host affinity policy description: Creates a new VM-host affinity policy with the provided configuration. operationId: createVmHostAffinityPolicy parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 90bd0cf5-4c3f-4ac5-b9c7-eb6e78375c84 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicy' required: true responses: "202": description: The request to create a new VM-host affinity policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Post operation x-permissions: operationName: Create VM Host Affinity Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Prism Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 4 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi; import com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.CreateVmHostAffinityPolicyRequest; import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.VmHostAffinityPolicy; import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.CreateVmHostAffinityPolicyApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient); VmHostAffinityPolicy vmHostAffinityPolicy = new VmHostAffinityPolicy(); // VmHostAffinityPolicy object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateVmHostAffinityPolicyApiResponse createVmHostAffinityPolicyApiResponse = vmHostAffinityPoliciesApi.createVmHostAffinityPolicy(CreateVmHostAffinityPolicyRequest.builder() .build(), vmHostAffinityPolicy); System.out.println(createVmHostAffinityPolicyApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, VmHostAffinityPoliciesApi, VmHostAffinityPolicy } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance); function sample() { let vmHostAffinityPolicy = new VmHostAffinityPolicy(); // VmHostAffinityPolicy object initializations here... vmHostAffinityPolicy = JSON.stringify(vmHostAffinityPolicy); vmHostAffinityPoliciesApi.createVmHostAffinityPolicy(vmHostAffinityPolicy).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) vm_host_affinity_policies_api = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client) vmHostAffinityPolicy = ntnx_vmm_py_client.VmHostAffinityPolicy() # VmHostAffinityPolicy object initializations here... try: api_response = vm_host_affinity_policies_api.create_vm_host_affinity_policy(body=vmHostAffinityPolicy) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient VmHostAffinityPoliciesServiceApiInstance *api.VmHostAffinityPoliciesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance) ctx := context.Background() vmHostAffinityPolicy := import1.NewVmHostAffinityPolicy() // VmHostAffinityPolicy object initializations here... request := vmhostaffinitypolicies.CreateVmHostAffinityPolicyRequest{ Body: vmHostAffinityPolicy } response, error := VmHostAffinityPoliciesServiceApiInstance.CreateVmHostAffinityPolicy(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestHostAffinitypolicy","description":"Descriptionforyourhostaffinitypolicy.","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"lastUpdatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"vmCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"hostCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numVms":0,"numHosts":0,"numCompliantVms":0,"numNonCompliantVms":0,"$objectType":"vmm.v4.ahv.policies.VmHostAffinityPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestHostAffinitypolicy","description":"Descriptionforyourhostaffinitypolicy.","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"lastUpdatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"vmCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"hostCategories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"numVms":0,"numHosts":0,"numCompliantVms":0,"numNonCompliantVms":0,"$objectType":"vmm.v4.ahv.policies.VmHostAffinityPolicy"} \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmHostAffinityPoliciesApi\ \ vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\n\ \ VmHostAffinityPolicy vmHostAffinityPolicy = new VmHostAffinityPolicy();\n\ \n // VmHostAffinityPolicy object initializations here...\n\n\n \ \ // Create request object with parameters\n var request = new\ \ CreateVmHostAffinityPolicyRequest {\n Body = vmHostAffinityPolicy\n\ \ };\n try {\n CreateVmHostAffinityPolicyApiResponse\ \ createVmHostAffinityPolicyApiResponse = vmHostAffinityPoliciesApi.CreateVmHostAffinityPolicy(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{vmHostAffinityPolicyExtId}/vm-compliance-states: get: tags: - VmHostAffinityPolicies summary: List the VM compliance states of the VM-host affinity policy description: Lists the compliance state of all the VMs associated with the VM-host affinity policy. operationId: listVmHostAffinityPolicyVmComplianceStates parameters: - name: vmHostAffinityPolicyExtId in: path description: The external ID (UUID) of the VM-host affinity policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a775a04b-987c-4d42-96ec-947ce1f930ea - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns a list of the requested VM compliance states. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicyVmComplianceState' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{vmHostAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{vmHostAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{vmHostAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" x-permissions: operationName: View VM Host Affinity Policy VM Compliance States deploymentList: - ON_PREM - CLOUD roleList: - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Viewer - name: Prism Admin - name: Prism Viewer x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2024.3" - product: PE version: "6.1" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmHostAffinityPoliciesApi;\nimport\ \ com.nutanix.dp1.vmm.vmm.v4.request.VmHostAffinityPolicies.ListVmHostAffinityPolicyVmComplianceStatesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmHostAffinityPolicyVmComplianceStatesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmHostAffinityPoliciesApi vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClient);\n\ \n \n String vmHostAffinityPolicyExtId = \"2Aae6dD6-FA9A-bdC9-cdE6-014CF5Ff6852\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmHostAffinityPolicyVmComplianceStatesApiResponse\ \ listVmHostAffinityPolicyVmComplianceStatesApiResponse = vmHostAffinityPoliciesApi.listVmHostAffinityPolicyVmComplianceStates(ListVmHostAffinityPolicyVmComplianceStatesRequest.builder()\n\ \ .vmHostAffinityPolicyExtId(vmHostAffinityPolicyExtId)\n\ \ .$page(page)\n .$limit(limit)\n \ \ .build());\n\n System.out.println(listVmHostAffinityPolicyVmComplianceStatesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmHostAffinityPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmHostAffinityPolicyExtId = \"abDfDadd-c3cD-Bcf8-AAF2-5ecfE4afAC64\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmHostAffinityPoliciesApi.listVmHostAffinityPolicyVmComplianceStates(vmHostAffinityPolicyExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_host_affinity_policies_api\ \ = ntnx_vmm_py_client.VmHostAffinityPoliciesApi(api_client=client)\n \ \ \n vm_host_affinity_policy_ext_id = \"f49fc2CA-90cB-5def-8FFf-DE5DC6Fddbd9\"\ \n \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_host_affinity_policies_api.list_vm_host_affinity_policy_vm_compliance_states(vmHostAffinityPolicyExtId=vm_host_affinity_policy_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmhostaffinitypolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmHostAffinityPoliciesServiceApiInstance\ \ *api.VmHostAffinityPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmHostAffinityPoliciesServiceApiInstance = api.NewVmHostAffinityPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmHostAffinityPolicyExtId\ \ := \"CBd6cff7-3176-CfBf-bFd7-434e9D4AFe9e\"\n \n page_ := 0\n \ \ \n limit_ := 50\n\n\n request := vmhostaffinitypolicies.ListVmHostAffinityPolicyVmComplianceStatesRequest{\ \ VmHostAffinityPolicyExtId: &vmHostAffinityPolicyExtId, Page_: &page_,\ \ Limit_: &limit_ }\n response, error := VmHostAffinityPoliciesServiceApiInstance.ListVmHostAffinityPolicyVmComplianceStates(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmHostAffinityPolicyVmComplianceState)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/f412EFDF-9fED-7650-51D5-5FcCBFdDCBbe/vm-compliance-states?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-host-affinity-policies/2FEBa11c-49b1-f1dc-1Fc2-d7fd48F2EB3b/vm-compliance-states?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmHostAffinityPoliciesApi\ \ vmHostAffinityPoliciesApi = new VmHostAffinityPoliciesApi(client);\n\n\ \ String vmHostAffinityPolicyExtId = \"5ec4BbC1-1AAD-D08e-4bAf-FDEb57Adf43f\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListVmHostAffinityPolicyVmComplianceStatesRequest\ \ {\n VmHostAffinityPolicyExtId = vmHostAffinityPolicyExtId,\n\ \ Page = page,\n Limit = limit\n };\n \ \ try {\n ListVmHostAffinityPolicyVmComplianceStatesApiResponse\ \ listVmHostAffinityPolicyVmComplianceStatesApiResponse = vmHostAffinityPoliciesApi.ListVmHostAffinityPolicyVmComplianceStates(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vm-recovery-points/{extId}: get: tags: - VmRecoveryPoints summary: Retrieve AHV VM recovery point details description: "Retrieves the AHV VM recovery point details, including both VM\ \ recovery point and VM configuration." operationId: getVmRecoveryPointByExtId parameters: - name: extId in: path description: A globally unique identifier of a VM recovery point. It should be of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 05ca688e-f5cf-475e-afe4-c34ee3b5b8f7 responses: "200": description: Returns the configuration of the VM recovery point. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRecoveryPoint' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Get operation" x-permissions: operationName: View AHV VM Recovery Point deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Disaster Recovery Admin - name: Disaster Recovery Viewer - name: Backup Admin x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 10 timeUnit: seconds - type: XLarge count: 10 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmRecoveryPointsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmRecoveryPoints.GetVmRecoveryPointByExtIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.GetVmRecoveryPointApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmRecoveryPointsApi vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClient);\n\ \n \n String extId = \"aEf19F4F-EFaF-AFcd-f97E-adedC84EcefC\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetVmRecoveryPointApiResponse\ \ getVmRecoveryPointApiResponse = vmRecoveryPointsApi.getVmRecoveryPointByExtId(GetVmRecoveryPointByExtIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getVmRecoveryPointApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmRecoveryPointsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClientInstance);\n\n\ function sample() {\n\n \n let extId = \"1cA5aBE1-ec71-4a5f-A8DD-2EAfec374D47\"\ ;\n\n\n\n\n\n vmRecoveryPointsApi.getVmRecoveryPointByExtId(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_recovery_points_api\ \ = ntnx_vmm_py_client.VmRecoveryPointsApi(api_client=client)\n \n \ \ ext_id = \"BdDAe16B-5BE6-BbaC-deC0-D62ACFaeEbAB\"\n\n\n try:\n \ \ api_response = vm_recovery_points_api.get_vm_recovery_point_by_ext_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmrecoverypoints\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmRecoveryPointsServiceApiInstance\ \ *api.VmRecoveryPointsServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmRecoveryPointsServiceApiInstance = api.NewVmRecoveryPointsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"a1eBC5de-f9Dc-D720-EaE1-05aeEF83cae4\"\ \n\n\n request := vmrecoverypoints.GetVmRecoveryPointByExtIdRequest{\ \ ExtId: &extId }\n response, error := VmRecoveryPointsServiceApiInstance.GetVmRecoveryPointByExtId(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmRecoveryPoint)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points/BAc1FBbc-fade-CdBc-FaBd-5F25FCCcEefF" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points/5669AdAb-c44F-cA1B-dae8-ea48DaFf85cC" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmRecoveryPointsApi\ \ vmRecoveryPointsApi = new VmRecoveryPointsApi(client);\n\n String\ \ extId = \"AEFAdeDa-DCEF-4edB-DFAa-Af6bCdD6d77c\";\n\n // Create\ \ request object with parameters\n var request = new GetVmRecoveryPointByExtIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmRecoveryPointApiResponse\ \ getVmRecoveryPointApiResponse = vmRecoveryPointsApi.GetVmRecoveryPointByExtId(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - VmRecoveryPoints summary: Delete AHV VM recovery point description: Deletes an AHV VM recovery point based on the provided identifier. operationId: deleteVmRecoveryPointByExtId parameters: - name: extId in: path description: A globally unique identifier of a VM recovery point. It should be of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: bf9db038-05a0-47de-9bce-587f15cc5d1a - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: a5ce6061-890e-4da5-941c-c216fad6f947 responses: "202": description: The request to delete the VM recovery point is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Delete operation" x-permissions: operationName: Delete AHV VM Recovery Point deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: Prism Admin - name: Super Admin - name: Virtual Machine Admin - name: Disaster Recovery Admin - name: Backup Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Project Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 2 timeUnit: seconds - type: XLarge count: 2 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmRecoveryPointsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmRecoveryPoints.DeleteVmRecoveryPointByExtIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.DeleteVmRecoveryPointApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmRecoveryPointsApi vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClient);\n\ \n \n String extId = \"cD5a2420-Bef1-f0dC-E9AF-eCefc1EeFDDD\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteVmRecoveryPointApiResponse\ \ deleteVmRecoveryPointApiResponse = vmRecoveryPointsApi.deleteVmRecoveryPointByExtId(DeleteVmRecoveryPointByExtIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(deleteVmRecoveryPointApiResponse.toString());\n\n\ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmRecoveryPointsApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClientInstance);\n\n\ function sample() {\n\n \n let extId = \"C86CBeE4-f1cF-BF5d-Fd7F-D4acFcb5aAdD\"\ ;\n\n\n\n\n\n vmRecoveryPointsApi.deleteVmRecoveryPointByExtId(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_recovery_points_api\ \ = ntnx_vmm_py_client.VmRecoveryPointsApi(api_client=client)\n \n \ \ ext_id = \"b677c5ad-9Fa2-BA9A-a48d-aBbabBb04c0a\"\n\n\n try:\n \ \ api_response = vm_recovery_points_api.delete_vm_recovery_point_by_ext_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmrecoverypoints\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmRecoveryPointsServiceApiInstance\ \ *api.VmRecoveryPointsServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmRecoveryPointsServiceApiInstance = api.NewVmRecoveryPointsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"BfA4ddDb-Afe4-AdfE-8Df8-D15e47Ca9BaE\"\ \n\n\n request := vmrecoverypoints.DeleteVmRecoveryPointByExtIdRequest{\ \ ExtId: &extId }\n response, error := VmRecoveryPointsServiceApiInstance.DeleteVmRecoveryPointByExtId(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points/F3ccfADc-BCCa-90bF-0fbF-0aEb8a52fB6c" \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points/f1feeFFf-f4eB-D3Ff-A5Be-DcCe38Fa9e6a" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmRecoveryPointsApi\ \ vmRecoveryPointsApi = new VmRecoveryPointsApi(client);\n\n String\ \ extId = \"E1EbfBad-Df2d-c508-ec40-e402EC3bE0Cf\";\n\n // Create\ \ request object with parameters\n var request = new DeleteVmRecoveryPointByExtIdRequest\ \ {\n ExtId = extId\n };\n try {\n DeleteVmRecoveryPointApiResponse\ \ deleteVmRecoveryPointApiResponse = vmRecoveryPointsApi.DeleteVmRecoveryPointByExtId(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vm-recovery-points: get: tags: - VmRecoveryPoints summary: List AHV VM recovery points description: List the AHV VM recovery points defined on the PC. It can be further refined using various filtering. operationId: listVmRecoveryPoints parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: creationTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=creationTime\ \ eq '2009-09-23T14:30:00-07:00'" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: locationAgnosticId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=locationAgnosticId\ \ eq 'ab2fa5e2-3b34-49da-bb04-95c86231e30a'" - name: recoveryPointType example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=recoveryPointType\ \ eq Dataprotection.Common.RecoveryPointType'CRASH_CONSISTENT'" - name: vmExtId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=vmExtId\ \ eq 'e4cca047-a8aa-4474-9aa0-82832e8591ec'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: creationTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$orderby=creationTime" - name: expirationTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$orderby=expirationTime" - name: $select in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: applicationConsistentProperties example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=applicationConsistentProperties" - name: consistencyGroupExtId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=consistencyGroupExtId" - name: creationTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=creationTime" - name: diskRecoveryPoints example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=diskRecoveryPoints" - name: expirationTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=expirationTime" - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=extId" - name: links example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=links" - name: locationAgnosticId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=locationAgnosticId" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=name" - name: recoveryPointType example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=recoveryPointType" - name: status example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=status" - name: tenantId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=tenantId" - name: totalExclusiveUsageBytes example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=totalExclusiveUsageBytes" - name: vm example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=vm" - name: vmCategories example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=vmCategories" - name: vmExtId example: "https://{host}:{port}/api/vmm/v4.2/ahv/config/vm-recovery-points?$select=vmExtId" responses: "200": description: Returns the VM recovery points present on the system. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRecoveryPoint' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Get operation x-permissions: operationName: View AHV VM Recovery Point deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: Operator - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Virtual Machine Operator - name: Virtual Machine Viewer - name: Disaster Recovery Admin - name: Disaster Recovery Viewer - name: Backup Admin x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 10 timeUnit: seconds - type: Large count: 10 timeUnit: seconds - type: XLarge count: 10 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmRecoveryPointsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmRecoveryPoints.ListVmRecoveryPointsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.ListVmRecoveryPointsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmRecoveryPointsApi vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmRecoveryPointsApiResponse\ \ listVmRecoveryPointsApiResponse = vmRecoveryPointsApi.listVmRecoveryPoints(ListVmRecoveryPointsRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .$select(null)\n .build());\n\n System.out.println(listVmRecoveryPointsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmRecoveryPointsApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; opts["$select"] = "string_sample_data"; vmRecoveryPointsApi.listVmRecoveryPoints(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_recovery_points_api\ \ = ntnx_vmm_py_client.VmRecoveryPointsApi(api_client=client)\n \n \ \ page = 0\n \n limit = 50\n\n\n try:\n api_response =\ \ vm_recovery_points_api.list_vm_recovery_points(_page=page, _limit=limit)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmrecoverypoints\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmRecoveryPointsServiceApiInstance\ \ *api.VmRecoveryPointsServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmRecoveryPointsServiceApiInstance = api.NewVmRecoveryPointsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vmrecoverypoints.ListVmRecoveryPointsRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil, Select_:\ \ nil }\n response, error := VmRecoveryPointsServiceApiInstance.ListVmRecoveryPoints(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmRecoveryPoint)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0&$select=string_sample_data" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmRecoveryPointsApi\ \ vmRecoveryPointsApi = new VmRecoveryPointsApi(client);\n\n int page\ \ = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n String select =\ \ \"string_sample_data\";\n\n // Create request object with parameters\n\ \ var request = new ListVmRecoveryPointsRequest {\n Page\ \ = page,\n Limit = limit,\n Filter = filter,\n \ \ Orderby = orderby,\n Select = select\n };\n\ \ try {\n ListVmRecoveryPointsApiResponse listVmRecoveryPointsApiResponse\ \ = vmRecoveryPointsApi.ListVmRecoveryPoints(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - VmRecoveryPoints summary: Create AHV VM recovery point description: Creates an AHV VM recovery point based on the provided recovery point details. operationId: createVmRecoveryPoint parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 212f9d16-abd4-45fc-bddf-eb8828ac5dc4 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRecoveryPoint' required: true responses: "202": description: The request to create a VM recovery point for the specified VM is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Post operation x-permissions: operationName: Create AHV VM Recovery Point deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: Prism Admin - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin - name: Disaster Recovery Admin - name: Backup Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Project Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.VmRecoveryPointsApi; import com.nutanix.dp1.vmm.vmm.v4.request.VmRecoveryPoints.CreateVmRecoveryPointRequest; import com.nutanix.dp1.vmm.vmm.v4.ahv.config.VmRecoveryPoint; import com.nutanix.dp1.vmm.vmm.v4.ahv.config.CreateVMRecoveryPointApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. VmRecoveryPointsApi vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClient); VmRecoveryPoint vmRecoveryPoint = new VmRecoveryPoint(); // VmRecoveryPoint object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateVMRecoveryPointApiResponse createVMRecoveryPointApiResponse = vmRecoveryPointsApi.createVmRecoveryPoint(CreateVmRecoveryPointRequest.builder() .build(), vmRecoveryPoint); System.out.println(createVMRecoveryPointApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, VmRecoveryPointsApi, VmRecoveryPoint } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClientInstance); function sample() { let vmRecoveryPoint = new VmRecoveryPoint(); // VmRecoveryPoint object initializations here... vmRecoveryPoint = JSON.stringify(vmRecoveryPoint); vmRecoveryPointsApi.createVmRecoveryPoint(vmRecoveryPoint).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) vm_recovery_points_api = ntnx_vmm_py_client.VmRecoveryPointsApi(api_client=client) vmRecoveryPoint = ntnx_vmm_py_client.VmRecoveryPoint() # VmRecoveryPoint object initializations here... try: api_response = vm_recovery_points_api.create_vm_recovery_point(body=vmRecoveryPoint) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmrecoverypoints" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient VmRecoveryPointsServiceApiInstance *api.VmRecoveryPointsServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. VmRecoveryPointsServiceApiInstance = api.NewVmRecoveryPointsServiceApi(ApiClientInstance) ctx := context.Background() vmRecoveryPoint := import1.NewVmRecoveryPoint() // VmRecoveryPoint object initializations here... request := vmrecoverypoints.CreateVmRecoveryPointRequest{ Body: vmRecoveryPoint } response, error := VmRecoveryPointsServiceApiInstance.CreateVmRecoveryPoint(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"locationAgnosticId":"string","name":"RecoveryPoint_1","creationTime":"2015-07-20T15:49:04-07:00","expirationTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","recoveryPointType":"$UNKNOWN","totalExclusiveUsageBytes":0,"consistencyGroupExtId":"string","diskRecoveryPoints":[{"diskRecoveryPointExtId":"string","diskExtId":"string","$objectType":"dataprotection.v4.common.DiskRecoveryPoint"}],"vmExtId":"string","vmCategories":["dept_1/hr"],"applicationConsistentProperties":{"backupType":"$UNKNOWN","shouldIncludeWriters":false,"writers":["string"],"shouldStoreVssMetadata":false,"$objectType":"dataprotection.v4.common.VssProperties"},"vm":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"$objectType":"vmm.v4.ahv.config.VmRecoveryPoint"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"locationAgnosticId":"string","name":"RecoveryPoint_1","creationTime":"2015-07-20T15:49:04-07:00","expirationTime":"2015-07-20T15:49:04-07:00","status":"$UNKNOWN","recoveryPointType":"$UNKNOWN","totalExclusiveUsageBytes":0,"consistencyGroupExtId":"string","diskRecoveryPoints":[{"diskRecoveryPointExtId":"string","diskExtId":"string","$objectType":"dataprotection.v4.common.DiskRecoveryPoint"}],"vmExtId":"string","vmCategories":["dept_1/hr"],"applicationConsistentProperties":{"backupType":"$UNKNOWN","shouldIncludeWriters":false,"writers":["string"],"shouldStoreVssMetadata":false,"$objectType":"dataprotection.v4.common.VssProperties"},"vm":{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVM","description":"DescriptionforyourVM","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","source":{"entityType":"$UNKNOWN","extId":"string","$objectType":"vmm.v4.ahv.config.VmSourceReference"},"numSockets":0,"numCoresPerSocket":0,"numThreadsPerCore":0,"numNumaNodes":0,"memorySizeBytes":0,"isVcpuHardPinningEnabled":true,"isCpuPassthroughEnabled":true,"enabledCpuFeatures":["$UNKNOWN"],"isMemoryOvercommitEnabled":true,"isGpuConsoleEnabled":true,"isCpuHotplugEnabled":true,"isScsiControllerEnabled":true,"generationUuid":"string","biosUuid":"string","categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"project":{"extId":"string","$objectType":"vmm.v4.ahv.config.ProjectReference"},"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"host":{"extId":"string","$objectType":"vmm.v4.ahv.config.HostReference"},"cluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"availabilityZone":{"extId":"string","$objectType":"vmm.v4.ahv.config.AvailabilityZoneReference"},"guestCustomization":{"config":{"installType":"$UNKNOWN","sysprepScript":{"value":"string","$objectType":"vmm.v4.ahv.config.Unattendxml"},"$objectType":"vmm.v4.ahv.config.Sysprep"},"$objectType":"vmm.v4.ahv.config.GuestCustomizationParams"},"guestTools":{"version":"string","isInstalled":true,"isEnabled":true,"isIsoInserted":true,"capabilities":["$UNKNOWN"],"availableVersion":"string","guestOsVersion":"string","isReachable":true,"isVssSnapshotCapable":true,"isVmMobilityDriversInstalled":true,"isCommunicationActiveOverSerialPort":true,"guestInfo":{"guestOsFullName":"string","isVmMobilityDriversInstalled":true,"lastBootUpTime":"2015-07-20T15:49:04-07:00","dnsName":{"value":"string"},"installedVirtIoVersion":"string","guestOsBuildNumber":"string","$objectType":"vmm.v4.ahv.config.GuestInfo"},"$objectType":"vmm.v4.ahv.config.GuestTools"},"hardwareClockTimezone":"UTC","isBrandingEnabled":true,"bootConfig":{"bootDevice":{"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"$objectType":"vmm.v4.ahv.config.BootDeviceDisk"},"bootOrder":["$UNKNOWN"],"$objectType":"vmm.v4.ahv.config.LegacyBoot"},"isVgaConsoleEnabled":true,"machineType":"$UNKNOWN","powerState":"$UNKNOWN","vtpmConfig":{"isVtpmEnabled":true,"version":"string","vtpmDevice":{"diskExtId":"string","backingFirmwareDiskStorageInfo":{"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"$objectType":"vmm.v4.ahv.config.BackingFirmwareDiskStorageInfo"},"$objectType":"vmm.v4.ahv.config.VtpmDevice"},"$objectType":"vmm.v4.ahv.config.VtpmConfig"},"isAgentVm":true,"apcConfig":{"isApcEnabled":true,"cpuModel":{"extId":"string","name":"Haswell","$objectType":"vmm.v4.ahv.config.CpuModelReference"},"$objectType":"vmm.v4.ahv.config.ApcConfig"},"isLiveMigrateCapable":true,"isCrossClusterMigrationInProgress":true,"storageConfig":{"isFlashModeEnabled":true,"qosConfig":{"throttledIops":0,"$objectType":"vmm.v4.ahv.config.QosConfig"},"storageLocationInfo":{"storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.StorageLocationInfo"},"hydrationInfo":{"hydrationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.HydrationInfo"},"$objectType":"vmm.v4.ahv.config.ADSFVmStorageConfig"},"disks":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.DiskAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"customAttributes":["string"],"$objectType":"vmm.v4.ahv.config.Disk"}],"cdRoms":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"diskAddress":{"busType":"$UNKNOWN","index":0,"$objectType":"vmm.v4.ahv.config.CdRomAddress"},"backingInfo":{"diskExtId":"string","diskSizeBytes":0,"storageContainer":{"extId":"string","$objectType":"vmm.v4.ahv.config.VmDiskContainerReference"},"storageConfig":{"isFlashModeEnabled":true,"$objectType":"vmm.v4.ahv.config.VmDiskStorageConfig"},"dataSource":{"reference":{"imageExtId":"string","storageCluster":{"extId":"string","$objectType":"vmm.v4.ahv.config.ClusterReference"},"$objectType":"vmm.v4.ahv.config.ImageReference"},"$objectType":"vmm.v4.ahv.config.DataSource"},"isMigrationInProgress":true,"vmDiskHydrationInfo":{"diskHydrationStatus":"$UNKNOWN","diskHydrationRemainingBytes":0,"$objectType":"vmm.v4.ahv.config.DiskHydrationInfo"},"$objectType":"vmm.v4.ahv.config.VmDisk"},"isoType":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.CdRom"}],"nics":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"backingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.EmulatedNic"},"nicBackingInfo":{"model":"$UNKNOWN","macAddress":"string","isConnected":true,"numQueues":0,"$objectType":"vmm.v4.ahv.config.VirtualEthernetNic"},"networkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"$objectType":"vmm.v4.ahv.config.NicNetworkInfo"},"nicNetworkInfo":{"nicType":"$UNKNOWN","networkFunctionChain":{"extId":"string","$objectType":"vmm.v4.ahv.config.NetworkFunctionChainReference"},"networkFunctionNicType":"$UNKNOWN","subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"vlanMode":"$UNKNOWN","trunkedVlans":[0],"shouldAllowUnknownMacs":true,"ipv4Config":{"shouldAssignIp":true,"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Config"},"ipv4Info":{"learnedIpAddresses":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.Ipv4Info"},"ipv6Info":{"learnedIpv6Addresses":[{"value":"string","prefixLength":128,"$objectType":"common.v1.config.IPv6Address"}],"$objectType":"vmm.v4.ahv.config.Ipv6Info"},"$objectType":"vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo"},"$objectType":"vmm.v4.ahv.config.Nic"}],"gpus":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"mode":"$UNKNOWN","deviceId":0,"vendor":"$UNKNOWN","pciAddress":{"segment":0,"bus":0,"device":0,"func":0,"$objectType":"vmm.v4.ahv.config.SBDF"},"guestDriverVersion":"string","name":"string","frameBufferSizeBytes":0,"numVirtualDisplayHeads":0,"fraction":0,"$objectType":"vmm.v4.ahv.config.Gpu"}],"serialPorts":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"isConnected":true,"index":0,"$objectType":"vmm.v4.ahv.config.SerialPort"}],"protectionType":"$UNKNOWN","protectionPolicyState":{"policy":{"extId":"string","$objectType":"vmm.v4.ahv.config.PolicyReference"},"$objectType":"vmm.v4.ahv.config.ProtectionPolicyState"},"pcieDevices":[{"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"assignedDeviceInfo":{"device":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDeviceInfo"},"backingInfo":{"deviceExtId":"string","$objectType":"vmm.v4.ahv.config.PcieDeviceReference"},"$objectType":"vmm.v4.ahv.config.PcieDevice"}],"customAttributes":["string"],"vmGuestCustomizationStatus":"$UNKNOWN","$objectType":"vmm.v4.ahv.config.Vm"},"$objectType":"vmm.v4.ahv.config.VmRecoveryPoint"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmRecoveryPointsApi\ \ vmRecoveryPointsApi = new VmRecoveryPointsApi(client);\n\n VmRecoveryPoint\ \ vmRecoveryPoint = new VmRecoveryPoint();\n\n // VmRecoveryPoint object\ \ initializations here...\n\n\n // Create request object with parameters\n\ \ var request = new CreateVmRecoveryPointRequest {\n Body\ \ = vmRecoveryPoint\n };\n try {\n CreateVMRecoveryPointApiResponse\ \ createVMRecoveryPointApiResponse = vmRecoveryPointsApi.CreateVmRecoveryPoint(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/config/vm-recovery-points/{extId}/$actions/restore: post: tags: - VmRecoveryPoints summary: Restore a new VM from an AHV VM recovery point. description: Restores a new VM from an AHV VM recovery point using the VM configuration captured in the VM recovery point and the parameters provided in the restore API request body. operationId: restoreVmRecoveryPoint parameters: - name: extId in: path description: A globally unique identifier of a VM recovery point. It should be of type UUID. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1d7c1b71-58b8-48f6-814d-d63a739bbc01 - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: fab23e4e-4643-4031-a9a1-c44deaabcfb2 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.config.RestoreVmRecoveryPointParams' required: true responses: "202": description: The request to restore the VM recovery point is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}/$actions/restore\ \ Post operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}/$actions/restore\ \ Post operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}/$actions/restore\ \ Post operation" x-permissions: operationName: Restore AHV VM Recovery Point deploymentList: - ON_PREM - CLOUD roleList: - name: Account Owner - name: Administrator - name: Backup Admin - name: Disaster Recovery Admin - name: Prism Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin - name: Virtual Machine Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 2 timeUnit: seconds - type: XLarge count: 2 timeUnit: seconds x-supported-versions: - product: PC version: "2025.2" - product: PE version: "7.3" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmRecoveryPointsApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmRecoveryPoints.RestoreVmRecoveryPointRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.RestoreVmRecoveryPointParams;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.config.RestoreVmRecoveryPointApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmRecoveryPointsApi vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClient);\n\ \n RestoreVmRecoveryPointParams restoreVmRecoveryPointParams = new\ \ RestoreVmRecoveryPointParams();\n\n // RestoreVmRecoveryPointParams\ \ object initializations here...\n \n String extId = \"76E05eb2-Affe-F8ec-2CDe-2FE2ACEE2Ce2\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n RestoreVmRecoveryPointApiResponse\ \ restoreVmRecoveryPointApiResponse = vmRecoveryPointsApi.restoreVmRecoveryPoint(RestoreVmRecoveryPointRequest.builder()\n\ \ .extId(extId)\n .build(), restoreVmRecoveryPointParams);\n\ \n System.out.println(restoreVmRecoveryPointApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmRecoveryPointsApi, RestoreVmRecoveryPointParams\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmRecoveryPointsApi = new VmRecoveryPointsApi(apiClientInstance);\n\n\ function sample() {\n let restoreVmRecoveryPointParams = new RestoreVmRecoveryPointParams();\n\ \n // RestoreVmRecoveryPointParams object initializations here...\n \ \ restoreVmRecoveryPointParams = JSON.stringify(restoreVmRecoveryPointParams);\n\ \n \n let extId = \"6C1AC7F4-fcCf-cef9-B2A3-dAe8f6ABaE2B\";\n\n\n\n\ \n\n vmRecoveryPointsApi.restoreVmRecoveryPoint(extId, restoreVmRecoveryPointParams).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_recovery_points_api\ \ = ntnx_vmm_py_client.VmRecoveryPointsApi(api_client=client)\n restoreVmRecoveryPointParams\ \ = ntnx_vmm_py_client.RestoreVmRecoveryPointParams()\n\n # RestoreVmRecoveryPointParams\ \ object initializations here...\n \n ext_id = \"Cc51aBEd-cDFa-DBCB-aecf-e4F7dCe1de9A\"\ \n\n\n try:\n api_response = vm_recovery_points_api.restore_vm_recovery_point(extId=ext_id,\ \ body=restoreVmRecoveryPointParams)\n print(api_response)\n except\ \ ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmrecoverypoints\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/config\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmRecoveryPointsServiceApiInstance\ \ *api.VmRecoveryPointsServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmRecoveryPointsServiceApiInstance = api.NewVmRecoveryPointsServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n restoreVmRecoveryPointParams :=\ \ import1.NewRestoreVmRecoveryPointParams()\n\n // RestoreVmRecoveryPointParams\ \ object initializations here...\n\n \n extId := \"FDCfB6F7-Af48-8043-d7Ce-d4BdEBdD5ceb\"\ \n\n\n request := vmrecoverypoints.RestoreVmRecoveryPointRequest{ ExtId:\ \ &extId, Body: restoreVmRecoveryPointParams }\n response, error := VmRecoveryPointsServiceApiInstance.RestoreVmRecoveryPoint(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points/753BfEBB-3cfC-edfB-2C9b-8d50BF1Ad08C/$actions/restore" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"isStrictMode":true,"vmConfigOverrideSpec":{"name":"RestoredVM-X","description":"VMrestoredfromVMRecoveryPoint-Y","nicSpec":{"nicRemoveList":["string"],"nicOverrideList":[{"nicExtId":"string","nicBackingInfo":{"macAddress":"string","$objectType":"vmm.v4.ahv.config.VmRestoreVirtualEthernetNicOverrideSpec"},"nicNetworkInfo":{"subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"ipv4Config":{"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.VmRestoreIpv4ConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec"},"guestNicInfo":{"guestStaticIpList":[{"ipv4Address":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"gatewayIpv4AddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.GuestStaticIpSpec"}],"$objectType":"vmm.v4.ahv.config.VmRestoreGuestNicInfoOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmRestoreNicConfigOverrideParams"}],"$objectType":"vmm.v4.ahv.config.VmRestoreNicConfigSpecification"},"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"guestToolsSpec":{"shouldClearInGuestVolumeGroupAttachments":false,"$objectType":"vmm.v4.ahv.config.VmRestoreGuestToolsSpecification"},"$objectType":"vmm.v4.ahv.config.VmConfigOverrideSpecification"},"$objectType":"vmm.v4.ahv.config.RestoreVmRecoveryPointParams"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"isStrictMode":true,"vmConfigOverrideSpec":{"name":"RestoredVM-X","description":"VMrestoredfromVMRecoveryPoint-Y","nicSpec":{"nicRemoveList":["string"],"nicOverrideList":[{"nicExtId":"string","nicBackingInfo":{"macAddress":"string","$objectType":"vmm.v4.ahv.config.VmRestoreVirtualEthernetNicOverrideSpec"},"nicNetworkInfo":{"subnet":{"extId":"string","$objectType":"vmm.v4.ahv.config.SubnetReference"},"ipv4Config":{"ipAddress":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"secondaryIpAddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.VmRestoreIpv4ConfigOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec"},"guestNicInfo":{"guestStaticIpList":[{"ipv4Address":{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"},"gatewayIpv4AddressList":[{"value":"string","prefixLength":32,"$objectType":"common.v1.config.IPv4Address"}],"$objectType":"vmm.v4.ahv.config.GuestStaticIpSpec"}],"$objectType":"vmm.v4.ahv.config.VmRestoreGuestNicInfoOverrideSpec"},"$objectType":"vmm.v4.ahv.config.VmRestoreNicConfigOverrideParams"}],"$objectType":"vmm.v4.ahv.config.VmRestoreNicConfigSpecification"},"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.config.CategoryReference"}],"ownershipInfo":{"owner":{"extId":"string","$objectType":"vmm.v4.ahv.config.OwnerReference"},"$objectType":"vmm.v4.ahv.config.OwnershipInfo"},"guestToolsSpec":{"shouldClearInGuestVolumeGroupAttachments":false,"$objectType":"vmm.v4.ahv.config.VmRestoreGuestToolsSpecification"},"$objectType":"vmm.v4.ahv.config.VmConfigOverrideSpecification"},"$objectType":"vmm.v4.ahv.config.RestoreVmRecoveryPointParams"} \ - "https://host:port/api/vmm/v4.2/ahv/config/vm-recovery-points/f1AddEBc-DaaA-Bc0E-EcEb-afC96c8Bc22e/$actions/restore" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmRecoveryPointsApi\ \ vmRecoveryPointsApi = new VmRecoveryPointsApi(client);\n\n RestoreVmRecoveryPointParams\ \ restoreVmRecoveryPointParams = new RestoreVmRecoveryPointParams();\n\n\ \ // RestoreVmRecoveryPointParams object initializations here...\n\n\ \ String extId = \"7Eca6EC8-cfFd-Eeae-CBb1-511beC211EeE\";\n\n \ \ // Create request object with parameters\n var request = new\ \ RestoreVmRecoveryPointRequest {\n ExtId = extId,\n \ \ Body = restoreVmRecoveryPointParams\n };\n try {\n \ \ RestoreVmRecoveryPointApiResponse restoreVmRecoveryPointApiResponse\ \ = vmRecoveryPointsApi.RestoreVmRecoveryPoint(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}: get: tags: - VmStartupPolicies summary: Get the VM startup policy based on the provided external identifier description: Fetches the VM startup policy of the provided VM startup policy external identifier. operationId: getVmStartupPolicyById parameters: - name: extId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d0ce0fb1-fff8-4773-957d-e2c049662267 responses: "200": description: Returns the requested VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicy' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Get operation" x-permissions: operationName: View VM Startup Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.GetVmStartupPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmStartupPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String extId = \"AfC3f200-ABAF-7060-0CAa-aaa39b0f3a13\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetVmStartupPolicyApiResponse\ \ getVmStartupPolicyApiResponse = vmStartupPoliciesApi.getVmStartupPolicyById(GetVmStartupPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n\n \ \ System.out.println(getVmStartupPolicyApiResponse.toString());\n\n \ \ } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"DEAB3FEc-bbcb-a64E-aB7F-057DA8aeA53B\"\ ;\n\n\n\n\n\n vmStartupPoliciesApi.getVmStartupPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n console.log(data.getData());\n \ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n \ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ ext_id = \"47de3BB5-A9d4-CdcB-4b0D-4Bf8fE94E3Fc\"\n\n\n try:\n \ \ api_response = vm_startup_policies_api.get_vm_startup_policy_by_id(extId=ext_id)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"BDCdBab3-dFcE-AADF-aFc7-5FDBBB69f53f\"\ \n\n\n request := vmstartuppolicies.GetVmStartupPolicyByIdRequest{ ExtId:\ \ &extId }\n response, error := VmStartupPoliciesServiceApiInstance.GetVmStartupPolicyById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.VmStartupPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/2d9AFE5a-9f1c-6CEf-5F4F-1DafcacBEBD5" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/4f97bCd0-aC7C-1D7E-569a-3adbBaFe30Bb" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ extId = \"F1EDb386-3cfD-F8fB-cdbF-9AAC99b8cDA6\";\n\n // Create\ \ request object with parameters\n var request = new GetVmStartupPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmStartupPolicyApiResponse\ \ getVmStartupPolicyApiResponse = vmStartupPoliciesApi.GetVmStartupPolicyById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" put: tags: - VmStartupPolicies summary: Update VM startup policy description: Updates the requested VM startup policy. operationId: updateVmStartupPolicyById parameters: - name: extId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 1b129963-7eb2-4a60-a4eb-9a3cc54a92e5 - name: If-Match in: header description: "The If-Match request header makes the request conditional. When\ \ not provided, the server will respond with an HTTP-428 (Precondition\ \ Required) response code indicating that the server requires the request\ \ to be conditional. The server will allow the successful completion of\ \ PUT and PATCH operations, if the resource matches the ETag value returned\ \ to the response of a GET operation. If the conditional does not match,\ \ then an HTTP-412 (Precondition Failed) response will be returned." required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 63003d23-0a94-4cce-90ca-b8741e95e0c1 requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicy' required: true responses: "202": description: The request to update the VM startup policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Put operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Put operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Put operation" x-permissions: operationName: Update VM Startup Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.UpdateVmStartupPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.GetVmStartupPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.policies.VmStartupPolicy;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmStartupPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.UpdateVmStartupPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n VmStartupPolicy vmStartupPolicy = new VmStartupPolicy();\n\n \ \ // VmStartupPolicy object initializations here...\n \n \ \ String extId = \"bCAFFFfA-e6eA-aFEd-c2DD-1e0C6c4A9e3f\";\n\n \ \ // perform GET call\n GetVmStartupPolicyApiResponse getResponse\ \ = null;\n try {\n getResponse = vmStartupPoliciesApi.getVmStartupPolicyById(GetVmStartupPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n UpdateVmStartupPolicyApiResponse\ \ updateVmStartupPolicyApiResponse = vmStartupPoliciesApi.updateVmStartupPolicyById(UpdateVmStartupPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), vmStartupPolicy,\ \ opts);\n\n System.out.println(updateVmStartupPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi, VmStartupPolicy, GetVmStartupPolicyApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n let vmStartupPolicy = new VmStartupPolicy();\n\ \n // VmStartupPolicy object initializations here...\n vmStartupPolicy\ \ = JSON.stringify(vmStartupPolicy);\n\n \n let extId = \"fB9be50d-2D2a-fCF2-FfE5-E62Cf5BD3E2D\"\ ;\n\n\n // Perform Get call\n vmStartupPoliciesApi.getVmStartupPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmStartupPoliciesApi.updateVmStartupPolicyById(extId,\ \ vmStartupPolicy, args).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n \ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n vmStartupPolicy\ \ = ntnx_vmm_py_client.VmStartupPolicy()\n\n # VmStartupPolicy object\ \ initializations here...\n \n ext_id = \"eEd2FfbF-6aFb-9edf-Dac9-bBcBae87ECe1\"\ \n\n try:\n api_response = vm_startup_policies_api.get_vm_startup_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_startup_policies_api.update_vm_startup_policy_by_id(extId=ext_id,\ \ body=vmStartupPolicy, if_match=etag_value)\n print(api_response)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n import2 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n vmStartupPolicy := import1.NewVmStartupPolicy()\n\ \n // VmStartupPolicy object initializations here...\n\n \n extId\ \ := \"feDbBB7B-8a88-caBd-e09E-4D15deDBbc8a\"\n\n getRequest := vmstartuppolicies.GetVmStartupPolicyByIdRequest{\ \ extId: &extId }\n getResponse, err := VmStartupPoliciesServiceApiInstance.GetVmStartupPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmstartuppolicies.UpdateVmStartupPolicyByIdRequest{ ExtId:\ \ &extId, Body: vmStartupPolicy }\n response, error := VmStartupPoliciesServiceApiInstance.UpdateVmStartupPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import2.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request PUT \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/a1EECcef-eDAC-d88a-Bd01-c82ac1da6cdF" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVMStartuppolicy","description":"DescriptionforyourVMstartuppolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"groups":[{"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"$objectType":"vmm.v4.ahv.policies.DependencyGroup"}],"startConditions":[{"powerStateCriteria":{},"$objectType":"vmm.v4.ahv.policies.StartCondition"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"numDependencyConflicts":0,"numStartConditionConflicts":0,"$objectType":"vmm.v4.ahv.policies.VmStartupPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method PUT \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVMStartuppolicy","description":"DescriptionforyourVMstartuppolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"groups":[{"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"$objectType":"vmm.v4.ahv.policies.DependencyGroup"}],"startConditions":[{"powerStateCriteria":{},"$objectType":"vmm.v4.ahv.policies.StartCondition"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"numDependencyConflicts":0,"numStartConditionConflicts":0,"$objectType":"vmm.v4.ahv.policies.VmStartupPolicy"} \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/ecdffE04-8eF9-101B-ed64-3aBFB6ef48eC" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Policies;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\ \n VmStartupPolicy vmStartupPolicy = new VmStartupPolicy();\n\n \ \ // VmStartupPolicy object initializations here...\n\n String extId\ \ = \"e2AfEeFF-6eBb-16Bc-e0eC-CBBDE9BfCbAd\";\n\n // perform GET\ \ call\n var getRequest = new GetVmStartupPolicyByIdRequest {\n \ \ ExtId = extId\n };\n try {\n GetVmStartupPolicyApiResponse\ \ getResponse = vmStartupPoliciesApi.GetVmStartupPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new UpdateVmStartupPolicyByIdRequest {\n ExtId =\ \ extId,\n Body = vmStartupPolicy,\n \n \ \ \n };\n try {\n UpdateVmStartupPolicyApiResponse\ \ updateVmStartupPolicyApiResponse = vmStartupPoliciesApi.UpdateVmStartupPolicyById(request,\ \ opts);\n } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" delete: tags: - VmStartupPolicies summary: Delete VM startup policy description: Deletes the requested VM startup policy. operationId: deleteVmStartupPolicyById parameters: - name: extId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: df510c5a-6a16-40dd-85d9-06a44fe49c5c - name: If-Match in: header description: | The If-Match request header makes the request conditional. When not provided the server will respond with an HTTP 428 (Precondition Required) response code indicating that the server requires the request to be conditional. The server will allow successful completion of PUT and PATCH operations, if the resource matches the ETag value returned to the response of a GET operation. If the conditional does not match, then an HTTP 412 (Precondition Failed) response required: true style: simple explode: false schema: type: string example: string - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: 6299d7bb-8ac9-4328-ad55-19aed26c23ea responses: "202": description: The request to delete the policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Delete operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Delete operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Delete operation" x-permissions: operationName: Delete VM Startup Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.DeleteVmStartupPolicyByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.GetVmStartupPolicyByIdRequest;\n\ import java.util.HashMap;\nimport org.apache.http.HttpHeaders;\nimport com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmStartupPolicyApiResponse;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.DeleteVmStartupPolicyApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String extId = \"CDaE504f-bd93-Da55-09bd-ddcBdbDfECcd\"\ ;\n\n // perform GET call\n GetVmStartupPolicyApiResponse\ \ getResponse = null;\n try {\n getResponse = vmStartupPoliciesApi.getVmStartupPolicyById(GetVmStartupPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build());\n } catch(RestClientException\ \ ex) {\n System.out.println(ex.getMessage());\n }\n \ \ // Extract E-Tag Header\n String eTag = ApiClient.getEtag(getResponse);\n\ \ // initialize/change parameters for update\n HashMap opts = new HashMap<>();\n opts.put(HttpHeaders.IF_MATCH,\ \ eTag);\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n DeleteVmStartupPolicyApiResponse\ \ deleteVmStartupPolicyApiResponse = vmStartupPoliciesApi.deleteVmStartupPolicyById(DeleteVmStartupPolicyByIdRequest.builder()\n\ \ .extId(extId)\n .build(), opts);\n\n \ \ System.out.println(deleteVmStartupPolicyApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi, GetVmStartupPolicyApiResponse\ \ } from \"@nutanix-api/vmm-js-client\";\n\n// Configure the client\nlet\ \ apiClientInstance = new ApiClient();\n// IPv4/IPv6 address or FQDN of\ \ the cluster\napiClientInstance.host = 'localhost';\n// Port used for the\ \ connection. PC products typically use port 9440, while NC products typically\ \ use port 443. See the product-specific documentation for accurate configuration.\n\ apiClientInstance.port = '9440';\n// Max retry attempts while reconnecting\ \ on a loss of connection\napiClientInstance.maxRetryAttempts = 5;\n// Interval\ \ in ms to use during retry attempts\napiClientInstance.retryInterval =\ \ 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let extId = \"94A992F7-Faec-fE1B-EaAD-1FcAb049E0a8\"\ ;\n\n\n // Perform Get call\n vmStartupPoliciesApi.getVmStartupPolicyById(extId).then(({data,\ \ response}) => {\n console.log(`API returned the following status\ \ code: ${response.status}`);\n // Extract E-Tag Header\n \ \ let etagValue = ApiClient.getEtag(data);\n let args = {\"If-Match\"\ \ : etagValue};\n\n vmStartupPoliciesApi.deleteVmStartupPolicyById(extId,\ \ args).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ ext_id = \"1BFDcAAD-f1De-EAE7-2F71-6a8fCdEfCe48\"\n\n try:\n \ \ api_response = vm_startup_policies_api.get_vm_startup_policy_by_id(extId=ext_id)\n\ \ except ntnx_vmm_py_client.rest.ApiException as e:\n print(e)\n\ \ # Extract E-Tag Header\n etag_value = ntnx_vmm_py_client.ApiClient.get_etag(api_response)\n\ \n try:\n api_response = vm_startup_policies_api.delete_vm_startup_policy_by_id(extId=ext_id,\ \ if_match=etag_value)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n extId := \"dc85aaed-eC39-Aabb-E902-4800FB752B71\"\ \n\n getRequest := vmstartuppolicies.GetVmStartupPolicyByIdRequest{ extId:\ \ &extId }\n getResponse, err := VmStartupPoliciesServiceApiInstance.GetVmStartupPolicyById(ctx,\ \ &getRequest)\n if err != nil {\n fmt.Println(err)\n return\n\ \ }\n\n // Extract E-Tag Header\n etagValue := ApiClientInstance.GetEtag(getResponse)\n\ \n args := make(map[string] interface{})\n args[\"If-Match\"] = etagValue\n\ \n request := vmstartuppolicies.DeleteVmStartupPolicyByIdRequest{ ExtId:\ \ &extId }\n response, error := VmStartupPoliciesServiceApiInstance.DeleteVmStartupPolicyById(ctx,\ \ &request, args)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.TaskReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request DELETE \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/5dCC9AB0-2CC9-1Ead-D0Ea-DB073fF1aaC6" \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method DELETE \ --header 'Accept: application/json' \ --header 'If-Match: string_sample_data' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/18C9Bd95-D75C-dBCb-8AD8-bDDCACe6EFAC" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv.Policies;\nusing Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\ \nnamespace CsharpSdkSample\n{\n class Program\n {\n static void Main(string[]\ \ args) {\n // Configure the client\n Configuration _config =\ \ new Configuration\n {\n // UserName to connect to the cluster\n\ \ Username = \"username\",\n // Password(SecureString) to\ \ connect to the cluster \n Password = Configuration.CreateSecurePassword(\"\ password\"),\n // IPv4/IPv6 address or FQDN of the cluster\n \ \ Host = \"localhost\",\n // Port used for the connection. \n\ \ Port = 9440,\n // Backoff period in seconds (exponential\ \ backoff: 2, 4, 8... seconds)\n BackOffPeriod = 2,\n // Max\ \ retry attempts while reconnecting on a loss of connection\n MaxRetryAttempts\ \ = 5\n };\n\n ApiClient client = new ApiClient(_config);\n\n\ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\ \n String extId = \"abeCeEd5-C5fC-dbf5-a6CC-bAbA2DcDfea5\";\n\n \ \ // perform GET call\n var getRequest = new GetVmStartupPolicyByIdRequest\ \ {\n ExtId = extId\n };\n try {\n GetVmStartupPolicyApiResponse\ \ getResponse = vmStartupPoliciesApi.GetVmStartupPolicyById(getRequest);\n\ \ } catch(ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n // Extract E-Tag Header\n string eTag = ApiClient.GetEtag(getResponse);\n\ \ // initialize/change parameters for update\n Dictionary opts = new Dictionary();\n opts[\"If-Match\"\ ] = eTag;\n // Create request object with parameters\n var\ \ request = new DeleteVmStartupPolicyByIdRequest {\n ExtId =\ \ extId,\n \n \n };\n try {\n \ \ DeleteVmStartupPolicyApiResponse deleteVmStartupPolicyApiResponse\ \ = vmStartupPoliciesApi.DeleteVmStartupPolicyById(request, opts);\n \ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies: get: tags: - VmStartupPolicies summary: List VM startup policies description: List VM startup policies. operationId: listVmStartupPolicies parameters: - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 - name: $filter in: query description: |- 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'. required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: extId example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-startup-policies?$filter=extId\ \ eq '5a3026f9-350d-4fed-89b3-d837495215f5'" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-startup-policies?$filter=name\ \ eq 'Test VM Startup policy'" - name: $orderby in: query description: "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." required: false style: form explode: true schema: type: string example: string x-odata-fields: - name: createTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-startup-policies?$orderby=createTime" - name: name example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-startup-policies?$orderby=name" - name: updateTime example: "https://{host}:{port}/api/vmm/v4.2/ahv/policies/vm-startup-policies?$orderby=updateTime" responses: "200": description: Returns the list of VM startup policies. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicy' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Get operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Get operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Get operation x-permissions: operationName: View VM Startup Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPoliciesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPoliciesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPoliciesApiResponse\ \ listVmStartupPoliciesApiResponse = vmStartupPoliciesApi.listVmStartupPolicies(ListVmStartupPoliciesRequest.builder()\n\ \ .$page(page)\n .$limit(limit)\n \ \ .$filter(null)\n .$orderby(null)\n \ \ .build());\n\n System.out.println(listVmStartupPoliciesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: |2 import { ApiClient, VmStartupPoliciesApi } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance); function sample() { // Construct Optional Parameters var opts = {}; opts["$page"] = 0; opts["$limit"] = 50; opts["$filter"] = "string_sample_data"; opts["$orderby"] = "string_sample_data"; vmStartupPoliciesApi.listVmStartupPolicies(opts).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ page = 0\n \n limit = 50\n\n\n try:\n api_response =\ \ vm_startup_policies_api.list_vm_startup_policies(_page=page, _limit=limit)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n page_ := 0\n \n limit_\ \ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPoliciesRequest{\ \ Page_: &page_, Limit_: &limit_, Filter_: nil, Orderby_: nil }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicies(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmStartupPolicy)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies?$filter=string_sample_data&$limit=50&$orderby=string_sample_data&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n int\ \ page = 0;\n int limit = 50;\n String filter = \"string_sample_data\"\ ;\n String orderby = \"string_sample_data\";\n\n // Create request\ \ object with parameters\n var request = new ListVmStartupPoliciesRequest\ \ {\n Page = page,\n Limit = limit,\n Filter\ \ = filter,\n Orderby = orderby\n };\n try {\n\ \ ListVmStartupPoliciesApiResponse listVmStartupPoliciesApiResponse\ \ = vmStartupPoliciesApi.ListVmStartupPolicies(request);\n } catch\ \ (ApiException ex) {\n Console.WriteLine(ex.Message);\n \ \ }\n }\n }\n}\n" post: tags: - VmStartupPolicies summary: Create VM startup policy description: Creates a VM startup policy. operationId: createVmStartupPolicy parameters: - name: NTNX-Request-Id in: header description: | A unique identifier that is associated with each request. The provided value must be opaque and preferably in Universal Unique Identifier (UUID) format. This identifier is also used as an idempotence token for safely retrying requests in case of network errors. All the supported Nutanix API clients add this auto-generated request identifier to each request. required: true style: simple explode: false schema: type: string format: uuid example: db29422e-2e6b-4737-8861-aa31f97d129d requestBody: content: application/json: schema: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicy' required: true responses: "202": description: The request to create the VM startup policy is accepted. headers: Location: style: simple explode: false schema: pattern: "^((http[s]?|nfs):\\/)?\\/?(([a-zA-Z0-9\\-\\.]+)|(\\d{1,3}(\\\ .\\d{1,3}){3})|(\\[[0-9a-fA-F:]+\\]))(:\\d+)?(\\/[^\\s?#]*)?(\\\ ?[^#\\s]*)?(#[^\\s]*)?$" type: string description: Indicates the target of a redirection or the URL of a newly created resource. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/prism.v4.3.config.TaskReference' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Post operation "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Post operation "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Post operation x-permissions: operationName: Create VM Startup Policy deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 5 timeUnit: seconds - type: Large count: 5 timeUnit: seconds - type: XLarge count: 5 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: |2 package sample; import com.nutanix.vmm.java.client.ApiClient; import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi; import com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.CreateVmStartupPolicyRequest; import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.VmStartupPolicy; import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.CreateVmStartupPolicyApiResponse; import org.springframework.web.client.RestClientException; public class JavaSdkSample { public static void main(String[] args) { // Configure the client ApiClient apiClient = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClient.setHost("localhost"); // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClient.setPort(9440); // Interval in ms to use during retry attempts apiClient.setRetryInterval(5000); // Max retry attempts while reconnecting on a loss of connection apiClient.setMaxRetryAttempts(5); // UserName to connect to the cluster String username = "username"; // Password to connect to the cluster String password = "password"; apiClient.setUsername(username); apiClient.setPassword(password); // Please add authorization information here if needed. VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient); VmStartupPolicy vmStartupPolicy = new VmStartupPolicy(); // VmStartupPolicy object initializations here... try { // Pass in parameters using the request builder object associated with the operation. CreateVmStartupPolicyApiResponse createVmStartupPolicyApiResponse = vmStartupPoliciesApi.createVmStartupPolicy(CreateVmStartupPolicyRequest.builder() .build(), vmStartupPolicy); System.out.println(createVmStartupPolicyApiResponse.toString()); } catch (RestClientException ex) { System.out.println(ex.getMessage()); } } } - lang: JavaScript source: |2 import { ApiClient, VmStartupPoliciesApi, VmStartupPolicy } from "@nutanix-api/vmm-js-client"; // Configure the client let apiClientInstance = new ApiClient(); // IPv4/IPv6 address or FQDN of the cluster apiClientInstance.host = 'localhost'; // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. apiClientInstance.port = '9440'; // Max retry attempts while reconnecting on a loss of connection apiClientInstance.maxRetryAttempts = 5; // Interval in ms to use during retry attempts apiClientInstance.retryInterval = 5000; // UserName to connect to the cluster apiClientInstance.username = 'username'; // Password to connect to the cluster apiClientInstance.password = 'password'; // Please add authorization information here if needed. let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance); function sample() { let vmStartupPolicy = new VmStartupPolicy(); // VmStartupPolicy object initializations here... vmStartupPolicy = JSON.stringify(vmStartupPolicy); vmStartupPoliciesApi.createVmStartupPolicy(vmStartupPolicy).then(({data, response}) => { console.log(`API returned the following status code: ${response.status}`); console.log(data.getData()); }).catch((error) => { console.log(`Error is: ${error}`); }); } sample() - lang: Python source: |2+ import ntnx_vmm_py_client if __name__ == "__main__": # Configure the client config = ntnx_vmm_py_client.Configuration() # IPv4/IPv6 address or FQDN of the cluster config.host = "localhost" # Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. config.port = 9440 # Max retry attempts while reconnecting on a loss of connection config.max_retry_attempts = 3 # Backoff factor to use during retry attempts config.backoff_factor = 3 # UserName to connect to the cluster config.username = "username" # Password to connect to the cluster config.password = "password" # Please add authorization information here if needed. client = ntnx_vmm_py_client.ApiClient(configuration=config) vm_startup_policies_api = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client) vmStartupPolicy = ntnx_vmm_py_client.VmStartupPolicy() # VmStartupPolicy object initializations here... try: api_response = vm_startup_policies_api.create_vm_startup_policy(body=vmStartupPolicy) print(api_response) except ntnx_vmm_py_client.rest.ApiException as e: print(e) - lang: Go source: |2+ package main import ( "fmt" "time" "context" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client" "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies" import1 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies" import2 "github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/prism/v4/config" ) var ( ApiClientInstance *client.ApiClient VmStartupPoliciesServiceApiInstance *api.VmStartupPoliciesServiceApi ) func main() { ApiClientInstance = client.NewApiClient() // IPv4/IPv6 address or FQDN of the cluster ApiClientInstance.Host = "localhost" // Port used for the connection. PC products typically use port 9440, while NC products typically use port 443. See the product-specific documentation for accurate configuration. ApiClientInstance.Port = 9440 // Interval in ms to use during retry attempts ApiClientInstance.RetryInterval = 5 * time.Second // Max retry attempts while reconnecting on a loss of connection ApiClientInstance.MaxRetryAttempts = 5 // UserName to connect to the cluster ApiClientInstance.Username = "username" // Password to connect to the cluster ApiClientInstance.Password = "password" // Please add authorization information here if needed. VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance) ctx := context.Background() vmStartupPolicy := import1.NewVmStartupPolicy() // VmStartupPolicy object initializations here... request := vmstartuppolicies.CreateVmStartupPolicyRequest{ Body: vmStartupPolicy } response, error := VmStartupPoliciesServiceApiInstance.CreateVmStartupPolicy(ctx, &request) if error != nil { fmt.Println(error) return } data, _ := response.GetData().(import2.TaskReference) fmt.Println(data) } - lang: cURL source: |2+ curl --request POST \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVMStartuppolicy","description":"DescriptionforyourVMstartuppolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"groups":[{"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"$objectType":"vmm.v4.ahv.policies.DependencyGroup"}],"startConditions":[{"powerStateCriteria":{},"$objectType":"vmm.v4.ahv.policies.StartCondition"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"numDependencyConflicts":0,"numStartConditionConflicts":0,"$objectType":"vmm.v4.ahv.policies.VmStartupPolicy"} \ - lang: Wget source: |2 wget --verbose \ --method POST \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'NTNX-Request-Id: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ --body-data {"tenantId":"string","extId":"string","links":[{"href":"string","rel":"string","$objectType":"common.v1.response.ApiLink"}],"name":"TestVMStartuppolicy","description":"DescriptionforyourVMstartuppolicy","createTime":"2015-07-20T15:49:04-07:00","updateTime":"2015-07-20T15:49:04-07:00","createdBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"updatedBy":{"extId":"string","$objectType":"vmm.v4.ahv.policies.UserReference"},"groups":[{"categories":[{"extId":"string","$objectType":"vmm.v4.ahv.policies.CategoryReference"}],"$objectType":"vmm.v4.ahv.policies.DependencyGroup"}],"startConditions":[{"powerStateCriteria":{},"$objectType":"vmm.v4.ahv.policies.StartCondition"}],"numCompliantVms":0,"numNonCompliantVms":0,"numPendingVms":0,"numDependencyConflicts":0,"numStartConditionConflicts":0,"$objectType":"vmm.v4.ahv.policies.VmStartupPolicy"} \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n VmStartupPolicy\ \ vmStartupPolicy = new VmStartupPolicy();\n\n // VmStartupPolicy object\ \ initializations here...\n\n\n // Create request object with parameters\n\ \ var request = new CreateVmStartupPolicyRequest {\n Body\ \ = vmStartupPolicy\n };\n try {\n CreateVmStartupPolicyApiResponse\ \ createVmStartupPolicyApiResponse = vmStartupPoliciesApi.CreateVmStartupPolicy(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/vm-compliance-states: get: tags: - VmStartupPolicies summary: List VM compliances of a VM startup policy. description: List VM compliances of the provided VM startup policy external identifier. operationId: listVmStartupPolicyVmComplianceStates parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: f37f1662-4e11-421e-be3b-19e686600809 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of VM Compliance states for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyVmComplianceState' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/vm-compliance-states\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/vm-compliance-states\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/vm-compliance-states\ \ Get operation" x-permissions: operationName: View VM Startup Policy VM Compliance States deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyVmComplianceStatesRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyVmComplianceStatesApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"3Cc3CC19-ca20-aF78-87eD-e8ccA6BBdcD3\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyVmComplianceStatesApiResponse\ \ listVmStartupPolicyVmComplianceStatesApiResponse = vmStartupPoliciesApi.listVmStartupPolicyVmComplianceStates(ListVmStartupPolicyVmComplianceStatesRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .$page(page)\n .$limit(limit)\n .build());\n\ \n System.out.println(listVmStartupPolicyVmComplianceStatesApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"bc3c8D93-Fe33-f2bd-aE2c-DC92F619C68B\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyVmComplianceStates(vmStartupPolicyExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"fBDD83FC-EB4d-6baa-aEA5-bD8FFbfEeC9e\"\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_vm_compliance_states(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ 5c8ecEDE-e86F-Ddf8-dd5c-73b9B0A27D4F\"\n \n page_ := 0\n \n \ \ limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyVmComplianceStatesRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, Page_: &page_, Limit_: &limit_\ \ }\n response, error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyVmComplianceStates(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmStartupPolicyVmComplianceState)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/4cEc8f9b-CfFA-8CDc-D618-9e3C8C8fEd2b/vm-compliance-states?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/Db5eeaEc-fD8E-B8BC-a58D-643b7Fc92bFD/vm-compliance-states?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"eDF0d8A8-E0bc-EFBD-488c-7CB7F4fAEeCc\";\n \ \ int page = 0;\n int limit = 50;\n\n // Create request object\ \ with parameters\n var request = new ListVmStartupPolicyVmComplianceStatesRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ Page = page,\n Limit = limit\n };\n try {\n\ \ ListVmStartupPolicyVmComplianceStatesApiResponse listVmStartupPolicyVmComplianceStatesApiResponse\ \ = vmStartupPoliciesApi.ListVmStartupPolicyVmComplianceStates(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts: get: tags: - VmStartupPolicies summary: List Start condition conflicts of a VM startup policy. description: List Start condition Conflicts of the provided VM startup policy external identifier. operationId: listVmStartupPolicyStartConditionConflicts parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: de7cccaa-6824-47f6-b878-64c260eabddd - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of start condition conflicts for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartConditionConflict' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts\ \ Get operation" x-permissions: operationName: View VM Startup Policy Start Condition Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyStartConditionConflictsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyStartConditionConflictsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"9CDC1B1d-aBBB-a6dd-FCAA-CB51cf18B7Be\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyStartConditionConflictsApiResponse\ \ listVmStartupPolicyStartConditionConflictsApiResponse = vmStartupPoliciesApi.listVmStartupPolicyStartConditionConflicts(ListVmStartupPolicyStartConditionConflictsRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .$page(page)\n .$limit(limit)\n .build());\n\ \n System.out.println(listVmStartupPolicyStartConditionConflictsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"BcC2BfF0-7DF4-31bf-ab98-DafB10EC5A6a\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyStartConditionConflicts(vmStartupPolicyExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"baD003ee-E1Ae-cCB8-cBB9-F7BfeC6adaa4\"\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_start_condition_conflicts(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ 3d6e6CF9-dA77-EdFd-6Baf-bCAE50Eb8921\"\n \n page_ := 0\n \n \ \ limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyStartConditionConflictsRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, Page_: &page_, Limit_: &limit_\ \ }\n response, error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyStartConditionConflicts(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.StartConditionConflict)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/64F3FFF8-d3E7-7451-BcAd-63edd6feCfEE/start-condition-conflicts?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/5CF7C6E4-c5AF-caA1-Bf8f-7dfABcbB9cda/start-condition-conflicts?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"B6a249Aa-4Ec6-c17d-B374-eaBdCE13acE9\";\n \ \ int page = 0;\n int limit = 50;\n\n // Create request object\ \ with parameters\n var request = new ListVmStartupPolicyStartConditionConflictsRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ Page = page,\n Limit = limit\n };\n try {\n\ \ ListVmStartupPolicyStartConditionConflictsApiResponse listVmStartupPolicyStartConditionConflictsApiResponse\ \ = vmStartupPoliciesApi.ListVmStartupPolicyStartConditionConflicts(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{extId}: get: tags: - VmStartupPolicies summary: Get Start condition conflict of a VM startup policy. description: Get Start condition conflict for the provided start condition conflict external identifier and VM startup policy external identifier. operationId: getVmStartupPolicyStartConditionConflictById parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: cf0014e3-4e25-4c7e-9aff-bb9c8845f115 - name: extId in: path description: The external ID of the start condition conflict of a VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 3f1bc1a5-36ed-48a8-b58e-9099ef6eb1aa responses: "200": description: Returns the requested VM startup policy Start condition conflict. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartConditionConflict' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{extId}\ \ Get operation" x-permissions: operationName: View VM Startup Policy Start Condition Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.GetVmStartupPolicyStartConditionConflictByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmStartupPolicyStartConditionConflictApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"fcA3C74C-BBcB-a67c-cCB4-a6ddEda3CEDa\"\ ;\n \n String extId = \"cF41a85A-0B8b-18a9-a0D2-bBCfCebEb7Ac\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetVmStartupPolicyStartConditionConflictApiResponse\ \ getVmStartupPolicyStartConditionConflictApiResponse = vmStartupPoliciesApi.getVmStartupPolicyStartConditionConflictById(GetVmStartupPolicyStartConditionConflictByIdRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .extId(extId)\n .build());\n\n System.out.println(getVmStartupPolicyStartConditionConflictApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"cBa5e3b1-dEA6-8BCa-0dEC-965E648f5DAA\"\ ;\n \n let extId = \"E4F58fBE-9Eb9-DbDE-cfed-fD20acf072fe\";\n\n\n\ \n\n\n vmStartupPoliciesApi.getVmStartupPolicyStartConditionConflictById(vmStartupPolicyExtId,\ \ extId).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"b7e3C7eC-A3Ad-EFd0-caCD-85b6F9E6B81C\"\n\ \ \n ext_id = \"FEBaEDe6-2Ca8-5AfA-Aa42-A4E9bddCD61d\"\n\n\n try:\n\ \ api_response = vm_startup_policies_api.get_vm_startup_policy_start_condition_conflict_by_id(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ Ac65Aefa-1cae-f35C-6Ab3-7d33dCDaf670\"\n \n extId := \"F9BFB8Ea-E4AA-FC45-C374-26b6C0d52Cad\"\ \n\n\n request := vmstartuppolicies.GetVmStartupPolicyStartConditionConflictByIdRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, ExtId: &extId }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.GetVmStartupPolicyStartConditionConflictById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.StartConditionConflict)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/7f1BC74C-F24C-Dc5C-AB59-1BEeCAB805aC/start-condition-conflicts/E667b19E-9fad-47eb-35fD-BFce2ea6FeA4" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/8BEffDDb-ebD6-eee4-DcFA-0bcdbE892ba9/start-condition-conflicts/3724FFFc-eCd0-BE05-AFdB-4ffa6aEf5016" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"f2bd2a56-bA82-2e3a-c5CB-Cf5fB81db4DA\";\n \ \ String extId = \"Fef53860-ddFA-48Cf-5F5B-e1a1eAe511C3\";\n\n \ \ // Create request object with parameters\n var request = new GetVmStartupPolicyStartConditionConflictByIdRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ ExtId = extId\n };\n try {\n GetVmStartupPolicyStartConditionConflictApiResponse\ \ getVmStartupPolicyStartConditionConflictApiResponse = vmStartupPoliciesApi.GetVmStartupPolicyStartConditionConflictById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" ? /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependent-vms : get: tags: - VmStartupPolicies summary: List dependent VMs of a Start condition conflict of a VM startup policy. description: List dependent VMs of a start condition conflict for the provided start condition conflict external identifier and VM startup policy external identifier. operationId: listVmStartupPolicyStartConditionConflictDependentVms parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: c5a75b69-92f1-42c1-be23-59cb7c919214 - name: startConditionConflictExtId in: path description: The external ID of the start condition conflict of a VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: a0cdb289-5592-4a78-9f28-2bb7e4cb2adc - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of dependent VMs in the given start condition conflict for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependent-vms\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependent-vms\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependent-vms\ \ Get operation" x-permissions: operationName: View VM Startup Policy Start Condition Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyStartConditionConflictDependentVmsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyStartConditionConflictDependentVmsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"67A811bB-e5b0-1FA4-f44f-47c28dacE5d3\"\ ;\n \n String startConditionConflictExtId = \"E9Ef05e4-c7D0-AFff-EE9d-750BFa3eECcB\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyStartConditionConflictDependentVmsApiResponse\ \ listVmStartupPolicyStartConditionConflictDependentVmsApiResponse = vmStartupPoliciesApi.listVmStartupPolicyStartConditionConflictDependentVms(ListVmStartupPolicyStartConditionConflictDependentVmsRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .startConditionConflictExtId(startConditionConflictExtId)\n \ \ .$page(page)\n .$limit(limit)\n \ \ .build());\n\n System.out.println(listVmStartupPolicyStartConditionConflictDependentVmsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"1F1bc246-cCDF-A9Ae-d3cF-fCBcBB6aEcA9\"\ ;\n \n let startConditionConflictExtId = \"976AA5e6-EE3c-f4CB-3684-Dd6eacCccCA4\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyStartConditionConflictDependentVms(vmStartupPolicyExtId,\ \ startConditionConflictExtId, opts).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"4A4Ef7A7-9f1c-2fD5-8Ae0-6BDB7Ae8f839\"\n\ \ \n start_condition_conflict_ext_id = \"F25c26c9-feA5-2e0b-FC87-0fDdCC497CA2\"\ \n \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_start_condition_conflict_dependent_vms(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ startConditionConflictExtId=start_condition_conflict_ext_id, _page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ B85CBE85-6fAd-1433-De52-EBbE64CaEBaF\"\n \n startConditionConflictExtId\ \ := \"B6EDd8FD-e5d4-32d2-4eea-b8d2DFA9fad5\"\n \n page_ := 0\n \ \ \n limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyStartConditionConflictDependentVmsRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, StartConditionConflictExtId:\ \ &startConditionConflictExtId, Page_: &page_, Limit_: &limit_ }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyStartConditionConflictDependentVms(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/35Dc5fe2-f7Cb-ABeC-3C4b-8dc6DD99EAfd/start-condition-conflicts/cbeffEef-Caef-4A1a-41EE-5f4A3fA7C987/dependent-vms?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/cCeFE8C7-Ccca-8084-DaBF-FeAE7BAceFD7/start-condition-conflicts/AcE95EcA-EcFb-B8eA-fBC8-b8ACd7AFa9Cb/dependent-vms?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"fEfAEFe9-1EBd-026D-DdBB-DAAdF717B48d\";\n \ \ String startConditionConflictExtId = \"5E7f21AC-bf3D-c970-AcD8-1F0deA4CCbbF\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListVmStartupPolicyStartConditionConflictDependentVmsRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ StartConditionConflictExtId = startConditionConflictExtId,\n \ \ Page = page,\n Limit = limit\n };\n try\ \ {\n ListVmStartupPolicyStartConditionConflictDependentVmsApiResponse\ \ listVmStartupPolicyStartConditionConflictDependentVmsApiResponse = vmStartupPoliciesApi.ListVmStartupPolicyStartConditionConflictDependentVms(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" ? /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependee-vms : get: tags: - VmStartupPolicies summary: List dependee VMs of a Start condition conflict of a VM startup policy. description: List dependee VMs of a start condition conflict for the provided start condition conflict external identifier and VM startup policy external identifier. operationId: listVmStartupPolicyStartConditionConflictDependeeVms parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 266ab651-152e-4204-914c-7ac804f5dadf - name: startConditionConflictExtId in: path description: The external ID of the start condition conflict of a VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: dd09b1c1-b069-4b69-a6dd-23a0b5d68810 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of dependee VMs in the given start condition conflict for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependee-vms\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependee-vms\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependee-vms\ \ Get operation" x-permissions: operationName: View VM Startup Policy Start Condition Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyStartConditionConflictDependeeVmsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyStartConditionConflictDependeeVmsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"F2FCC37c-dBba-691a-dA7A-3eDffeAb56f0\"\ ;\n \n String startConditionConflictExtId = \"9E04a4Fa-e23C-83A6-6ef0-573Cf05fCCdB\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyStartConditionConflictDependeeVmsApiResponse\ \ listVmStartupPolicyStartConditionConflictDependeeVmsApiResponse = vmStartupPoliciesApi.listVmStartupPolicyStartConditionConflictDependeeVms(ListVmStartupPolicyStartConditionConflictDependeeVmsRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .startConditionConflictExtId(startConditionConflictExtId)\n \ \ .$page(page)\n .$limit(limit)\n \ \ .build());\n\n System.out.println(listVmStartupPolicyStartConditionConflictDependeeVmsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"C8cBF245-9FBC-dCd9-aa20-De4EDad44f8E\"\ ;\n \n let startConditionConflictExtId = \"2CFc5DCA-4Bbc-fb3f-Ff5F-DCdEaDaf94bB\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyStartConditionConflictDependeeVms(vmStartupPolicyExtId,\ \ startConditionConflictExtId, opts).then(({data, response}) => {\n \ \ console.log(`API returned the following status code: ${response.status}`);\n\ \ console.log(data.getData());\n }).catch((error) => {\n \ \ console.log(`Error is: ${error}`);\n });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"Ba4fAaeb-7e21-e9B8-eE52-cbEAE2D1d7c5\"\n\ \ \n start_condition_conflict_ext_id = \"8DaFa7eb-D3de-CEDe-dC3c-dDEC4EE29824\"\ \n \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_start_condition_conflict_dependee_vms(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ startConditionConflictExtId=start_condition_conflict_ext_id, _page=page,\ \ _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ FD9FCdb2-6A4B-8a91-A4ad-acCC036E51DD\"\n \n startConditionConflictExtId\ \ := \"d09cBdAC-5EbC-eE6F-bbdc-d0e9faEEEee6\"\n \n page_ := 0\n \ \ \n limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyStartConditionConflictDependeeVmsRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, StartConditionConflictExtId:\ \ &startConditionConflictExtId, Page_: &page_, Limit_: &limit_ }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyStartConditionConflictDependeeVms(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/70Ec5bDA-dB15-3FAc-FEF2-878F45b4C77d/start-condition-conflicts/cBAB8cFE-Cc0B-Eec8-acED-fea3caDe4FE0/dependee-vms?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/CC9aEb5d-cCcC-4DFD-801e-B2b9c77150Bc/start-condition-conflicts/5bf5B97C-bEb7-8a15-fB9D-A6BDFcf3cEbC/dependee-vms?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"9d68fd6B-523b-DadC-deDd-D3aB7E4cEDAe\";\n \ \ String startConditionConflictExtId = \"A93310ca-7Deb-dB6C-49e7-3de5b2334ae9\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListVmStartupPolicyStartConditionConflictDependeeVmsRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ StartConditionConflictExtId = startConditionConflictExtId,\n \ \ Page = page,\n Limit = limit\n };\n try\ \ {\n ListVmStartupPolicyStartConditionConflictDependeeVmsApiResponse\ \ listVmStartupPolicyStartConditionConflictDependeeVmsApiResponse = vmStartupPoliciesApi.ListVmStartupPolicyStartConditionConflictDependeeVms(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts: get: tags: - VmStartupPolicies summary: List Dependency conflicts of a VM startup policy. description: List Dependency Conflicts of the provided VM startup policy external identifier. operationId: listVmStartupPolicyDependencyConflicts parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 24c1ddae-30ab-4fe2-93b4-bedf30b0e3f4 - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of dependency conflicts for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.DependencyConflict' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts\ \ Get operation" x-permissions: operationName: View VM Startup Policy Dependency Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyDependencyConflictsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyDependencyConflictsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"B88Becc0-8aaE-ebeb-BE05-eBafD2df0dAc\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyDependencyConflictsApiResponse\ \ listVmStartupPolicyDependencyConflictsApiResponse = vmStartupPoliciesApi.listVmStartupPolicyDependencyConflicts(ListVmStartupPolicyDependencyConflictsRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .$page(page)\n .$limit(limit)\n .build());\n\ \n System.out.println(listVmStartupPolicyDependencyConflictsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"EE2E7d1b-fecf-C0B0-a0Af-AfaA34CdadE6\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyDependencyConflicts(vmStartupPolicyExtId,\ \ opts).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"cd8EA9aE-ccc1-2fD6-df2a-ccAf2Fb405Cf\"\n\ \ \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_dependency_conflicts(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ _page=page, _limit=limit)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ cabF2A06-e270-f2fD-DD9b-CD5dcD32852D\"\n \n page_ := 0\n \n \ \ limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyDependencyConflictsRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, Page_: &page_, Limit_: &limit_\ \ }\n response, error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyDependencyConflicts(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.DependencyConflict)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/b4DcAE2D-FCec-998B-DfCF-FAA1Cbc2eBad/dependency-conflicts?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/E654FDc2-033A-FCaF-9Baa-7f0bB183dAac/dependency-conflicts?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"C56bC73d-5b1E-DE7d-aFE5-edFBD1Df30ce\";\n \ \ int page = 0;\n int limit = 50;\n\n // Create request object\ \ with parameters\n var request = new ListVmStartupPolicyDependencyConflictsRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ Page = page,\n Limit = limit\n };\n try {\n\ \ ListVmStartupPolicyDependencyConflictsApiResponse listVmStartupPolicyDependencyConflictsApiResponse\ \ = vmStartupPoliciesApi.ListVmStartupPolicyDependencyConflicts(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{extId}: get: tags: - VmStartupPolicies summary: Get Dependency conflict of a VM startup policy. description: Get Dependency conflict for the provided Dependency conflict external identifier and VM startup policy external identifier. operationId: getVmStartupPolicyDependencyConflictById parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 24a8d85d-fb54-4aae-9552-906a845f27e7 - name: extId in: path description: The external ID of the Dependency conflict of a VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 5dc08950-dda8-4ac9-ac5a-e30c58f3f19f responses: "200": description: Returns the requested VM startup policy dependency conflict. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.DependencyConflict' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{extId}\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{extId}\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{extId}\ \ Get operation" x-permissions: operationName: View VM Startup Policy Dependency Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 10 timeUnit: seconds - type: Small count: 15 timeUnit: seconds - type: Large count: 20 timeUnit: seconds - type: XLarge count: 20 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.GetVmStartupPolicyDependencyConflictByIdRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.GetVmStartupPolicyDependencyConflictApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"ADDAaaCC-bCBe-4eaF-6400-C6f19DD51ccC\"\ ;\n \n String extId = \"0DEDF2D3-CcBd-59cd-DAFD-f77cDF4Efafd\"\ ;\n\n try {\n // Pass in parameters using the request\ \ builder object associated with the operation.\n GetVmStartupPolicyDependencyConflictApiResponse\ \ getVmStartupPolicyDependencyConflictApiResponse = vmStartupPoliciesApi.getVmStartupPolicyDependencyConflictById(GetVmStartupPolicyDependencyConflictByIdRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .extId(extId)\n .build());\n\n System.out.println(getVmStartupPolicyDependencyConflictApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"f8A3Cde1-BB96-29E7-d4b6-B7086BC5fEFA\"\ ;\n \n let extId = \"BA6d3AaD-7eF9-5C9E-AE1f-FBabB1d102cf\";\n\n\n\ \n\n\n vmStartupPoliciesApi.getVmStartupPolicyDependencyConflictById(vmStartupPolicyExtId,\ \ extId).then(({data, response}) => {\n console.log(`API returned\ \ the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"C2Ccdfb9-2BFd-F9f0-791C-B4DB9A55d07d\"\n\ \ \n ext_id = \"C91bcED5-eEeB-25bd-5a9a-6bDbcdDBf0eB\"\n\n\n try:\n\ \ api_response = vm_startup_policies_api.get_vm_startup_policy_dependency_conflict_by_id(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ extId=ext_id)\n print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ fAc0AddE-F8Cf-b7FE-9B8A-fbAD78cac24e\"\n \n extId := \"fd1Ed5Cb-48d8-6ca1-b0dE-c8a3EBACD418\"\ \n\n\n request := vmstartuppolicies.GetVmStartupPolicyDependencyConflictByIdRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, ExtId: &extId }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.GetVmStartupPolicyDependencyConflictById(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().(import1.DependencyConflict)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/F5bDabc0-B85F-AdBd-8Deb-dafAeBc5DFBA/dependency-conflicts/0df0cDB7-b9DF-ecBB-908B-d53e9bdbcDa9" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/dCE7ccbF-2fcE-ccD4-Fe79-b5F06d4Cf4B6/dependency-conflicts/b7f03fff-ffbF-AeBC-ff9F-3BFDdCB50e5f" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"cFFFA2Ec-42AD-dCF2-14dD-0AA394aBBbAD\";\n \ \ String extId = \"bcd0fb3a-cD4E-aBEA-3Bc7-AfEa6ca3bA9E\";\n\n \ \ // Create request object with parameters\n var request = new GetVmStartupPolicyDependencyConflictByIdRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ ExtId = extId\n };\n try {\n GetVmStartupPolicyDependencyConflictApiResponse\ \ getVmStartupPolicyDependencyConflictApiResponse = vmStartupPoliciesApi.GetVmStartupPolicyDependencyConflictById(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependent-vms: get: tags: - VmStartupPolicies summary: List dependent VMs of a Dependency conflict of a VM startup policy. description: List dependent VMs of a Dependency conflict for the provided Dependency conflict external identifier and VM startup policy external identifier. operationId: listVmStartupPolicyDependencyConflictDependentVms parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 0cab8177-42cf-492e-9b74-353e6bbfb6ed - name: dependencyConflictExtId in: path description: The external ID of the Dependency conflict of a VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ed5837ee-af4c-4a70-8056-88c8087e6fad - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of dependent VMs in the given dependency conflict for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependent-vms\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependent-vms\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependent-vms\ \ Get operation" x-permissions: operationName: View VM Startup Policy Dependency Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyDependencyConflictDependentVmsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyDependencyConflictDependentVmsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"A01B0F2E-6EEe-cAE9-BfAc-9fDafA6bcAdd\"\ ;\n \n String dependencyConflictExtId = \"9cAdE85f-8CCE-2dC0-f6cE-E3ba1BFb5b1a\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyDependencyConflictDependentVmsApiResponse\ \ listVmStartupPolicyDependencyConflictDependentVmsApiResponse = vmStartupPoliciesApi.listVmStartupPolicyDependencyConflictDependentVms(ListVmStartupPolicyDependencyConflictDependentVmsRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .dependencyConflictExtId(dependencyConflictExtId)\n \ \ .$page(page)\n .$limit(limit)\n .build());\n\ \n System.out.println(listVmStartupPolicyDependencyConflictDependentVmsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"aCCc8Edb-edC9-3cDA-ae9d-c0BF7fe6cbAA\"\ ;\n \n let dependencyConflictExtId = \"0FB66DEa-D00B-CFdF-c39C-F4d85C1FaF3e\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyDependencyConflictDependentVms(vmStartupPolicyExtId,\ \ dependencyConflictExtId, opts).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"79Bbcb7d-AAf9-AeCA-52E4-90a3EfcCF23D\"\n\ \ \n dependency_conflict_ext_id = \"FfDdcFFf-BBAc-BdC7-7CFD-0e883fF7ccd6\"\ \n \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_dependency_conflict_dependent_vms(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ dependencyConflictExtId=dependency_conflict_ext_id, _page=page, _limit=limit)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ aCB3Ca5C-97CA-d8eA-3aBc-Dbdf6EdDfDad\"\n \n dependencyConflictExtId\ \ := \"7e4DDaDC-57Cf-dCF1-0fab-DC7bEf8a51Ef\"\n \n page_ := 0\n \ \ \n limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyDependencyConflictDependentVmsRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, DependencyConflictExtId:\ \ &dependencyConflictExtId, Page_: &page_, Limit_: &limit_ }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyDependencyConflictDependentVms(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/C1C8ADe0-CFaB-8CAd-70DB-EeFC9cbEe99d/dependency-conflicts/C45CeaAD-B0E4-CC37-e4FC-dCAfCacF9e6E/dependent-vms?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/a6A51B9c-6Fee-AeaA-5bEc-7bbbBBff7aFF/dependency-conflicts/5cdcFc26-B8dF-aD6e-0ED8-EAcBea0cFDbc/dependent-vms?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"dAFEB5e8-cbAB-CFeB-c1BE-2Ea51C6cd6Ec\";\n \ \ String dependencyConflictExtId = \"68801A5F-bBC4-eAea-aE1a-78Ec9a3FeD0c\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListVmStartupPolicyDependencyConflictDependentVmsRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ DependencyConflictExtId = dependencyConflictExtId,\n Page\ \ = page,\n Limit = limit\n };\n try {\n \ \ ListVmStartupPolicyDependencyConflictDependentVmsApiResponse listVmStartupPolicyDependencyConflictDependentVmsApiResponse\ \ = vmStartupPoliciesApi.ListVmStartupPolicyDependencyConflictDependentVms(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependee-vms: get: tags: - VmStartupPolicies summary: List dependee VMs of a Dependency conflict of a VM startup policy. description: List dependee VMs of a Dependency conflict for the provided Dependency conflict external identifier and VM startup policy external identifier. operationId: listVmStartupPolicyDependencyConflictDependeeVms parameters: - name: vmStartupPolicyExtId in: path description: The external ID of the VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 700410ad-32a5-4f21-851e-adfb3ae3eb46 - name: dependencyConflictExtId in: path description: The external ID of the Dependency conflict of a VM startup policy. required: true style: simple explode: false schema: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: d5695571-23ac-4b32-bc05-7577cb05315c - name: $page in: query description: | 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. required: false style: form explode: false schema: minimum: 0 type: integer description: | 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. format: int32 default: 0 - name: $limit in: query description: | 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. required: false style: form explode: false schema: maximum: 100 minimum: 1 type: integer description: | 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. format: int32 default: 50 responses: "200": description: Returns the list of dependee VMs in the given dependency conflict for a given VM startup policy. content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependee-vms\ \ Get operation" "4XX": description: Client error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependee-vms\ \ Get operation" "5XX": description: Server error response content: application/json: schema: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependee-vms\ \ Get operation" x-permissions: operationName: View VM Startup Policy Dependency Conflicts deploymentList: - ON_PREM - CLOUD roleList: - name: Prism Admin - name: Prism Viewer - name: Project Admin - name: Project Manager - deprecated: true name: Self-Service Admin - name: Super Admin x-rate-limit: - type: xsmall count: 2 timeUnit: seconds - type: Small count: 2 timeUnit: seconds - type: Large count: 3 timeUnit: seconds - type: XLarge count: 3 timeUnit: seconds x-supported-versions: - product: PC version: "7.5" - product: PE version: "7.5" x-code-samples: - lang: Java source: "\npackage sample;\n\nimport com.nutanix.vmm.java.client.ApiClient;\n\ import com.nutanix.vmm.java.client.api.VmStartupPoliciesApi;\nimport com.nutanix.dp1.vmm.vmm.v4.request.VmStartupPolicies.ListVmStartupPolicyDependencyConflictDependeeVmsRequest;\n\ import com.nutanix.dp1.vmm.vmm.v4.ahv.policies.ListVmStartupPolicyDependencyConflictDependeeVmsApiResponse;\n\ import org.springframework.web.client.RestClientException;\n\npublic class\ \ JavaSdkSample {\n public static void main(String[] args) {\n \ \ // Configure the client\n ApiClient apiClient = new ApiClient();\n\ \ // IPv4/IPv6 address or FQDN of the cluster\n apiClient.setHost(\"\ localhost\");\n // Port used for the connection. PC products typically\ \ use port 9440, while NC products typically use port 443. See the product-specific\ \ documentation for accurate configuration.\n apiClient.setPort(9440);\n\ \ // Interval in ms to use during retry attempts\n apiClient.setRetryInterval(5000);\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ apiClient.setMaxRetryAttempts(5);\n // UserName to connect\ \ to the cluster\n String username = \"username\";\n // Password\ \ to connect to the cluster\n String password = \"password\";\n \ \ apiClient.setUsername(username);\n apiClient.setPassword(password);\n\ \n // Please add authorization information here if needed.\n \ \ VmStartupPoliciesApi vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClient);\n\ \n \n String vmStartupPolicyExtId = \"A484bC4D-dE60-541E-aDfe-dF8ca68FFF52\"\ ;\n \n String dependencyConflictExtId = \"FeaaeD7c-ad1E-FDc4-dDde-fD1AaBdE7edc\"\ ;\n \n int page = 0;\n \n int limit = 50;\n\n\ \ try {\n // Pass in parameters using the request builder\ \ object associated with the operation.\n ListVmStartupPolicyDependencyConflictDependeeVmsApiResponse\ \ listVmStartupPolicyDependencyConflictDependeeVmsApiResponse = vmStartupPoliciesApi.listVmStartupPolicyDependencyConflictDependeeVms(ListVmStartupPolicyDependencyConflictDependeeVmsRequest.builder()\n\ \ .vmStartupPolicyExtId(vmStartupPolicyExtId)\n \ \ .dependencyConflictExtId(dependencyConflictExtId)\n \ \ .$page(page)\n .$limit(limit)\n .build());\n\ \n System.out.println(listVmStartupPolicyDependencyConflictDependeeVmsApiResponse.toString());\n\ \n } catch (RestClientException ex) {\n System.out.println(ex.getMessage());\n\ \ }\n }\n}\n" - lang: JavaScript source: "\nimport { ApiClient, VmStartupPoliciesApi } from \"@nutanix-api/vmm-js-client\"\ ;\n\n// Configure the client\nlet apiClientInstance = new ApiClient();\n\ // IPv4/IPv6 address or FQDN of the cluster\napiClientInstance.host = 'localhost';\n\ // Port used for the connection. PC products typically use port 9440, while\ \ NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\napiClientInstance.port = '9440';\n// Max\ \ retry attempts while reconnecting on a loss of connection\napiClientInstance.maxRetryAttempts\ \ = 5;\n// Interval in ms to use during retry attempts\napiClientInstance.retryInterval\ \ = 5000;\n// UserName to connect to the cluster\napiClientInstance.username\ \ = 'username';\n// Password to connect to the cluster\napiClientInstance.password\ \ = 'password';\n// Please add authorization information here if needed.\n\ let vmStartupPoliciesApi = new VmStartupPoliciesApi(apiClientInstance);\n\ \nfunction sample() {\n\n \n let vmStartupPolicyExtId = \"69CfdecF-E4cF-BeCa-6cf6-b4ABbab7591C\"\ ;\n \n let dependencyConflictExtId = \"bdc6ea9f-FFac-b7ff-4eE9-c9b1bAbadAB7\"\ ;\n\n // Construct Optional Parameters\n var opts = {};\n opts[\"\ $page\"] = 0;\n opts[\"$limit\"] = 50;\n\n\n\n\n vmStartupPoliciesApi.listVmStartupPolicyDependencyConflictDependeeVms(vmStartupPolicyExtId,\ \ dependencyConflictExtId, opts).then(({data, response}) => {\n console.log(`API\ \ returned the following status code: ${response.status}`);\n console.log(data.getData());\n\ \ }).catch((error) => {\n console.log(`Error is: ${error}`);\n\ \ });\n\n}\nsample()\n" - lang: Python source: "\nimport ntnx_vmm_py_client\n\nif __name__ == \"__main__\":\n \ \ # Configure the client\n config = ntnx_vmm_py_client.Configuration()\n\ \ # IPv4/IPv6 address or FQDN of the cluster\n config.host = \"localhost\"\ \n # Port used for the connection. PC products typically use port 9440,\ \ while NC products typically use port 443. See the product-specific documentation\ \ for accurate configuration.\n config.port = 9440\n # Max retry attempts\ \ while reconnecting on a loss of connection\n config.max_retry_attempts\ \ = 3\n # Backoff factor to use during retry attempts\n config.backoff_factor\ \ = 3\n # UserName to connect to the cluster\n config.username = \"\ username\"\n # Password to connect to the cluster\n config.password\ \ = \"password\"\n # Please add authorization information here if needed.\n\ \ client = ntnx_vmm_py_client.ApiClient(configuration=config)\n vm_startup_policies_api\ \ = ntnx_vmm_py_client.VmStartupPoliciesApi(api_client=client)\n \n \ \ vm_startup_policy_ext_id = \"d1BACAab-DcC4-6A56-F5be-b9e21dDfB55f\"\n\ \ \n dependency_conflict_ext_id = \"bf3B5abc-ACB8-E1c8-DFEc-9BD82c89bd08\"\ \n \n page = 0\n \n limit = 50\n\n\n try:\n api_response\ \ = vm_startup_policies_api.list_vm_startup_policy_dependency_conflict_dependee_vms(vmStartupPolicyExtId=vm_startup_policy_ext_id,\ \ dependencyConflictExtId=dependency_conflict_ext_id, _page=page, _limit=limit)\n\ \ print(api_response)\n except ntnx_vmm_py_client.rest.ApiException\ \ as e:\n print(e)\n\n" - lang: Go source: "\npackage main\n\nimport (\n \"fmt\"\n \"time\"\n \"context\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/api\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/client\"\ \n \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/request/vmstartuppolicies\"\ \n import1 \"github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4/models/vmm/v4/ahv/policies\"\ \n)\n\nvar (\n ApiClientInstance *client.ApiClient\n VmStartupPoliciesServiceApiInstance\ \ *api.VmStartupPoliciesServiceApi\n)\n\nfunc main() {\n ApiClientInstance\ \ = client.NewApiClient()\n // IPv4/IPv6 address or FQDN of the cluster\n\ \ ApiClientInstance.Host = \"localhost\"\n // Port used for the connection.\ \ PC products typically use port 9440, while NC products typically use port\ \ 443. See the product-specific documentation for accurate configuration.\n\ \ ApiClientInstance.Port = 9440\n // Interval in ms to use during\ \ retry attempts\n ApiClientInstance.RetryInterval = 5 * time.Second\n\ \ // Max retry attempts while reconnecting on a loss of connection\n\ \ ApiClientInstance.MaxRetryAttempts = 5\n // UserName to connect\ \ to the cluster\n ApiClientInstance.Username = \"username\"\n //\ \ Password to connect to the cluster\n ApiClientInstance.Password = \"\ password\"\n // Please add authorization information here if needed.\n\ \ VmStartupPoliciesServiceApiInstance = api.NewVmStartupPoliciesServiceApi(ApiClientInstance)\n\ \ ctx := context.Background()\n\n \n vmStartupPolicyExtId := \"\ CbAFaE9f-F05c-05Cf-bA0F-5faDcAeeaBED\"\n \n dependencyConflictExtId\ \ := \"DEB69EEb-B18d-38DD-bfD3-37D8ae3EebDc\"\n \n page_ := 0\n \ \ \n limit_ := 50\n\n\n request := vmstartuppolicies.ListVmStartupPolicyDependencyConflictDependeeVmsRequest{\ \ VmStartupPolicyExtId: &vmStartupPolicyExtId, DependencyConflictExtId:\ \ &dependencyConflictExtId, Page_: &page_, Limit_: &limit_ }\n response,\ \ error := VmStartupPoliciesServiceApiInstance.ListVmStartupPolicyDependencyConflictDependeeVms(ctx,\ \ &request)\n if error != nil {\n fmt.Println(error)\n \ \ return\n }\n data, _ := response.GetData().([]import1.VmReference)\n\ \ fmt.Println(data)\n\n}\n\n" - lang: cURL source: |2+ curl --request GET \ --url "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/1f3Bb5f1-1a12-B52e-63E7-f5ceabb0bb1E/dependency-conflicts/9bB8bA74-4D36-Dada-Fee1-d5abAA0f32BF/dependee-vms?$limit=50&$page=0" \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - lang: Wget source: |2 wget --verbose \ --method GET \ --header 'Accept: application/json' \ --header 'Authorization:Basic $APP_ACCESS_TOKEN' \ - "https://host:port/api/vmm/v4.2/ahv/policies/vm-startup-policies/A25dCEdD-FAAE-BD4B-CCfb-4B4fBDe00efC/dependency-conflicts/eE243E91-aE9e-F3BF-281e-60D0ea5c902b/dependee-vms?$limit=50&$page=0" - lang: Csharp source: "\n\nusing Nutanix.VmmSDK.Client;\nusing Nutanix.VmmSDK.Api;\nusing\ \ Nutanix.VmmSDK.Model.Vmm.V4.Ahv;\n\nnamespace CsharpSdkSample\n{\n class\ \ Program\n {\n static void Main(string[] args) {\n // Configure\ \ the client\n Configuration _config = new Configuration\n {\n\ \ // UserName to connect to the cluster\n Username = \"username\"\ ,\n // Password(SecureString) to connect to the cluster \n \ \ Password = Configuration.CreateSecurePassword(\"password\"),\n \ \ // IPv4/IPv6 address or FQDN of the cluster\n Host = \"localhost\"\ ,\n // Port used for the connection. \n Port = 9440,\n \ \ // Backoff period in seconds (exponential backoff: 2, 4, 8... seconds)\n\ \ BackOffPeriod = 2,\n // Max retry attempts while reconnecting\ \ on a loss of connection\n MaxRetryAttempts = 5\n };\n\n \ \ ApiClient client = new ApiClient(_config);\n\n VmStartupPoliciesApi\ \ vmStartupPoliciesApi = new VmStartupPoliciesApi(client);\n\n String\ \ vmStartupPolicyExtId = \"eE034E8E-bBb7-BF7c-DfcD-E46AabaF1A2F\";\n \ \ String dependencyConflictExtId = \"3bDC861f-9b8d-F43C-FBee-605925DCcCDA\"\ ;\n int page = 0;\n int limit = 50;\n\n // Create request\ \ object with parameters\n var request = new ListVmStartupPolicyDependencyConflictDependeeVmsRequest\ \ {\n VmStartupPolicyExtId = vmStartupPolicyExtId,\n \ \ DependencyConflictExtId = dependencyConflictExtId,\n Page\ \ = page,\n Limit = limit\n };\n try {\n \ \ ListVmStartupPolicyDependencyConflictDependeeVmsApiResponse listVmStartupPolicyDependencyConflictDependeeVmsApiResponse\ \ = vmStartupPoliciesApi.ListVmStartupPolicyDependencyConflictDependeeVms(request);\n\ \ } catch (ApiException ex) {\n Console.WriteLine(ex.Message);\n\ \ }\n }\n }\n}\n" components: schemas: vmm.v4.2.ahv.config.GetVmGuestCustomizationProfileApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGuestCustomizationProfile oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationProfile' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Get operation" vmm.v4.2.ahv.config.VmGuestCustomizationProfile: required: - config - name description: VM Guest Customization Profile configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 80 minLength: 1 type: string description: Name of the VM Guest Customization Profile. example: Windows Profile description: type: string description: VM Guest Customization Profile description. example: Description for your Guest Customization Profile createTime: type: string description: VM Guest Customization Profile creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: VM Guest Customization Profile last updated time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/vmm.v4.2.ahv.config.UserReference' updatedBy: $ref: '#/components/schemas/vmm.v4.2.ahv.config.UserReference' config: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileSysprepConfig description: Configuration of the VM Guest Customization Profile. A Configuration should be provided for the customization of either Windows or Linux guest operating system. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileSysprepConfig' additionalProperties: false vmm.v4.2.ahv.config.UpdateVmGuestCustomizationProfileApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Put operation" vmm.v4.2.ahv.config.DeleteVmGuestCustomizationProfileApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.UserReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the user. example: 85a88d36-1a7d-4e21-b883-1faa5c129f61 additionalProperties: false description: Reference to a user. vmm.v4.2.ahv.config.VmGcProfileSysprepConfig: required: - customization type: object properties: customization: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileSysprepParams description: Either specify the values for the parameters or an unattend XML file. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileSysprepParams' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileAnswerFile' additionalProperties: false description: Configuration of the VM Guest Customization Profile for customization of a Windows guest operating system. vmm.v4.2.ahv.config.VmGcProfileSysprepParams: type: object properties: generalSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileGeneralSettings' firstLogonCommands: maxItems: 32 minItems: 0 type: array description: "List of commands to be executed automatically when a user\ \ logs in for the first time after Windows setup. This is an ordered list.\ \ The first command in the list is given the order as 1, and so on, in\ \ FirstLogonCommands in the generated unattend XML. For more information,\ \ refer to Windows unattend installation documentation." items: maxLength: 1024 minLength: 1 type: string example: cmd.exe /c echo Setting up environment localeSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileLocaleSettings' workgroupOrDomainInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileWorkgroup description: JoinWorkgroup or JoinDomain settings of the computer. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileWorkgroup' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDomainSettings' networkSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileNetworkSettings' additionalProperties: false description: A set of various unattended settings supported by Windows. The unattend XML is generated based on the values provided for these elements. vmm.v4.2.ahv.config.VmGcProfileAnswerFile: required: - unattendXml type: object properties: unattendXml: maxLength: 100000 minLength: 1 type: string description: The unattend XML file as a string value. Note that double quotes in the XML file need to be escaped to maintain correctness. example: string additionalProperties: false description: The answer file (unattend.xml) for sysprep configured the VM Guest Customization Profile. vmm.v4.2.ahv.config.VmGcProfileGeneralSettings: type: object properties: computerName: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileUseVmName description: "Mechanism to use to generate the computer name of the VM.\ \ Either UseVmName or MustProvideDuringDeployment should be provided.\ \ If MustProvideDuringDeployment is specified, then the user must provide\ \ the value for the computer name during the VM deployment; otherwise,\ \ the deployment request fails. If the UseVmName is specified, then during\ \ VM deployment, the name of the VM needs to meet the sysprep's computer\ \ name requirements; otherwise, the request fails." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileUseVmName' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileMustProvideDuringDeployment' timezone: maxLength: 256 minLength: 1 type: string description: "The computer's time zone in string format. For different timezone\ \ values, refer to the Windows unattend installation documentation." example: Greenwich Standard Time administratorPassword: maxLength: 256 minLength: 1 type: string description: Password to be configured for built-in Administrator account. example: abc@123 autoLogonSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileAutoLogonSettings' windowsProductKey: pattern: "^[A-Z0-9]{5}(-[A-Z0-9]{5}){4}$" type: string description: The product key to use to install and activate Windows. Note that entering an invalid product key causes Windows Setup to fail. example: ABCD1-EFGH2-IJKL3-MNOP4-QRST5 registeredOwner: maxLength: 256 minLength: 1 type: string description: "Full name of the end user. Note that this is the full name\ \ in the format, not only the username." example: Admin registeredOrganization: maxLength: 256 minLength: 1 type: string description: Name of the organization of the end user. example: Nutanix additionalProperties: false description: A set of general unattended settings supported by Windows. vmm.v4.2.ahv.config.VmGcProfileLocaleSettings: type: object properties: userLocale: maxLength: 64 pattern: "^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$" type: string description: "Per-user settings to be used for formatting dates, times,\ \ currency, and numbers. Its value is based on the language-tagging conventions\ \ of RFC 3066. The pattern language-region is used, where language is\ \ a language code and region is a country or region identifier (for example,\ \ en-US, fr-FR, or es-ES)." example: en-US systemLocale: maxLength: 64 pattern: "^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$" type: string description: "Default language to use for non-Unicode programs. Its value\ \ is based on the language-tagging conventions of RFC 3066. The pattern\ \ language-region is used, where language is a language code and region\ \ is a country or region identifier (for example, en-US, fr-FR, or es-ES)." example: en-US uiLanguage: maxLength: 64 pattern: "^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$" type: string description: "Default system language to use to display user interface (UI)\ \ items. Its value is based on the language-tagging conventions of RFC\ \ 3066. The pattern language-region is used, where language is a language\ \ code and region is a country or region identifier (for example, en-US,\ \ fr-FR, or es-ES)." example: en-US additionalProperties: false description: Language and locale settings for the system and the user. vmm.v4.2.ahv.config.VmGcProfileWorkgroup: required: - name type: object properties: name: maxLength: 15 minLength: 1 type: string description: Name of workgroup to be applied to the computer when joining the workgroup. It must be a valid NetBIOS name. example: string additionalProperties: false description: Details of the workgroup to apply to the computer during Windows Setup. vmm.v4.2.ahv.config.VmGcProfileDomainSettings: required: - credentials type: object properties: credentials: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDomainCredentials' additionalProperties: false description: Domain setting to be applied to the computer when joining the domain. vmm.v4.2.ahv.config.VmGcProfileNetworkSettings: required: - nicConfigList type: object properties: nicConfigList: maxItems: 64 minItems: 0 type: array description: "List of NIC configurations to be applied to the NICs attached\ \ to the VM in serial order. The first configuration provided in the list\ \ is applied to the first NIC attached to the VM, and so on for other\ \ NICs." items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileNicConfig' additionalProperties: false description: Network settings to apply to the NICs attached to the VM. vmm.v4.2.ahv.config.VmGcProfileUseVmName: type: object properties: {} additionalProperties: false description: The computer name of the VM should be the same as the VM's name. vmm.v4.2.ahv.config.VmGcProfileMustProvideDuringDeployment: type: object properties: {} additionalProperties: false description: The value for the attribute that must be provided during deployment. vmm.v4.2.ahv.config.VmGcProfileAutoLogonSettings: required: - logonCount type: object properties: logonCount: maximum: 32767 minimum: 1 type: integer description: The number of automatic logons allowed for the computer using the specified local account. The LogonCount must be specified if the AutoLogon setting is used. format: int32 example: 87 additionalProperties: false description: "Autologon settings that need to be specified to enable autologon.\ \ Currently, it is for only the Administrator account, and the value for the\ \ Administrator Password should be provided in the General Settings section\ \ when configuring this setting." vmm.v4.2.ahv.config.VmGcProfileDomainCredentials: required: - domainName - password - username type: object properties: domainName: maxLength: 255 minLength: 1 type: string description: The name of the domain to use for authentication of the account before the computer can be joined to a domain. A domain name can be the fully qualified DNS name or the NetBIOS name of the domain. example: nutanix.com username: maxLength: 256 minLength: 1 type: string description: Name of the domain user account with permission to add the computer to a domain. example: user password: maxLength: 256 minLength: 1 type: string description: The password of the domain user account to use for authenticating an account to the domain before the computer can be joined to a domain. example: abcd@1234 additionalProperties: false description: Credentials of the domain account to use to join the domain. vmm.v4.2.ahv.config.VmGcProfileNicConfig: required: - ipv4Config type: object properties: dnsConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDnsConfig' ipv4Config: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileUseDhcp description: "Mechanism to configure IPv4 settings of the NIC. Either UseDhcp\ \ or MustProvideDuringDeployment should be specified as a value. If UseDhcp\ \ is specified, DhcpEnabled is set to True for the interface in the unattend\ \ XML. If MustProvideDuringDeployment is specified, the user must provide\ \ the IPv4 address with the prefix length and gateway details during the\ \ deployment." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileUseDhcp' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileMustProvideDuringDeployment' additionalProperties: false description: "Network settings, such as DNS and IPv4 settings, are to be applied\ \ to a NIC attached to the VM." vmm.v4.2.ahv.config.VmGcProfileDnsConfig: required: - preferredDnsServerAddress type: object properties: preferredDnsServerAddress: pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" type: string description: An IPv4 address is preferred to search first when searching for the DNS server on the network. example: 0.0.0.0 alternateDnsServerAddresses: maxItems: 1 minItems: 0 type: array description: List of IPv4 addresses to look for after preferred DNS server when searching for the DNS server on the network. items: pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" type: string example: 0.0.0.0 additionalProperties: false description: DNS configuration to be applied to the NIC. vmm.v4.2.ahv.config.VmGcProfileUseDhcp: type: object properties: {} additionalProperties: false description: DHCP is enabled for the IPv4 protocol. vmm.v4.2.ahv.config.ListVmGuestCustomizationProfilesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationProfile' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Get operation vmm.v4.2.ahv.config.CreateVmGuestCustomizationProfileApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-guest-customization-profiles Post operation vmm.v4.2.ahv.config.AssociateVmCategoriesParams: type: object properties: categories: maxItems: 256 minItems: 1 type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CategoryReference' additionalProperties: false description: List of categories to be associated to the VM. vmm.v4.2.ahv.config.AssociateCategoriesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/associate-categories\ \ Post operation" vmm.v4.2.ahv.config.CategoryReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM category of type UUID. example: 186961c0-062b-4a78-a808-191794103c86 additionalProperties: false description: Reference to a category. vmm.v4.2.ahv.config.DisassociateVmCategoriesParams: type: object properties: categories: maxItems: 256 minItems: 1 type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CategoryReference' additionalProperties: false description: List of categories to be disassociated from the VM. vmm.v4.2.ahv.config.DisassociateCategoriesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" vmm.v4.2.ahv.config.GetCdRomApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.CdRom oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Get operation" vmm.v4.2.ahv.config.DeleteCdRomApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.CdRom: description: Virtual Machine CD-ROM. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: diskAddress: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRomAddress' backingInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDisk' isoType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.IsoType' additionalProperties: false vmm.v4.2.ahv.config.CdRomAddress: type: object properties: busType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRomBusType' index: type: integer description: Device index on the bus. This field is ignored unless the bus details are specified. example: 26 additionalProperties: false description: Virtual Machine disk (VM disk). vmm.v4.2.ahv.config.VmDisk: type: object properties: diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk of type UUID. readOnly: true example: 75ad9bdb-64c7-46f5-9ad1-fe2dec876290 diskSizeBytes: minimum: 1 type: integer description: Size of the disk in bytes. format: int64 example: 6 storageContainer: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskContainerReference' storageConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskStorageConfig' dataSource: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DataSource' isMigrationInProgress: type: boolean description: Indicates if the disk is undergoing migration to another container. readOnly: true example: false vmDiskHydrationInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DiskHydrationInfo' additionalProperties: false description: Storage provided by Nutanix ADSF. vmm.v4.2.ahv.config.IsoType: type: string description: Type of ISO image inserted in CD-ROM enum: - OTHER - GUEST_TOOLS - GUEST_CUSTOMIZATION - $UNKNOWN - $REDACTED x-enumDescriptions: OTHER: The type of ISO is Other. GUEST_TOOLS: The type of ISO is Nutanix Guest Tools. GUEST_CUSTOMIZATION: The type of ISO is Guest Customization. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.CdRomBusType: type: string description: "Bus type for the device. The acceptable values are: IDE or SATA." enum: - IDE - SATA - $UNKNOWN - $REDACTED x-enumDescriptions: IDE: The type of CD-ROM bus is IDE. $UNKNOWN: | Unknown value. SATA: The type of CD-ROM bus is SATA. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.VmDiskContainerReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk container. It should be of type UUID. example: bc030f4f-59b8-4215-96eb-0bd1d0f0047d additionalProperties: false description: This reference is for disk level storage container preference. This preference specifies the storage container to which this disk belongs. vmm.v4.2.ahv.config.VmDiskStorageConfig: type: object properties: isFlashModeEnabled: type: boolean description: Indicates whether the virtual disk is pinned to the hot tier or not. example: false additionalProperties: false description: Storage configuration for VM disks. vmm.v4.2.ahv.config.DataSource: type: object properties: reference: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.ImageReference description: A reference to a disk or image that contains the contents of a disk. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.ImageReference' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskReference' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VolumeDiskReference' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskRecoveryPointReference' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VolumeDiskRecoveryPointReference' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.ExternalDataSourceDiskReference' additionalProperties: false description: A reference to a disk or image that contains the contents of a disk. vmm.v4.2.ahv.config.DiskHydrationInfo: type: object properties: diskHydrationStatus: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HydrationStatus' diskHydrationRemainingBytes: type: integer description: Number of bytes remaining to be hydrated. format: int64 readOnly: true example: 25 additionalProperties: false description: Hydration information for a VM disk. readOnly: true vmm.v4.2.ahv.config.ImageReference: required: - imageExtId type: object properties: imageExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of an image of type UUID. example: 0dc97386-0ec8-4d8e-8ab4-8fb33ea6e512 storageCluster: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ClusterReference' additionalProperties: false description: Clone a disk from an image. vmm.v4.2.ahv.config.VmDiskReference: type: object properties: diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk of type UUID. example: d2bda474-b693-4a19-b243-731ba2adb4f6 diskAddress: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DiskAddress' vmReference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmReference' additionalProperties: false description: Reference to an existing VM disk. vmm.v4.2.ahv.config.VolumeDiskReference: type: object properties: diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: An external identifier of the Volume disk. It should be of type UUID. example: 58cb479f-dacb-4de0-be6d-1b3d6280f73f volumeGroupExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of the Volume Group. It should be of type UUID. example: 29416591-b75b-4de9-a0fc-10be3e17d7f3 additionalProperties: false description: Reference to a Volume Disk. vmm.v4.2.ahv.config.VmDiskRecoveryPointReference: type: object properties: diskRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: An external identifier of the Disk Recovery Point for a VM disk. It should be of type UUID. example: cddf97be-6195-4fe2-88b1-b63eb79d55cd vmRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM recovery point. It should be of type UUID. example: 929fd3e8-ff78-4c98-a690-fe388103a0a1 additionalProperties: false description: Reference to a Disk Recovery Point of a VM disk. vmm.v4.2.ahv.config.VolumeDiskRecoveryPointReference: type: object properties: diskRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: An external identifier of the Volume disk Recovery Point. It should be of type UUID. example: d82bbafb-ceaa-464d-b7d3-8a77d0a01667 volumeGroupRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of the Volume Group Recovery Point. It should be of type UUID. example: ec65141b-e365-4dc4-8b04-266c929e0709 additionalProperties: false description: Reference to a disk Recovery Point of a Volume disk. vmm.v4.2.ahv.config.ExternalDataSourceDiskReference: required: - externalDiskRelativePath - externalRepositoryExtId type: object properties: externalRepositoryExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of type UUID for the external repository. example: a3c333c9-009c-4e39-b810-b3362d55a28b externalDiskRelativePath: maxLength: 2048 type: string description: The relative path of the external data source disk. example: dir1/dir2/disk3 shouldEnableBackgroundHydration: type: boolean description: "Indicates whether the background data hydration should be\ \ enabled for the external data source disk or not. If set to true, the\ \ disk will be migrated to the local storage container in the background." default: true additionalProperties: false description: Reference to an external data source disk. vmm.v4.2.ahv.config.ClusterReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of a cluster type UUID. example: 7833d033-8464-40e1-b70f-0116de41de4e additionalProperties: false description: Reference to a cluster. vmm.v4.2.ahv.config.DiskAddress: type: object properties: busType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DiskBusType' index: minimum: 0 type: integer description: Device index on the bus. This field is ignored unless the bus details are specified. format: int32 example: 23 additionalProperties: false description: Disk address. vmm.v4.2.ahv.config.VmReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM of type UUID. example: 0e7b1cff-82c6-4eaf-9081-0caa12dcd1cf additionalProperties: false description: This is a reference to a VM. vmm.v4.2.ahv.config.DiskBusType: type: string description: "Bus type for the device. The acceptable values are: SCSI, IDE,\ \ PCI, SATA, SPAPR (only PPC)." enum: - SCSI - IDE - PCI - SATA - SPAPR - $UNKNOWN - $REDACTED x-enumDescriptions: SCSI: The type of disk bus is SCSI. SPAPR: The type of disk bus is SPAPR. PCI: The type of disk bus is PCI. IDE: The type of disk bus is IDE. $UNKNOWN: | Unknown value. SATA: The type of disk bus is SATA. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.HydrationStatus: type: string description: Reference to VM hydration status. enum: - IN_PROGRESS - FAILED - DISABLED - $UNKNOWN - $REDACTED x-enumDescriptions: IN_PROGRESS: Hydration is in progress for this VM/disk. DISABLED: Hydration is disabled for this VM/disk. Hydration can be resumed using VM disk enable hydration endpoint. FAILED: Hydration has failed for this VM/disk. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.CdRomInsertParams: type: object properties: backingInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDisk' additionalProperties: false description: Virtual Machine CD-ROM. vmm.v4.2.ahv.config.InsertCdRomApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/insert\ \ Post operation" vmm.v4.2.ahv.config.EjectCdRomApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/eject\ \ Post operation" vmm.v4.2.ahv.config.EnableVmCdRomHydrationApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/enable-hydration\ \ Post operation" vmm.v4.2.ahv.config.DisableVmCdRomHydrationApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms/{extId}/$actions/disable-hydration\ \ Post operation" vmm.v4.2.ahv.config.ListCdRomsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Get operation" vmm.v4.2.ahv.config.CreateCdRomApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/cd-roms\ \ Post operation" vmm.v4.2.ahv.config.CloneOverrideParams: type: object properties: name: maxLength: 80 type: string description: VM name. example: Test VM numSockets: minimum: 1 type: integer description: Number of vCPU sockets. format: int32 example: 65 numCoresPerSocket: minimum: 1 type: integer description: Number of cores per socket. format: int32 example: 8 numThreadsPerCore: minimum: 1 type: integer description: Number of cores per socket. format: int32 example: 44 memorySizeBytes: minimum: 1 type: integer description: Memory size in bytes. format: int64 example: 68 nics: maxItems: 64 minItems: 0 type: array description: NICs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' bootConfig: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.LegacyBoot description: Indicates the order of device types in which the VM should try to boot from. If the boot device order is not provided the system will decide an appropriate boot device order. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.LegacyBoot' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.UefiBoot' guestCustomization: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestCustomizationParams' guestCustomizationProfileConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileConfig' additionalProperties: false description: VM clone override specification. vmm.v4.2.ahv.config.CloneVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/clone\ \ Post operation" vmm.v4.2.ahv.config.Nic: description: Virtual Machine NIC. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: backingInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.EmulatedNic' nicBackingInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VirtualEthernetNic description: Information about how NIC is associated with a VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VirtualEthernetNic' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.SriovNic' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.DpOffloadNic' networkInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NicNetworkInfo' nicNetworkInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VirtualEthernetNicNetworkInfo description: Networking information object for a NIC. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VirtualEthernetNicNetworkInfo' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.SriovNicNetworkInfo' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.DpOffloadNicNetworkInfo' additionalProperties: false vmm.v4.2.ahv.config.LegacyBoot: type: object properties: bootDevice: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.BootDeviceDisk description: The boot device used for legacy boot of the VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.BootDeviceDisk' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.BootDeviceNic' bootOrder: maxItems: 3 minItems: 0 uniqueItems: true type: array description: Indicates the order of device types in which the VM should try to boot from. If the boot device order is not provided the system will decide an appropriate boot device order. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.BootDeviceType' additionalProperties: false description: Legacy boot mode and its associated configuration. vmm.v4.2.ahv.config.UefiBoot: type: object properties: isSecureBootEnabled: type: boolean description: Indicate whether to enable secure boot or not. example: true nvramDevice: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NvramDevice' bootDevice: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.BootDeviceDisk description: The boot device used for UEFI boot of the VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.BootDeviceDisk' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.BootDeviceNic' bootOrder: maxItems: 3 minItems: 0 uniqueItems: true type: array description: Indicates the order of device types in which the VM should try to boot from. If the boot device order is not provided the system will decide an appropriate boot device order. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.BootDeviceType' additionalProperties: false description: UEFI boot mode and its associated configuration. vmm.v4.2.ahv.config.GuestCustomizationParams: type: object properties: config: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Sysprep description: The Nutanix Guest Tools customization settings. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Sysprep' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.CloudInit' additionalProperties: false description: Stage a Sysprep or cloud-init configuration file to be used by the guest for the next boot. Note that the Sysprep command must be used to generalize the Windows VMs before triggering this API call. vmm.v4.2.ahv.config.VmGcProfileConfig: required: - profile type: object properties: profile: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileReference' configOverrideSpec: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileSysprepConfigOverrideSpec description: Sysprep configuration override specification for Windows operating system customization. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileSysprepConfigOverrideSpec' additionalProperties: false description: Override configuration for the VM Guest Customization Profile. vmm.v4.2.ahv.config.EmulatedNic: type: object properties: model: $ref: '#/components/schemas/vmm.v4.2.ahv.config.EmulatedNicModel' macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: MAC address of the NIC. example: d9:a6:4d:f8:dd:fd isConnected: type: boolean description: Indicates whether the NIC is connected or not. Default is True. default: true numQueues: minimum: 1 type: integer description: The number of Tx/Rx queue pairs for this NIC. default: 1 additionalProperties: false description: "Defines a NIC emulated by the hypervisor. This object is now deprecated.\ \ If both deprecated and new objects are present, the new object VirtualEthernetNic\ \ takes precedence." deprecated: true vmm.v4.2.ahv.config.VirtualEthernetNic: type: object properties: model: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VirtualEthernetNicModel' macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: MAC address of the NIC. example: 83:9c:6c:4e:ae:35 isConnected: type: boolean description: Indicates whether the NIC is connected or not. Default is True. default: true numQueues: minimum: 1 type: integer description: The number of Tx/Rx queue pairs for this NIC. default: 1 additionalProperties: false description: Defines a Virtual Ethernet NIC. vmm.v4.2.ahv.config.SriovNic: required: - sriovProfileReference type: object properties: sriovProfileReference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NicProfileReference' hostPcieDeviceReference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HostPcieDeviceReference' macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: MAC address of the NIC. example: c0:ba:4e:ae:b6:ec isConnected: type: boolean description: Indicates whether the NIC is connected or not. Default is True. default: true additionalProperties: false description: Defines an SR-IOV NIC. vmm.v4.2.ahv.config.DpOffloadNic: required: - dpOffloadProfileReference type: object properties: dpOffloadProfileReference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NicProfileReference' hostPcieDeviceReference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HostPcieDeviceReference' macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: MAC address of the NIC. example: 9e:aa:f1:62:07:33 isConnected: type: boolean description: Indicates whether the NIC is connected or not. Default is True. default: true additionalProperties: false description: Defines a DP Offload NIC. vmm.v4.2.ahv.config.NicNetworkInfo: type: object properties: nicType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NicType' networkFunctionChain: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NetworkFunctionChainReference' networkFunctionNicType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NetworkFunctionNicType' subnet: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SubnetReference' vlanMode: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VlanMode' trunkedVlans: maxItems: 4095 minItems: 0 uniqueItems: true type: array description: "List of networks to trunk if VLAN mode is marked as TRUNKED.\ \ If empty and VLAN mode is set to TRUNKED, all the VLANs are trunked." items: minimum: 0 type: integer example: 94 shouldAllowUnknownMacs: type: boolean description: Indicates whether an unknown unicast traffic is forwarded to this NIC or not. This is applicable only for the NICs on the overlay subnets. example: false ipv4Config: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv4Config' ipv4Info: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv4Info' additionalProperties: false description: "Networking information object for a NIC. This object is now deprecated.\ \ If both deprecated and new objects are present, the new object VirtualEthernetNicNetworkInfo\ \ takes precedence." deprecated: true vmm.v4.2.ahv.config.VirtualEthernetNicNetworkInfo: type: object properties: nicType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NicType' networkFunctionChain: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NetworkFunctionChainReference' networkFunctionNicType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NetworkFunctionNicType' subnet: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SubnetReference' vlanMode: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VlanMode' trunkedVlans: maxItems: 4095 minItems: 0 uniqueItems: true type: array description: "List of networks to trunk if VLAN mode is marked as TRUNKED.\ \ If empty and VLAN mode is set to TRUNKED, all the VLANs are trunked." items: minimum: 0 type: integer example: 90 shouldAllowUnknownMacs: type: boolean description: Indicates whether an unknown unicast traffic is forwarded to this NIC or not. This is applicable only for the NICs on the overlay subnets. example: true ipv4Config: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv4Config' ipv4Info: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv4Info' ipv6Info: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv6Info' additionalProperties: false description: Networking information object for a Virtual Ethernet NIC. vmm.v4.2.ahv.config.SriovNicNetworkInfo: type: object properties: vlanId: type: integer description: VLAN ID for the SR-IOV NIC. example: 78 additionalProperties: false description: Networking information object for an SR-IOV NIC. vmm.v4.2.ahv.config.DpOffloadNicNetworkInfo: type: object properties: subnet: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SubnetReference' vlanMode: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VlanMode' trunkedVlans: maxItems: 4095 minItems: 0 uniqueItems: true type: array description: "List of networks to trunk if VLAN mode is marked as TRUNKED.\ \ If empty and VLAN mode is set to TRUNKED, all the VLANs are trunked." items: minimum: 0 type: integer example: 79 shouldAllowUnknownMacs: type: boolean description: Indicates whether an unknown unicast traffic is forwarded to this NIC or not. This is applicable only for the NICs on the overlay subnets. example: true ipv4Config: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv4Config' ipv4Info: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv4Info' ipv6Info: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Ipv6Info' additionalProperties: false description: Networking information object for a DP Offload NIC. vmm.v4.2.ahv.config.EmulatedNicModel: type: string description: Options for the NIC emulation. enum: - VIRTIO - E1000 - $UNKNOWN - $REDACTED x-enumDescriptions: VIRTIO: The NIC adapter type is Virtio. E1000: The NIC adapter type is E1000. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.VirtualEthernetNicModel: type: string description: Options for the NIC emulation. enum: - VIRTIO - E1000 - $UNKNOWN - $REDACTED x-enumDescriptions: VIRTIO: The NIC adapter type is Virtio. E1000: The NIC adapter type is E1000. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.NicProfileReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Globally unique identifier of a NIC profile. It should be of type UUID. example: 4544d36f-4b7e-458f-a9e1-b0df2baef537 additionalProperties: false description: Reference to a NIC profile. vmm.v4.2.ahv.config.HostPcieDeviceReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Globally unique identifier of the host PCIe device. It should be of type UUID. example: 021539e2-49c4-48e7-ba3a-603dc8575053 additionalProperties: false description: Reference to the host PCIe device. vmm.v4.2.ahv.config.NicType: type: string description: NIC type. Defaults to NORMAL_NIC. enum: - NORMAL_NIC - DIRECT_NIC - NETWORK_FUNCTION_NIC - SPAN_DESTINATION_NIC - $UNKNOWN - $REDACTED x-enumDescriptions: SPAN_DESTINATION_NIC: The type of NIC is Span-Destination. NORMAL_NIC: The type of NIC is Normal. DIRECT_NIC: The type of NIC is Direct. NETWORK_FUNCTION_NIC: The type of NIC is Network-Function. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.NetworkFunctionChainReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of a network function chain. It should be of type UUID. example: 87372032-f826-4716-994f-178d0f09e2dc additionalProperties: false description: The network function chain associates with the NIC. Only valid if nic_type is NORMAL_NIC. vmm.v4.2.ahv.config.NetworkFunctionNicType: type: string description: The type of this Network function NIC. Defaults to INGRESS. enum: - INGRESS - EGRESS - TAP - $UNKNOWN - $REDACTED x-enumDescriptions: TAP: The type of Network-Function NIC is Tap. EGRESS: The type of Network-Function NIC is Egress. INGRESS: The type of Network-Function NIC is Ingress. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.SubnetReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of a subnet of type UUID. example: c899f9ec-5958-4d10-968f-53353f5ac272 additionalProperties: false description: Network identifier for this adapter. Only valid if nic_type is NORMAL_NIC or DIRECT_NIC. vmm.v4.2.ahv.config.VlanMode: type: string description: "By default, all the virtual NICs are created in ACCESS mode, which\ \ permits only one VLAN per virtual network. TRUNKED mode allows multiple\ \ VLANs on a single VM NIC for network-aware user VMs." enum: - ACCESS - TRUNK - $UNKNOWN - $REDACTED x-enumDescriptions: TRUNK: The virtual NIC is created in TRUNKED mode. $UNKNOWN: | Unknown value. ACCESS: The virtual NIC is created in ACCESS mode. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.Ipv4Config: type: object properties: shouldAssignIp: type: boolean description: "If set to true (default value), an IP address must be assigned\ \ to the VM NIC - either the one explicitly specified by the user or allocated\ \ automatically by the IPAM service by not specifying the IP address.\ \ If false, then no IP assignment is required for this VM NIC." example: false ipAddress: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' secondaryIpAddressList: maxItems: 100 minItems: 0 type: array description: Secondary IP addresses for the NIC. items: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' additionalProperties: false description: The IP address configurations. vmm.v4.2.ahv.config.Ipv4Info: type: object properties: learnedIpAddresses: maxItems: 256 minItems: 0 uniqueItems: true type: array description: The IP addresses as found on the guest VM for the NIC. readOnly: true items: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' additionalProperties: false description: The runtime IP address information of the NIC. vmm.v4.2.ahv.config.Ipv6Info: type: object properties: learnedIpv6Addresses: maxItems: 256 minItems: 0 uniqueItems: true type: array description: The IPv6 addresses as found on the guest VM for the NIC. readOnly: true items: $ref: '#/components/schemas/common.v1.0.config.IPv6Address' additionalProperties: false description: The runtime IPv6 address information of the NIC. vmm.v4.2.ahv.config.BootDeviceDisk: type: object properties: diskAddress: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DiskAddress' additionalProperties: false description: The disk that will be used to boot the VM. vmm.v4.2.ahv.config.BootDeviceNic: type: object properties: macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: Mac address of the NIC that will be used to boot the VM. example: 00:f0:c6:15:87:ab additionalProperties: false description: The NIC that will be used to boot the VM. vmm.v4.2.ahv.config.BootDeviceType: type: string description: "The type of boot device. Valid values are CDROM, NIC, and DISK." enum: - CDROM - DISK - NETWORK - $UNKNOWN - $REDACTED x-enumDescriptions: NETWORK: The type of boot device is NIC. $UNKNOWN: | Unknown value. DISK: The type of boot device is DISK. $REDACTED: | Redacted value. CDROM: The type of boot device is CD-ROM. vmm.v4.2.ahv.config.NvramDevice: type: object properties: backingStorageInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDisk' additionalProperties: false description: Configuration for NVRAM to be presented to the VM. vmm.v4.2.ahv.config.Sysprep: type: object properties: installType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.InstallType' sysprepScript: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Unattendxml description: The Sysprep script for guest customisation of VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Unattendxml' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.CustomKeyValues' additionalProperties: false description: "If this field is set, the guest will be customized using Sysprep.\ \ Either unattend_xml or custom_key_values should be provided. If custom_key_values\ \ are provided then the unattended answer file will be generated using these\ \ key-value pairs." vmm.v4.2.ahv.config.CloudInit: type: object properties: datasourceType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CloudInitDataSourceType' metadata: maxLength: 32000 type: string description: The contents of the meta_data configuration for cloud-init. This can be formatted as YAML or JSON. The value must be base64 encoded. example: string cloudInitScript: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Userdata description: The script to use for cloud-init. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Userdata' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.CustomKeyValues' additionalProperties: false description: "If this field is set, the guest will be customized using cloud-init.\ \ Either user_data or custom_key_values should be provided. If custom_key_ves\ \ are provided then the user data will be generated using these key-value\ \ pairs." vmm.v4.2.ahv.config.InstallType: type: string description: "Indicates whether the guest will be freshly installed using this\ \ unattend configuration, or this unattend configuration will be applied to\ \ a pre-prepared image. Default is 'PREPARED'." enum: - FRESH - PREPARED - $UNKNOWN - $REDACTED x-enumDescriptions: PREPARED: This unattended configuration will be applied to a pre-prepared image. $UNKNOWN: | Unknown value. FRESH: The guest OS will be freshly installed using this unattended configuration. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.Unattendxml: type: object properties: value: maxLength: 32000 type: string description: Value of Sysprep unattend xml definition. The value must be base64 encoded. example: string additionalProperties: false description: "This field contains a Sysprep unattend xml definition, as a string.\ \ The value must be base64 encoded." vmm.v4.2.ahv.config.CustomKeyValues: type: object properties: keyValuePairs: maxItems: 32 minItems: 0 type: array description: The list of the individual KeyValuePair elements. items: $ref: '#/components/schemas/common.v1.0.config.KVPair' additionalProperties: false description: A collection of key/value pairs. vmm.v4.2.ahv.config.CloudInitDataSourceType: type: string description: "Type of datasource. Default: CONFIG_DRIVE_V2" enum: - CONFIG_DRIVE_V2 - $UNKNOWN - $REDACTED x-enumDescriptions: CONFIG_DRIVE_V2: The type of datasource for cloud-init is Config Drive V2. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.Userdata: type: object properties: value: maxLength: 128000 type: string description: The value for the cloud-init user_data. example: string additionalProperties: false description: "The contents of the user_data configuration for cloud-init. This\ \ can be formatted as YAML, JSON, or could be a shell script. The value must\ \ be base64 encoded." vmm.v4.2.ahv.config.VmGcProfileReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the VM Guest Customization profile. example: 972b7b96-a2f7-4a5a-a315-050c4736db1f additionalProperties: false description: Reference to a VM Guest Customization profile. vmm.v4.2.ahv.config.VmGcProfileSysprepConfigOverrideSpec: required: - customization type: object properties: customization: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileSysprepParamsOverrideSpec description: Customization override information for the Windows operating system. You can either override specific sysprep parameters or provide a custom unattend.xml file to override the entire configuration. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileSysprepParamsOverrideSpec' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileAnswerFileOverrideSpec' additionalProperties: false description: Sysprep configuration override specification for Windows operating system customization. vmm.v4.2.ahv.config.VmGcProfileSysprepParamsOverrideSpec: type: object properties: generalSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileGeneralSettingsOverrideSpec' firstLogonCommands: maxItems: 32 minItems: 0 type: array description: "Override for first logon commands. This overrides the first\ \ logon commands from the referenced profile. Commands are executed in\ \ the order specified. To completely discard the setting from the referenced\ \ profile, specify an empty array as the value." items: type: string example: cmd.exe /c echo Setting up environment localeSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileLocaleSettingsOverrideSpec' workgroupOrDomainInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileWorkgroupOverrideSpec description: Override specification for workgroup or domain information. You can either provide a new workgroup or domain settings or discard the settings from the referenced profile. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileWorkgroupOverrideSpec' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDomainSettingsOverrideSpec' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' networkSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileNetworkSettingsOverrideSpec' additionalProperties: false description: Override specification for sysprep parameters. These settings override the corresponding parameters from the referenced profile. Any parameter not specified inherits from the referenced profile. vmm.v4.2.ahv.config.VmGcProfileAnswerFileOverrideSpec: required: - unattendXml type: object properties: unattendXml: maxLength: 100000 minLength: 1 type: string description: The custom unattend.xml file content as a string. This replaces the unattend.xml from the referenced VM Guest Customization Profile. Note that double quotes in the XML file must be escaped to maintain correctness. example: string additionalProperties: false description: "Custom unattend.xml file for sysprep configuration. When provided,\ \ this completely overrides the unattend.xml from the referenced profile." vmm.v4.2.ahv.config.VmGcProfileGeneralSettingsOverrideSpec: type: object properties: computerName: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileComputerName description: "Override mechanism for computer name generation. You can either\ \ use the VM name, provide a computer name, or discard the setting from\ \ the referenced profile. If using a VM name or computer name, meet the\ \ sysprep's computer name requirements; otherwise, the request would fail." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileComputerName' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileUseVmNameOverrideSpec' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' timezone: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileTimezone description: "Override for timezone setting. You can either provide a new\ \ timezone value or discard the setting from the referenced profile. For\ \ valid timezone values, refer to Windows sysprep documentation." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileTimezone' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' administratorPassword: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileAdministratorPassword description: Override for administrator password. You can either provide a new password or discard the setting from the referenced profile. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileAdministratorPassword' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' autoLogonSettings: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec' windowsProductKey: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileWindowsProductKey description: Override for Windows product key. You can either provide a new product key or discard the setting from the referenced profile. Note that entering an invalid product key causes Windows Setup to fail. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileWindowsProductKey' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' registeredOwner: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileRegisteredOwner description: Override for registered owner information. You can either provide new owner details or discard the setting from the referenced profile. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileRegisteredOwner' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' registeredOrganization: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileRegisteredOrganization description: Override for registered organization information. You can either provide new organization details or discard the setting from the referenced profile. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileRegisteredOrganization' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' additionalProperties: false description: "Override specification for general Windows unattended installation\ \ settings. These settings override the corresponding general settings from\ \ the referenced profile. To completely discard the setting from the referenced\ \ profile, specify an empty object as the value." vmm.v4.2.ahv.config.VmGcProfileLocaleSettingsOverrideSpec: type: object properties: userLocale: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride description: "Override for per-user locale settings used for formatting\ \ dates, times, currency, and numbers. You can either provide a new locale\ \ value or discard the setting from the referenced profile. Value must\ \ follow RFC 3066 language-tagging conventions, for example, en-US, fr-FR,\ \ es-ES." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileLocaleSettingOverride' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' systemLocale: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride description: "Override for the default language used for non-Unicode programs.\ \ You can either provide a new locale value or discard the setting from\ \ the referenced profile. Value must follow RFC 3066 language-tagging\ \ conventions, for example, en-US, fr-FR, es-ES." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileLocaleSettingOverride' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' uiLanguage: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileLocaleSettingOverride description: "Override for the default system language used to display user\ \ interface items. You can either provide a new language value or discard\ \ the setting from the referenced profile. Value must follow RFC 3066\ \ language-tagging conventions, for example, en-US, fr-FR, es-ES." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileLocaleSettingOverride' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDiscardSettings' additionalProperties: false description: "Override specification for language and input locale settings.\ \ These settings override the corresponding locale settings from the referenced\ \ profile. To completely discard the setting from the referenced profile,\ \ specify an empty object as the value." vmm.v4.2.ahv.config.VmGcProfileWorkgroupOverrideSpec: required: - name type: object properties: name: maxLength: 15 minLength: 1 type: string description: Override value for workgroup name. This overrides the workgroup name from the referenced profile. It must be a valid NetBIOS name. example: string additionalProperties: false description: Override specification for workgroup settings. This overrides the workgroup configuration from the referenced profile. vmm.v4.2.ahv.config.VmGcProfileDomainSettingsOverrideSpec: required: - credentials type: object properties: credentials: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDomainCredentialsOverrideSpec' additionalProperties: false description: Override specification for domain settings. This overrides the domain configuration from the referenced profile. vmm.v4.2.ahv.config.VmGcProfileDiscardSettings: type: object properties: {} additionalProperties: false description: "Discard the corresponding setting from the referenced profile.\ \ When this is specified, the setting will be completely discarded during\ \ VM deployment." vmm.v4.2.ahv.config.VmGcProfileNetworkSettingsOverrideSpec: type: object properties: nicConfigList: maxItems: 64 minItems: 0 type: array description: Override specification for NIC configuration list. This overrides the NIC configurations from the referenced profile. Configurations are applied to NICs in serial order. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileNicConfigOverrideSpec' additionalProperties: false description: "Override specification for network settings. These settings override\ \ the corresponding network settings from the referenced profile. To completely\ \ discard the setting from the referenced profile, specify an empty object\ \ as the value." vmm.v4.2.ahv.config.VmGcProfileComputerName: required: - value type: object properties: value: pattern: "^[^\\s{}~[\\]\\\\^':;<=>?@!\"#$%`()+\\/.,*&]{1,15}$" type: string description: Computer name value. example: string additionalProperties: false description: Computer name of the VM. vmm.v4.2.ahv.config.VmGcProfileUseVmNameOverrideSpec: type: object properties: {} additionalProperties: false description: The computer name of the VM should be the same as the VM's name. vmm.v4.2.ahv.config.VmGcProfileTimezone: required: - value type: object properties: value: maxLength: 256 minLength: 1 type: string description: Timezone value. example: Greenwich Standard Time additionalProperties: false description: "The computer's time zone in string format. For different timezone\ \ values, refer to the Windows unattend installation documentation." vmm.v4.2.ahv.config.VmGcProfileAdministratorPassword: required: - value type: object properties: value: maxLength: 256 minLength: 1 type: string description: Administrator password value. example: abc@123 additionalProperties: false description: Password to be configured for built-in Administrator account. vmm.v4.2.ahv.config.VmGcProfileAutoLogonSettingsOverrideSpec: type: object properties: logonCount: maximum: 32767 minimum: 1 type: integer description: Override value for the number of automatic logons allowed. This overrides the logon count from the referenced profile. format: int32 example: 1 additionalProperties: false description: "Override specification for autologon settings. These settings\ \ override the corresponding autologon settings from the referenced profile.\ \ To completely discard the setting from the referenced profile, specify an\ \ empty object as the value." vmm.v4.2.ahv.config.VmGcProfileWindowsProductKey: required: - value type: object properties: value: pattern: "^[A-Z0-9]{5}(-[A-Z0-9]{5}){4}$" type: string description: Windows product key value. example: ABCD1-EFGH2-IJKL3-MNOP4-QRST5 additionalProperties: false description: The product key to use to install and activate Windows. Note that entering an invalid product key causes Windows Setup to fail. vmm.v4.2.ahv.config.VmGcProfileRegisteredOwner: required: - value type: object properties: value: maxLength: 256 minLength: 1 type: string description: Registered owner value. example: Admin additionalProperties: false description: "Full name of the end user. Note that this is the full name in\ \ the format, not only the username." vmm.v4.2.ahv.config.VmGcProfileRegisteredOrganization: required: - value type: object properties: value: maxLength: 256 minLength: 1 type: string description: Registered organization value. example: Nutanix additionalProperties: false description: Name of the organization of the end user. vmm.v4.2.ahv.config.VmGcProfileLocaleSettingOverride: required: - value type: object properties: value: maxLength: 64 pattern: "^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$" type: string description: Locale setting value. example: en-US additionalProperties: false description: "Locale setting value based on RFC 3066 language-tagging conventions,\ \ for example, en-US, fr-FR, es-ES." vmm.v4.2.ahv.config.VmGcProfileDomainCredentialsOverrideSpec: type: object properties: domainName: maxLength: 255 minLength: 1 type: string description: Override value for domain name. This overrides the domain name from the referenced profile. Can be either the fully qualified DNS name or NetBIOS name of the domain. example: nutanix.com username: maxLength: 256 minLength: 1 type: string description: Override value for domain username. This overrides the domain username from the referenced profile. example: user password: maxLength: 256 minLength: 1 type: string description: Override value for domain password. This overrides the domain password from the referenced profile. example: abcd@1234 additionalProperties: false description: Override specification for domain credentials. This overrides the domain credentials from the referenced profile. vmm.v4.2.ahv.config.VmGcProfileNicConfigOverrideSpec: required: - ipv4Config type: object properties: dnsConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileDnsConfigOverrideSpec' ipv4Config: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmGcProfileUseDhcpOverrideSpec description: "Override mechanism for IPv4 configuration. You can either\ \ use DHCP, provide a custom IPv4 configuration, or discard the setting\ \ from the referenced profile. If DHCP is specified, DhcpEnabled is set\ \ to True in the unattend.xml." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileUseDhcpOverrideSpec' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileNicIpv4ConfigOverrideSpec' additionalProperties: false description: Override specification for individual NIC configuration. This overrides the network settings for a specific NIC from the referenced profile. vmm.v4.2.ahv.config.VmGcProfileDnsConfigOverrideSpec: type: object properties: preferredDnsServerAddress: pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" type: string description: Override value for preferred DNS server address. This overrides the preferred DNS server from the referenced profile. example: 0.0.0.0 alternateDnsServerAddresses: maxItems: 4 minItems: 0 type: array description: Override value for alternate DNS server addresses. This overrides the alternate DNS servers from the referenced profile. items: pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" type: string example: 0.0.0.0 additionalProperties: false description: Override specification for DNS configuration. This overrides the DNS settings from the referenced profile. vmm.v4.2.ahv.config.VmGcProfileUseDhcpOverrideSpec: type: object properties: {} additionalProperties: false description: DHCP is enabled for the IPv4 protocol. vmm.v4.2.ahv.config.VmGcProfileNicIpv4ConfigOverrideSpec: type: object properties: ipAddress: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' defaultGateways: maxItems: 1 minItems: 0 type: array description: Override value for default gateways. This overrides the default gateway configuration from the referenced profile. items: pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" type: string example: 0.0.0.0 additionalProperties: false description: Override specification for IPv4 configuration details. This overrides the IPv4 configuration from the referenced profile. vmm.v4.2.ahv.config.GetDiskApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Disk oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Get operation" vmm.v4.2.ahv.config.Disk: description: Virtual Machine disk (VM disk). allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: diskAddress: $ref: '#/components/schemas/vmm.v4.2.ahv.config.DiskAddress' backingInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmDisk description: Supporting storage to create virtual disk on. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDisk' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.ADSFVolumeGroupReference' customAttributes: maxItems: 64 minItems: 0 type: array description: A collection of user-defined key/value pairs as strings in the format 'key:value' representing custom attributes of the VM Disk. readOnly: true items: pattern: "^(?!ntnx)[a-z][a-z0-9\\_\\-\\.\\/]{1,61}[a-z0-9](?::[^:]{1,1024})?$" type: string example: string additionalProperties: false vmm.v4.2.ahv.config.UpdateDiskApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Put operation" vmm.v4.2.ahv.config.DeleteDiskApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.ADSFVolumeGroupReference: required: - volumeGroupExtId type: object properties: volumeGroupExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an ADSF volume group. It should be of type UUID. example: a62af905-dce4-4284-984c-040af10f8e0f additionalProperties: false description: Reference to an ADSF Volume Group. vmm.v4.2.ahv.config.UpdateCustomAttributesParams: required: - customAttributes type: object properties: customAttributes: maxItems: 64 minItems: 0 type: array description: List of custom attributes to be added/removed. items: pattern: "^(?!ntnx)[a-z][a-z0-9\\_\\-\\.\\/]{1,61}[a-z0-9](?::[^:]{1,1024})?$" type: string example: string additionalProperties: false description: List of custom attributes to be added/removed. vmm.v4.2.ahv.config.AddVmDiskCustomAttributesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/add-custom-attributes\ \ Post operation" vmm.v4.2.ahv.config.RemoveVmDiskCustomAttributesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/remove-custom-attributes\ \ Post operation" vmm.v4.2.ahv.config.EnableVmDiskHydrationApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/enable-hydration\ \ Post operation" vmm.v4.2.ahv.config.DisableVmDiskHydrationApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks/{extId}/$actions/disable-hydration\ \ Post operation" vmm.v4.2.ahv.config.ListDisksApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Get operation" vmm.v4.2.ahv.config.CreateDiskApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/disks\ \ Post operation" vmm.v4.2.ahv.config.GetVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Vm oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Get operation" vmm.v4.2.ahv.config.Vm: description: VM configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 80 type: string description: VM name. example: Test VM description: type: string description: VM description. example: Description for your VM createTime: type: string description: VM creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: VM last updated time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 source: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmSourceReference' numSockets: minimum: 1 type: integer description: Number of vCPU sockets. format: int32 example: 42 numCoresPerSocket: minimum: 1 type: integer description: Number of cores per socket. format: int32 example: 42 numThreadsPerCore: minimum: 1 type: integer description: Number of threads per core. format: int32 example: 94 numNumaNodes: type: integer description: Number of NUMA nodes. 0 means NUMA is disabled. format: int32 example: 36 memorySizeBytes: minimum: 1 type: integer description: Memory size in bytes. format: int64 example: 59 isVcpuHardPinningEnabled: type: boolean description: Indicates whether the vCPUs should be hard pinned to specific pCPUs or not. example: false isCpuPassthroughEnabled: type: boolean description: Indicates whether to passthrough the host CPU features to the guest or not. Enabling this will make VM incapable of live migration. example: true enabledCpuFeatures: maxItems: 256 minItems: 0 uniqueItems: true type: array description: The list of additional CPU features to be enabled. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CpuFeature' isMemoryOvercommitEnabled: type: boolean description: "Indicates whether the memory overcommit feature should be\ \ enabled for the VM or not. If enabled, parts of the VM memory may\ \ reside outside of the hypervisor physical memory. Once enabled, it\ \ should be expected that the VM may suffer performance degradation." example: true isGpuConsoleEnabled: type: boolean description: Indicates whether the vGPU console is enabled or not. example: false isCpuHotplugEnabled: type: boolean description: Indicates whether the VM CPU hotplug is enabled. example: true isScsiControllerEnabled: type: boolean description: Indicates whether the VM SCSI controller is enabled. example: true generationUuid: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Generation UUID of the VM of type UUID. example: a11c23d6-95ea-4078-98ca-412a25e91d8c biosUuid: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: BIOS UUID of the VM of type UUID. example: 45f7d4bc-10ec-47a9-a6e0-cd654d26f2d0 categories: maxItems: 256 minItems: 0 type: array description: Categories for the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CategoryReference' project: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ProjectReference' ownershipInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.OwnershipInfo' host: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HostReference' cluster: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ClusterReference' availabilityZone: $ref: '#/components/schemas/vmm.v4.2.ahv.config.AvailabilityZoneReference' guestCustomization: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestCustomizationParams' guestTools: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestTools' hardwareClockTimezone: maxLength: 64 type: string description: VM hardware clock timezone in IANA TZDB format (America/Los_Angeles). default: UTC isBrandingEnabled: type: boolean description: Indicates whether to remove AHV branding from VM firmware tables or not. example: false bootConfig: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.LegacyBoot description: Indicates the order of device types in which the VM should try to boot from. If the boot device order is not provided the system will decide an appropriate boot device order. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.LegacyBoot' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.UefiBoot' isVgaConsoleEnabled: type: boolean description: Indicates whether the VGA console should be disabled or not. example: true machineType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.MachineType' powerState: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PowerState' vtpmConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VtpmConfig' isAgentVm: type: boolean description: "Indicates whether the VM is an agent VM or not. When their\ \ host enters maintenance mode, once the normal VMs are evacuated, the\ \ agent VMs are powered off. When the host is restored, agent VMs are\ \ powered on before the normal VMs are restored. In other words, agent\ \ VMs cannot be HA-protected or live migrated." example: true apcConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ApcConfig' isLiveMigrateCapable: type: boolean description: "Indicates whether the VM is capable of live migrating to\ \ another host or not, based on its configuration." readOnly: true example: true isCrossClusterMigrationInProgress: type: boolean description: Indicates whether the VM is currently undergoing cross cluster migration. readOnly: true example: true storageConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ADSFVmStorageConfig' disks: maxItems: 1024 minItems: 0 type: array description: Disks attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Disk' cdRoms: maxItems: 10 minItems: 0 type: array description: CD-ROMs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' nics: maxItems: 64 minItems: 0 type: array description: NICs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' gpus: maxItems: 16 minItems: 0 type: array description: GPUs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Gpu' serialPorts: maxItems: 4 minItems: 0 type: array description: Serial ports configured on the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' protectionType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ProtectionType' protectionPolicyState: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ProtectionPolicyState' pcieDevices: maxItems: 64 minItems: 0 type: array description: PCIe devices attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDevice' customAttributes: maxItems: 64 minItems: 0 type: array description: A collection of user-defined key/value pairs as strings in the format 'key:value' representing custom attributes of the VM. readOnly: true items: pattern: "^(?!ntnx)[a-z][a-z0-9\\_\\-\\.\\/]{1,61}[a-z0-9](?::[^:]{1,1024})?$" type: string example: string vmGuestCustomizationStatus: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGuestCustomizationStatus' additionalProperties: false vmm.v4.2.ahv.config.UpdateVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Put operation" vmm.v4.2.ahv.config.DeleteVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.VmSourceReference: type: object properties: entityType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmSourceReferenceEntityType' extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM of type UUID. readOnly: true example: 1d88b46a-a971-4059-8f45-279214125ebe additionalProperties: false description: Reference to an entity from which the VM should be cloned or created. vmm.v4.2.ahv.config.CpuFeature: type: string description: The list of additional CPU features to be enabled. enum: - HARDWARE_VIRTUALIZATION - $UNKNOWN - $REDACTED x-enumDescriptions: $UNKNOWN: | Unknown value. HARDWARE_VIRTUALIZATION: "Indicates whether hardware assisted virtualization\ \ should be enabled for the Guest OS. Once enabled, the Guest OS has the\ \ ability to deploy a nested hypervisor." $REDACTED: | Redacted value. vmm.v4.2.ahv.config.ProjectReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an instance of type UUID. example: 15608f42-e541-4125-a4b6-ff87a4f28844 additionalProperties: false description: Reference to a project. vmm.v4.2.ahv.config.OwnershipInfo: type: object properties: owner: $ref: '#/components/schemas/vmm.v4.2.ahv.config.OwnerReference' additionalProperties: false description: Ownership information for the VM. vmm.v4.2.ahv.config.HostReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of a host type UUID. example: 3ec856af-380d-425c-bc68-1c63a246a057 additionalProperties: false description: "Reference to the host, the VM is running on." vmm.v4.2.ahv.config.AvailabilityZoneReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an availability zone type UUID. example: 9f8773d9-3293-4823-80dc-879bf31fa30a additionalProperties: false description: Reference to an availability zone. vmm.v4.2.ahv.config.GuestTools: type: object properties: version: type: string description: Version of Nutanix Guest Tools installed on the VM. readOnly: true example: string isInstalled: type: boolean description: Indicates whether Nutanix Guest Tools is installed on the VM or not. readOnly: true example: false isEnabled: type: boolean description: Indicates whether Nutanix Guest Tools is enabled or not. example: false isIsoInserted: type: boolean description: Indicates whether Nutanix Guest Tools ISO is inserted or not. readOnly: true example: true capabilities: maxItems: 2 minItems: 0 uniqueItems: true type: array description: The list of the application names that are enabled on the guest VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NgtCapability' availableVersion: type: string description: Version of Nutanix Guest Tools available on the cluster. readOnly: true example: string guestOsVersion: type: string description: "Version of the operating system on the VM. This object is\ \ now deprecated. If both deprecated and new objects are present, the\ \ new object GuestInfo/GuestOsFullName takes precedence." readOnly: true example: string deprecated: true isReachable: type: boolean description: Indicates whether the communication from VM to CVM is active or not. readOnly: true example: false isVssSnapshotCapable: type: boolean description: Indicates whether the VM is configured to take VSS snapshots through NGT or not. readOnly: true example: true isVmMobilityDriversInstalled: type: boolean description: "Indicates whether the VM mobility drivers are installed on\ \ the VM or not. This object is now deprecated. If both deprecated and\ \ new objects are present, the new object GuestInfoVmMobilityDriversInstalledDescription\ \ takes precedence." readOnly: true example: true deprecated: true isCommunicationActiveOverSerialPort: type: boolean description: Indicates whether the Nutanix Guest Tools communication over Serial Port is active or not. readOnly: true example: true guestInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestInfo' additionalProperties: false description: The details about Nutanix Guest Tools for a VM. vmm.v4.2.ahv.config.MachineType: type: string description: Machine type for the VM. Machine type Q35 is required for secure boot and does not support IDE disks. enum: - PC - PSERIES - Q35 - $UNKNOWN - $REDACTED x-enumDescriptions: PSERIES: The machine type for the VM is PSERIES. Q35: The machine type for the VM is Q35. PC: The machine type for the VM is PC. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.PowerState: type: string description: The current power state of the VM. enum: - "ON" - "OFF" - PAUSED - UNDETERMINED - $UNKNOWN - $REDACTED x-enumDescriptions: PAUSED: The VM is paused. UNDETERMINED: The VM power state is currently unknown. $UNKNOWN: | Unknown value. "OFF": The VM is powered-off. $REDACTED: | Redacted value. "ON": The VM is powered-on. vmm.v4.2.ahv.config.VtpmConfig: type: object properties: isVtpmEnabled: type: boolean description: Indicates whether the virtual trusted platform module is enabled for the Guest OS or not. example: false version: type: string description: Virtual trusted platform module version. readOnly: true example: string vtpmDevice: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VtpmDevice' additionalProperties: false description: Indicates how the vTPM for the VM should be configured. vmm.v4.2.ahv.config.ApcConfig: type: object properties: isApcEnabled: type: boolean description: "If enabled, the selected CPU model will be retained across\ \ live and cold migrations of the VM." example: true cpuModel: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CpuModelReference' additionalProperties: false description: Advanced Processor Compatibility configuration for the VM. Enabling this retains the CPU model for the VM across power cycles and migrations. vmm.v4.2.ahv.config.ADSFVmStorageConfig: type: object properties: isFlashModeEnabled: type: boolean description: Indicates whether the virtual disk is pinned to the hot tier or not. example: true qosConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.QosConfig' storageLocationInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.StorageLocationInfo' hydrationInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HydrationInfo' additionalProperties: false description: Storage configuration for VM. vmm.v4.2.ahv.config.Gpu: description: Graphics resource information for the virtual machine. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: mode: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GpuMode' deviceId: type: integer description: The device Id of the GPU. format: int32 example: 13 vendor: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GpuVendor' pciAddress: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SBDF' guestDriverVersion: maxLength: 128 type: string description: Last determined guest driver version. readOnly: true example: string name: maxLength: 128 type: string description: Name of the GPU resource. readOnly: true example: string frameBufferSizeBytes: type: integer description: GPU frame buffer size in bytes. format: int64 readOnly: true example: 83 numVirtualDisplayHeads: type: integer description: Number of supported virtual display heads. format: int32 readOnly: true example: 88 fraction: type: integer description: Fraction of the physical GPU assigned. format: int32 readOnly: true example: 87 additionalProperties: false vmm.v4.2.ahv.config.SerialPort: description: Indicates the configuration of serial ports of the VM. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: isConnected: type: boolean description: Indicates whether the serial port is connected or not. example: false index: maximum: 3 minimum: 0 type: integer description: Index of the serial port. Index 1 is reserved for internal usage. example: 3 additionalProperties: false vmm.v4.2.ahv.config.ProtectionType: type: string description: The type of protection applied on a VM. enum: - UNPROTECTED - PD_PROTECTED - RULE_PROTECTED - $UNKNOWN - $REDACTED x-enumDescriptions: PD_PROTECTED: The VM is protected with a protection domain on Prism Element. UNPROTECTED: The VM is not protected. RULE_PROTECTED: The VM is protected with a protection policy on Prism Central. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.ProtectionPolicyState: type: object properties: policy: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PolicyReference' additionalProperties: false description: Status of protection policy applied to this VM. vmm.v4.2.ahv.config.PcieDevice: description: Indicates the information about the PCIe device. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: assignedDeviceInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDeviceInfo' backingInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.PcieDeviceReference description: Indicates the way a PCIe device is associated to the VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDeviceReference' additionalProperties: false vmm.v4.2.ahv.config.VmGuestCustomizationStatus: type: string description: The status of Guest Customization process on the VM. enum: - PENDING - $UNKNOWN - $REDACTED x-enumDescriptions: PENDING: The Guest Customization process is pending and would be attempted on the next power-on of the VM. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.VmSourceReferenceEntityType: type: string description: Reference to an entity from which the VM should be cloned or created. enum: - VM - VM_RECOVERY_POINT - $UNKNOWN - $REDACTED x-enumDescriptions: VM_RECOVERY_POINT: Reference to the recovery point entity from which the VM should be cloned or created. VM: Reference to an entity from which the VM should be cloned or created. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.OwnerReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM owner type UUID. example: 68983c59-1042-4509-ba5f-69643bc85317 additionalProperties: false description: Owner reference. vmm.v4.2.ahv.config.NgtCapability: type: string description: The capabilities of the Nutanix Guest Tools in the VM. enum: - SELF_SERVICE_RESTORE - VSS_SNAPSHOT - $UNKNOWN - $REDACTED x-enumDescriptions: VSS_SNAPSHOT: Enablement status of the Volume Snapshot Service application. $UNKNOWN: | Unknown value. SELF_SERVICE_RESTORE: Enablement status of the Self Service Restore application. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.GuestInfo: type: object properties: guestOsFullName: maxLength: 128 type: string description: Guest operating system full name. readOnly: true example: string isVmMobilityDriversInstalled: type: boolean description: Indicates whether the VM mobility drivers are installed on the VM or not. readOnly: true example: false lastBootUpTime: type: string description: Timestamp indicating the last time the guest OS was booted. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 dnsName: readOnly: true allOf: - $ref: '#/components/schemas/common.v1.0.config.FQDN' - type: object installedVirtIoVersion: maxLength: 12 type: string description: Version of the VirtIO drivers installed on the guest OS. readOnly: true example: string guestOsBuildNumber: maxLength: 32 type: string description: Indicates build number of the guest operating system. readOnly: true example: string additionalProperties: false description: Information retrieved from the guest operating system. vmm.v4.2.ahv.config.VtpmDevice: type: object properties: diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk of type UUID. readOnly: true example: 17d21058-a816-4229-b8b8-9139fb3893eb backingFirmwareDiskStorageInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.BackingFirmwareDiskStorageInfo' additionalProperties: false description: A disk for the Virtual trusted platform module. vmm.v4.2.ahv.config.BackingFirmwareDiskStorageInfo: type: object properties: storageContainer: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskContainerReference' additionalProperties: false description: The backing storage information for the firmware disk. vmm.v4.2.ahv.config.CpuModelReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of the CPU model associated with the VM. example: ce3bfe85-4670-46e1-8731-8275a076ef52 name: maxLength: 64 type: string description: Name of the CPU model associated with the VM. example: Haswell additionalProperties: false description: "CPU model associated with the VM if Advanced Processor Compatibility(APC)\ \ is enabled. If APC is enabled and no CPU model is explicitly set, a default\ \ baseline CPU model is picked by the system. See the APC documentation for\ \ more information" vmm.v4.2.ahv.config.QosConfig: type: object properties: throttledIops: type: integer description: Throttled IOPS for the governed entities. The block size for the I/O is 32 kB. example: 72 additionalProperties: false description: QoS parameters to be enforced. vmm.v4.2.ahv.config.StorageLocationInfo: type: object properties: storageCluster: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ClusterReference' additionalProperties: false description: Represents information about the VM's storage location. StorageLocationInfo is only present for VMs using shared storage from a cluster different from the VM's cluster for compute. vmm.v4.2.ahv.config.HydrationInfo: type: object properties: hydrationStatus: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HydrationStatus' additionalProperties: false description: Instant restore hydration information of a VM. readOnly: true vmm.v4.2.ahv.config.GpuMode: type: string description: The mode of this GPU. enum: - PASSTHROUGH_GRAPHICS - PASSTHROUGH_COMPUTE - VIRTUAL - $UNKNOWN - $REDACTED x-enumDescriptions: PASSTHROUGH_GRAPHICS: The mode of the GPU is Passthrough Graphics. PASSTHROUGH_COMPUTE: The mode of the GPU is Passthrough Compute. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. VIRTUAL: The mode of the GPU is Virtual. vmm.v4.2.ahv.config.GpuVendor: type: string description: The vendor of the GPU. enum: - NVIDIA - INTEL - AMD - $UNKNOWN - $REDACTED x-enumDescriptions: NVIDIA: The vendor of the GPU is NVIDIA. AMD: The vendor of the GPU is AMD. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. INTEL: The vendor of the GPU is Intel. vmm.v4.2.ahv.config.SBDF: type: object properties: segment: type: integer description: PCI Segment. readOnly: true example: 84 bus: type: integer description: "PCI Bus number in hexadecimal, often padded using a leading\ \ zeros to two or four digits." readOnly: true example: 95 device: type: integer description: "PCI Device number in hexadecimal, often padded using a leading\ \ zero to two digits . Sometimes this is also referred to as the slot\ \ number." readOnly: true example: 76 func: type: integer description: PCI Function number in hexadecimal. readOnly: true example: 16 additionalProperties: false description: The (S)egment:(B)us:(D)evice.(F)unction hardware address. See https://wiki.xen.org/wiki/Bus:Device.Function_(BDF)_Notation for more details. vmm.v4.2.ahv.config.PolicyReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an instance of type UUID. example: 7e5426fa-7f81-4c5a-b76d-dc2ce0897e63 additionalProperties: false description: Reference to the policy object in use. vmm.v4.2.ahv.config.PcieDeviceInfo: type: object properties: device: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDeviceReference' additionalProperties: false description: Information about the attached PCIe device to the VM. vmm.v4.2.ahv.config.PcieDeviceReference: type: object properties: deviceExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Globally unique identifier denoting PCIe device label. It should be of type UUID. example: 533addd8-1b54-44da-98c6-8325f7682fee additionalProperties: false description: Reference to the PCIe device. vmm.v4.2.ahv.config.ListVmsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Get operation vmm.v4.2.ahv.config.CreateVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vms Post operation vmm.v4.2.ahv.config.CustomizeGuestVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/customize-guest\ \ Post operation" vmm.v4.2.ahv.config.DiskMigrationParams: type: object properties: migrateDisks: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.MigrationPlans description: "Specifies the VmDisks of a VM for migration and the migration\ \ plan for them. If all the disks of a VM need to be migrated to the same\ \ storage container, only a single migration plan with only the external\ \ ID of the destination storage container is needed. If the disks are\ \ being migrated to different containers, one plan per disk needs to be\ \ specified." oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.MigrationPlans' - $ref: '#/components/schemas/vmm.v4.2.ahv.config.AllDisksMigrationPlan' additionalProperties: false description: "Specifies the VmDisks of a VM for migration and the migration\ \ plan for them. If all the disks of a VM need to be migrated to the same\ \ storage container, only a single migration plan with only the external ID\ \ of the destination storage container is needed. If the disks are being\ \ migrated to different containers, one plan per disk needs to be specified." vmm.v4.2.ahv.config.MigrateVmDisksApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-vm-disks\ \ Post operation" vmm.v4.2.ahv.config.MigrationPlans: type: object properties: plans: maxItems: 1034 minItems: 0 type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ADSFDiskMigrationPlan' additionalProperties: false description: List of migration plans for VM disks. vmm.v4.2.ahv.config.AllDisksMigrationPlan: type: object properties: storageContainer: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskContainerReference' additionalProperties: false description: Defines how all the disks of a VM are migrated to the same target storage container. vmm.v4.2.ahv.config.ADSFDiskMigrationPlan: type: object properties: storageContainer: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskContainerReference' vmDisks: maxItems: 1034 minItems: 0 type: array description: The disks included in the migration plan. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.MigrateDiskReference' additionalProperties: false description: The disk migration plan defines how disks are migrated. vmm.v4.2.ahv.config.MigrateDiskReference: type: object properties: diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk of type UUID. example: b714a6ef-018d-44a6-9069-954d21f9bd2b additionalProperties: false description: Reference to an existing VM disk that needs to be migrated. vmm.v4.2.ahv.config.RevertParams: title: VM revert specification. required: - vmRecoveryPointExtId type: object properties: vmRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of the VM Recovery Point. example: 1d2a1095-9c80-4e11-8f5d-f45cfa1ca610 overrideSpec: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRevertOverrideSpec' additionalProperties: false description: Input for the VM revert operation. Specify the VM Recovery Point ID to which the VM would be reverted. vmm.v4.2.ahv.config.RevertVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/revert\ \ Post operation" vmm.v4.2.ahv.config.VmRevertOverrideSpec: type: object properties: shouldRevertVmCategories: type: boolean description: Indicates whether the VM categories should be reverted to the categories captured in the VM Recovery Point. default: false shouldRevertVmOwner: type: boolean description: Indicates whether the VM owner should be reverted to the owner captured as part of the VM Recovery Point. default: false additionalProperties: false description: Override specification for the VM configuration when reverting a VM to a specific VM Recovery Point. vmm.v4.2.ahv.config.VmCrossClusterMigrateParams: required: - isLiveMigration - targetAvailabilityZone type: object properties: targetAvailabilityZone: $ref: '#/components/schemas/vmm.v4.2.ahv.config.AvailabilityZoneReference' targetCluster: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ClusterReference' isLiveMigration: type: boolean description: Indicates if the migration is performed with a running VM. example: false overrides: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmCrossClusterMigrateOverrides' additionalProperties: false description: Input on how to migrate a VM across clusters. vmm.v4.2.ahv.config.CrossClusterMigrateVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate\ \ Post operation" vmm.v4.2.ahv.config.VmCrossClusterMigrateOverrides: type: object properties: overrideNicList: maxItems: 64 minItems: 0 type: array description: The NIC configuration to apply on the target cluster when migrating a VM from the source cluster to the target cluster. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' storageContainersMapping: maxItems: 256 minItems: 0 type: array description: This optional field specifies the storage container mapping to apply when migrating a VM from the source cluster to the target cluster. It is supported on un-protected VMs only. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.StorageContainerMapping' additionalProperties: false description: Cross cluster migration overrides the VM configuration. vmm.v4.2.ahv.config.StorageContainerMapping: type: object properties: sourceStorageContainer: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskContainerReference' targetStorageContainer: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmDiskContainerReference' additionalProperties: false description: This optional field specifies the storage container mapping to apply when migrating a VM from the source cluster to the target cluster. It is supported on un-protected VMs only. vmm.v4.2.ahv.config.VmMigrateToHostParams: required: - host type: object properties: host: $ref: '#/components/schemas/vmm.v4.2.ahv.config.HostReference' additionalProperties: false description: The destination host to which the VM is migrated. vmm.v4.2.ahv.config.MigrateVmToHostApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/migrate-to-host\ \ Post operation" vmm.v4.2.ahv.config.GenerateConsoleTokenApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/generate-console-token\ \ Post operation" vmm.v4.2.ahv.config.AddVmCustomAttributesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/add-custom-attributes\ \ Post operation" vmm.v4.2.ahv.config.RemoveVmCustomAttributesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/remove-custom-attributes\ \ Post operation" vmm.v4.2.ahv.config.GetGpuApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Gpu oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Gpu' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Get operation" vmm.v4.2.ahv.config.DeleteGpuApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.ListGpusApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Gpu' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Get operation" vmm.v4.2.ahv.config.CreateGpuApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/gpus\ \ Post operation" vmm.v4.2.ahv.config.GetGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.GuestTools oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestTools' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Get operation" vmm.v4.2.ahv.config.UpdateGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools\ \ Put operation" vmm.v4.2.ahv.config.GuestToolsInstallConfig: type: object properties: capabilities: maxItems: 2 minItems: 0 uniqueItems: true type: array description: The list of the application names that are enabled on the guest VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NgtCapability' credential: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Credential' rebootPreference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.RebootPreference' additionalProperties: false description: Arguments for installing Nutanix Guest Tools. vmm.v4.2.ahv.config.InstallVmGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/install\ \ Post operation" vmm.v4.2.ahv.config.Credential: type: object properties: username: maxLength: 256 type: string description: Username for the server. example: test_user password: type: string description: Password for the server. writeOnly: true example: test_password additionalProperties: false description: Sign in credentials for the server. vmm.v4.2.ahv.config.RebootPreference: type: object properties: scheduleType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.ScheduleType' schedule: $ref: '#/components/schemas/vmm.v4.2.ahv.config.RebootPreferenceSchedule' additionalProperties: false description: The restart schedule after installing or upgrading Nutanix Guest Tools. vmm.v4.2.ahv.config.ScheduleType: type: string description: Schedule type for restart. enum: - SKIP - IMMEDIATE - LATER - $UNKNOWN - $REDACTED x-enumDescriptions: LATER: Schedule a restart for a specific time. SKIP: Do not schedule a restart. $UNKNOWN: | Unknown value. IMMEDIATE: Schedule an immediate restart. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.RebootPreferenceSchedule: type: object properties: startTime: type: string description: The start time for a scheduled restart. format: date-time example: 2009-09-23T14:30:00-07:00 additionalProperties: false description: Restart schedule. vmm.v4.2.ahv.config.GuestToolsUpgradeConfig: type: object properties: rebootPreference: $ref: '#/components/schemas/vmm.v4.2.ahv.config.RebootPreference' additionalProperties: false description: Arguments for upgrading Nutanix Guest Tools. vmm.v4.2.ahv.config.UpgradeVmGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/upgrade\ \ Post operation" vmm.v4.2.ahv.config.GuestToolsInsertConfig: type: object properties: capabilities: maxItems: 2 minItems: 0 uniqueItems: true type: array description: The list of the application names that are enabled on the guest VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.NgtCapability' isConfigOnly: type: boolean description: "Indicates that the Nutanix Guest Tools are already installed\ \ on the guest VM, and the ISO is being inserted to update the configuration\ \ of these tools." example: true additionalProperties: false description: Argument for inserting a Nutanix Guest Tools ISO into an available slot. vmm.v4.2.ahv.config.InsertVmGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/insert-iso\ \ Post operation" vmm.v4.2.ahv.config.UninstallVmGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/guest-tools/$actions/uninstall\ \ Post operation" vmm.v4.2.ahv.config.GetNicApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.Nic oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Get operation" vmm.v4.2.ahv.config.UpdateNicApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Put operation" vmm.v4.2.ahv.config.DeleteNicApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.ListNicsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Get operation" vmm.v4.2.ahv.config.CreateNicApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics\ \ Post operation" vmm.v4.2.ahv.config.AssignIpParams: type: object properties: ipAddress: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' additionalProperties: false description: Assigns a specific IP address to a network device attached to a managed network. vmm.v4.2.ahv.config.AssignIpApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/assign-ip\ \ Post operation" vmm.v4.2.ahv.config.ReleaseIpApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/release-ip\ \ Post operation" vmm.v4.2.ahv.config.MigrateNicConfig: required: - migrateType - subnet type: object properties: subnet: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SubnetReference' migrateType: $ref: '#/components/schemas/vmm.v4.2.ahv.config.MigrateNicType' ipAddress: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' additionalProperties: false description: Configurations for migrating a VM NIC. vmm.v4.2.ahv.config.MigrateNicApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/nics/{extId}/$actions/migrate\ \ Post operation" vmm.v4.2.ahv.config.MigrateNicType: type: string description: The type of IP address management for NIC migration. enum: - ASSIGN_IP - RELEASE_IP - $UNKNOWN - $REDACTED x-enumDescriptions: ASSIGN_IP: The type of IP address management for NIC migration is Assign IP. RELEASE_IP: Release IP is the type of IP address management for NIC migration. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.config.AssignVmOwnerApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/assign-owner\ \ Post operation" vmm.v4.2.ahv.config.GetPcieDeviceApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.PcieDevice oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDevice' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Get operation" vmm.v4.2.ahv.config.DeletePcieDeviceApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.ListPcieDevicesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.PcieDevice' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Get operation" vmm.v4.2.ahv.config.CreatePcieDeviceApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/pcie-devices\ \ Post operation" vmm.v4.2.ahv.config.PowerOnVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-on\ \ Post operation" vmm.v4.2.ahv.config.PowerCycleVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-cycle\ \ Post operation" vmm.v4.2.ahv.config.PowerOffVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/power-off\ \ Post operation" vmm.v4.2.ahv.config.ResetVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/reset\ \ Post operation" vmm.v4.2.ahv.config.ShutdownVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" vmm.v4.2.ahv.config.GuestPowerOptions: type: object properties: guestPowerStateTransitionConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestPowerStateTransitionConfig' additionalProperties: false description: Nutanix Guest Tools shutdown mode options. vmm.v4.2.ahv.config.GuestPowerStateTransitionConfig: type: object properties: shouldEnableScriptExec: type: boolean description: Indicates whether to run the set script before the VM shutdowns/restarts. example: true shouldFailOnScriptFailure: type: boolean description: Indicates whether to abort VM shutdown/restart if the script fails. example: true additionalProperties: false description: Additional configuration for Nutanix Gust Tools power state transition. vmm.v4.2.ahv.config.RebootVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" vmm.v4.2.ahv.config.GetVmRecoveryPointApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmRecoveryPoint oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRecoveryPoint' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Get operation" vmm.v4.2.ahv.config.DeleteVmRecoveryPointApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.VmRecoveryPoint: title: VM Recovery Point description: A model that represents VM Recovery Point properties. allOf: - $ref: '#/components/schemas/dataprotection.v4.0.common.BaseVmRecoveryPoint' - type: object properties: vm: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' additionalProperties: false vmm.v4.2.ahv.config.ListVmRecoveryPointsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRecoveryPoint' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Get operation vmm.v4.2.ahv.config.CreateVMRecoveryPointApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points Post operation vmm.v4.2.ahv.config.RestoreVmRecoveryPointParams: type: object properties: isStrictMode: type: boolean description: "If set to false, any VM configuration that cannot be restored\ \ will be dropped or reset to system defaults. This currently applies\ \ to the following fields in the VM configuration: subnets, NIC profiles,\ \ project, and categories. It also handles dropping unknown features on\ \ older PEs. If set to true, the restore operation will run in normal\ \ mode, where any failures will be raised as errors, and the VM will not\ \ be restored until the issues are resolved." default: true vmConfigOverrideSpec: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmConfigOverrideSpecification' additionalProperties: false description: Input parameters for the VM recovery point restore operation. vmm.v4.2.ahv.config.RestoreVmRecoveryPointApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vm-recovery-points/{extId}/$actions/restore\ \ Post operation" vmm.v4.2.ahv.config.VmConfigOverrideSpecification: type: object properties: name: maxLength: 80 type: string description: "Name of the VM to override with. If not specified, a name\ \ is chosen by the system and returned to the task entities when complete." example: Restored VM - X description: type: string description: VM description. example: VM restored from VM Recovery Point - Y nicSpec: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreNicConfigSpecification' categories: maxItems: 256 minItems: 0 type: array description: "Categories to be associated with the VM on successful restore.\ \ If not specified, the VM is provisioned without any categories." items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CategoryReference' ownershipInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.OwnershipInfo' guestToolsSpec: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreGuestToolsSpecification' additionalProperties: false description: "To override the VM configuration captured in the snapshot (VM\ \ Recovery Point). Whatever values are specified in this object, will override\ \ the corresponding VM config entry from the snapshot. For example, if a new\ \ list of NICs are specified, the existing NIC details are replaced with the\ \ provided list. If the list of NICs is set to an empty list explicitly, the\ \ VM will be created with no NICs. For the case where the NICs are not set\ \ in the override spec at all, the NICs from the captured VM config will be\ \ attempted during restore." vmm.v4.2.ahv.config.VmRestoreNicConfigSpecification: type: object properties: nicRemoveList: maxItems: 64 minItems: 0 uniqueItems: true type: array description: List of NIC UUIDs from the VM Recovery Point to be dropped when restoring the VM. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: faaeea7b-43d6-4a2f-9e4e-b893febc68fa nicOverrideList: maxItems: 64 minItems: 0 type: array description: List of NIC parameters to override the corresponding NICs captured in the VM Recovery Point. NIC external identifiers are utilized to map the NICs in this list to the NICs from the VM Recovery Point items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreNicConfigOverrideParams' additionalProperties: false description: "NIC configuration input for the restored VM. If not specified,\ \ the NICs in the VM Recovery Point will be restored." vmm.v4.2.ahv.config.VmRestoreGuestToolsSpecification: type: object properties: shouldClearInGuestVolumeGroupAttachments: type: boolean description: "If set to true, the VM will be restored with clearing all\ \ of the in-guest volume group attachments captured in the VM recovery\ \ point. Currently, this is only applicable to VMs with NGT installed." default: false additionalProperties: false description: "Guest tools parameters to override with. Currently, this is only\ \ applicable to VMs with NGT installed." vmm.v4.2.ahv.config.VmRestoreNicConfigOverrideParams: required: - nicExtId type: object properties: nicExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the NIC being overridden from the VM Recovery Point. This is not preserved but is only relevant for mapping the NIC being overridden. example: 33937780-49ed-4a42-a14e-ea6a5a68c78b nicBackingInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmRestoreVirtualEthernetNicOverrideSpec description: Information about how NIC is associated with a VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreVirtualEthernetNicOverrideSpec' nicNetworkInfo: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec description: Networking information object for a NIC. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec' guestNicInfo: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreGuestNicInfoOverrideSpec' additionalProperties: false description: NIC configuration parameters that can be overridden when restoring the VM. vmm.v4.2.ahv.config.VmRestoreVirtualEthernetNicOverrideSpec: type: object properties: macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: MAC address of the NIC. example: f5:02:97:31:df:28 additionalProperties: false description: "Defines a Virtual Ethernet NIC, contains fields that can be overridden\ \ when restoring the VM." vmm.v4.2.ahv.config.VmRestoreVirtualEthernetNicNetworkInfoOverrideSpec: type: object properties: subnet: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SubnetReference' ipv4Config: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmRestoreIpv4ConfigOverrideSpec' additionalProperties: false description: "Network information object for a Virtual Ethernet NIC, contains\ \ fields that can be overridden when restoring the VM." vmm.v4.2.ahv.config.VmRestoreGuestNicInfoOverrideSpec: type: object properties: guestStaticIpList: maxItems: 100 minItems: 0 type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestStaticIpSpec' additionalProperties: false description: Guest NIC information object containing fields that can be overridden for a given VM NIC when restoring a VM. vmm.v4.2.ahv.config.VmRestoreIpv4ConfigOverrideSpec: type: object properties: ipAddress: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' secondaryIpAddressList: maxItems: 100 minItems: 0 type: array description: Secondary IP addresses for the NIC. items: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' additionalProperties: false description: The IPv4 address configurations containing fields that can be overridden when restoring the VM. vmm.v4.2.ahv.config.GuestStaticIpSpec: type: object properties: ipv4Address: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' gatewayIpv4AddressList: maxItems: 100 minItems: 0 type: array description: List of gateway IPv4 addresses to override for the guest NIC's particular static IP. This will completely replace the existing gateway IPv4 address list for the NIC. items: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' additionalProperties: false description: List of static IP addresses to override for the guest NIC. vmm.v4.2.ahv.config.GetSerialPortApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.config.SerialPort oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Get operation" vmm.v4.2.ahv.config.UpdateSerialPortApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Put operation" vmm.v4.2.ahv.config.DeleteSerialPortApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports/{extId}\ \ Delete operation" vmm.v4.2.ahv.config.ListSerialPortsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.SerialPort' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Get operation" vmm.v4.2.ahv.config.CreateSerialPortApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/config/vms/{vmExtId}/serial-ports\ \ Post operation" vmm.v4.2.ahv.policies.GetVmAntiAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.VmAntiAffinityPolicy oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Get operation" vmm.v4.2.ahv.policies.VmAntiAffinityPolicy: description: VM-VM anti-affinity policy configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 80 minLength: 1 type: string description: VM-VM anti-affinity policy name. example: Test Anti Affinity policy description: type: string description: VM-VM anti-affinity policy description. example: Description for your anti affinity policy createTime: type: string description: VM-VM anti-affinity policy creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: VM-VM anti-affinity policy last updated time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.UserReference' updatedBy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.UserReference' categories: maxItems: 20 minItems: 1 uniqueItems: true type: array description: Categories configured for the VM-VM anti-affinity policy. items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' numCompliantVms: type: integer description: Number of compliant VMs which are part of the VM-VM anti-affinity policy. format: int64 readOnly: true example: 79 numNonCompliantVms: type: integer description: Number of non-compliant VMs which are part of the VM-VM anti-affinity policy. format: int64 readOnly: true example: 60 numPendingVms: type: integer description: "Number of VMs with compliance state as pending, which are\ \ part of the VM-VM anti-affinity policy." format: int64 readOnly: true example: 8 additionalProperties: false vmm.v4.2.ahv.policies.UpdateVmAntiAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Put operation" vmm.v4.2.ahv.policies.DeleteVmAntiAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{extId}\ \ Delete operation" vmm.v4.2.ahv.policies.UserReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the user. example: 3678baad-932e-450f-a03f-e270aa306f40 additionalProperties: false description: Reference to a user. vmm.v4.2.ahv.policies.CategoryReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the category. example: 1a946aa3-703e-4797-91f5-d8c36f8d2612 additionalProperties: false description: Reference to a category. vmm.v4.2.ahv.policies.ListVmAntiAffinityPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Get operation vmm.v4.2.ahv.policies.CreateVmAntiAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies Post operation vmm.v4.2.ahv.policies.ListVmAntiAffinityPolicyVmComplianceStatesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmAntiAffinityPolicyVmComplianceState' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-anti-affinity-policies/{vmAntiAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" vmm.v4.2.ahv.policies.VmAntiAffinityPolicyVmComplianceState: description: Compliance information of a VM which is part of the VM-VM anti-affinity policy. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: cluster: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ClusterReference' host: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.HostReference' associatedCategories: maxItems: 20 minItems: 1 type: array description: List of categories through which the VM is associated to the VM-VM anti-affinity policy. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' complianceStatus: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.CompliantVmAntiAffinityPolicy description: The compliance status of the VM. readOnly: true oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CompliantVmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.NonCompliantVmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.PendingVmAntiAffinityPolicy' additionalProperties: false vmm.v4.2.ahv.policies.ClusterReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the cluster. example: 6693e85b-d03d-46b5-bd48-79e7606c1320 additionalProperties: false description: Reference to a cluster. vmm.v4.2.ahv.policies.HostReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the host. example: d51ebdf2-696b-4213-a78d-3c115cb25d6f additionalProperties: false description: Reference to a host. vmm.v4.2.ahv.policies.CompliantVmAntiAffinityPolicy: type: object properties: {} additionalProperties: false description: The compliance status of the VM is compliant. vmm.v4.2.ahv.policies.NonCompliantVmAntiAffinityPolicy: type: object properties: nonComplianceReason: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.ClusterNotSupportedForVmAntiAffinity description: The reason for non-compliance of the VM-VM anti-affinity policy for the VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ClusterNotSupportedForVmAntiAffinity' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ConflictingVmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ConflictingLegacyVmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.NotEnoughHostsForVmAntiAffinity' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.NotEnoughResourcesForVmAntiAffinity' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.OtherVmAntiAffinityPolicyNonComplianceReason' additionalProperties: false description: The compliance status of the VM is non-compliant. vmm.v4.2.ahv.policies.PendingVmAntiAffinityPolicy: type: object properties: {} additionalProperties: false description: The compliance status of the VM is PendingVmAntiAffinityPolicy. Policy enforcement is still in progress. vmm.v4.2.ahv.policies.ClusterNotSupportedForVmAntiAffinity: type: object properties: {} additionalProperties: false description: The VM-VM anti-affinity policy is not compliant for the VM as the cluster hosting the VM is not running on a supported AOS version. vmm.v4.2.ahv.policies.ConflictingVmAntiAffinityPolicy: type: object properties: conflictingVmAntiAffinityPolicyExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID of the conflicting VM-VM anti-affinity policy which is applied on the VM. example: 2b6edda8-a682-4e72-8ad6-7026fcf7da73 additionalProperties: false description: The current VM-VM anti-affinity policy is not applied on the VM as another conflicting policy has already been applied to the VM. vmm.v4.2.ahv.policies.ConflictingLegacyVmAntiAffinityPolicy: type: object properties: legacyVmAntiAffinityPolicyExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID of the legacy VM Group which the VM is the part of. example: a5c282d1-e74c-42e7-9de6-d198b21948f1 additionalProperties: false description: The current VM-VM anti-affinity policy is not applied on the VM as the VM is already part of a legacy VM Group. vmm.v4.2.ahv.policies.NotEnoughHostsForVmAntiAffinity: type: object properties: {} additionalProperties: false description: The VM-VM anti-affinity policy cannot be made compliant for the VM as the number of VMs in the policy are more than the number of hosts on the cluster which is hosting the current VM. vmm.v4.2.ahv.policies.NotEnoughResourcesForVmAntiAffinity: type: object properties: {} additionalProperties: false description: "The VM-VM anti-affinity policy cannot be made compliant for the\ \ VM as there are not enough resources on the cluster to enforce the policy.\ \ This may be related to pinned VMs, VM-Host affinity policies, etc." vmm.v4.2.ahv.policies.OtherVmAntiAffinityPolicyNonComplianceReason: type: object properties: {} additionalProperties: false description: The VM-VM anti-affinity policy cannot be made compliant for the VM due to some other issue. vmm.v4.2.ahv.policies.ListLegacyVmAntiAffinityPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.LegacyVmAntiAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies Get operation vmm.v4.2.ahv.policies.LegacyVmAntiAffinityPolicy: description: Legacy VM-VM Anti-Affinity policy configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 512 minLength: 0 type: string description: VM Anti-Affinity policy name corresponding to a legacy VM-VM Anti-Affinity policy. readOnly: true example: Legacy VM anti affinity policy cluster: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ClusterReference' vms: maxItems: 4096 minItems: 0 type: array description: VMs that are part of the legacy VM-VM Anti-Affinity policy. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' additionalProperties: false vmm.v4.2.ahv.policies.VmReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the VM. example: e4b1785b-5897-4984-8d28-5021248f0a44 additionalProperties: false description: Reference to a VM. vmm.v4.2.ahv.policies.DeleteLegacyVmAntiAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/legacy-vm-anti-affinity-policies/{extId}\ \ Delete operation" vmm.v4.2.ahv.policies.GetVmHostAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.VmHostAffinityPolicy oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Get operation" vmm.v4.2.ahv.policies.VmHostAffinityPolicy: description: VM-Host Affinity policy configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 80 type: string description: VM-Host Affinity policy name. example: Test Host Affinity policy description: type: string description: VM-Host Affinity policy description. example: Description for your host affinity policy. createTime: type: string description: VM-Host Affinity policy creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: VM-Host Affinity policy last updated time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.UserReference' lastUpdatedBy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.UserReference' vmCategories: maxItems: 50 minItems: 1 type: array description: Categories through which VM is associated with the VM-host affinity policy. items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' hostCategories: maxItems: 50 minItems: 1 type: array description: Categories through which host is associated with the VM-host affinity policy. items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' numVms: type: integer description: Number of VMs associated with the VM-host affinity policy. format: int64 readOnly: true example: 89 numHosts: type: integer description: Number of hosts associated with the VM-host affinity policy. format: int64 readOnly: true example: 91 numCompliantVms: type: integer description: Number of VMs which are compliant with the VM-host affinity policy. format: int64 readOnly: true example: 15 numNonCompliantVms: type: integer description: Number of VMs which are not compliant with the VM-host affinity policy. format: int64 readOnly: true example: 60 additionalProperties: false vmm.v4.2.ahv.policies.UpdateVmHostAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Put operation" vmm.v4.2.ahv.policies.DeleteVmHostAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}\ \ Delete operation" vmm.v4.2.ahv.policies.ReEnforceVmHostAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{extId}/$actions/re-enforce\ \ Post operation" vmm.v4.2.ahv.policies.ListVmHostAffinityPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Get operation vmm.v4.2.ahv.policies.CreateVmHostAffinityPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies Post operation vmm.v4.2.ahv.policies.ListVmHostAffinityPolicyVmComplianceStatesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmHostAffinityPolicyVmComplianceState' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-host-affinity-policies/{vmHostAffinityPolicyExtId}/vm-compliance-states\ \ Get operation" vmm.v4.2.ahv.policies.VmHostAffinityPolicyVmComplianceState: description: Compliance information of the VM associated with the VM-host affinity policy. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: cluster: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ClusterReference' host: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.HostReference' associatedCategories: maxItems: 50 minItems: 1 type: array description: List of categories by which VM is associated to the VM-host affinity policy. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' complianceStatus: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.CompliantVmHostAffinityPolicy description: The compliance status of the VM. readOnly: true oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CompliantVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.NonCompliantVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.PendingVmHostAffinityPolicy' additionalProperties: false vmm.v4.2.ahv.policies.CompliantVmHostAffinityPolicy: type: object properties: {} additionalProperties: false description: VM is compliant with the VM-host affinity policy. vmm.v4.2.ahv.policies.NonCompliantVmHostAffinityPolicy: type: object properties: nonComplianceReason: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.ConflictingVmHostAffinityPolicy description: The reason why the VM does not comply with the VM host affinity policy. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ConflictingVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ConflictingLegacyVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.NoHostsForVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.NotEnoughResourcesForVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.PeNotCapableForVmHostAffinityPolicy' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.OtherVmHostAffinityPolicyVmNonComplianceReason' additionalProperties: false description: VM is non-compliant with the VM-host affinity policy. vmm.v4.2.ahv.policies.PendingVmHostAffinityPolicy: type: object properties: {} additionalProperties: false description: The compliance status of VM is pending. The policy enforcement is still in-progress. vmm.v4.2.ahv.policies.ConflictingVmHostAffinityPolicy: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the conflicting VM-host affinity policy which is applied on the VM. example: e11e002a-985d-4b81-8340-f4f923f8810d additionalProperties: false description: The current VM-host affinity policy is not applied to the VM because another policy with an earlier creation time is applied to the VM. vmm.v4.2.ahv.policies.ConflictingLegacyVmHostAffinityPolicy: type: object properties: {} additionalProperties: false description: The current VM-host affinity policy is not applied to the VM because the VM is already part of a legacy VM-host affinity policy. vmm.v4.2.ahv.policies.NoHostsForVmHostAffinityPolicy: type: object properties: {} additionalProperties: false description: There are no hosts linked with the VM-host affinity policy. vmm.v4.2.ahv.policies.NotEnoughResourcesForVmHostAffinityPolicy: type: object properties: {} additionalProperties: false description: The VM-host affinity policy cannot be applied on the VM as there are not enough resources on the hosts in the cluster associated with the policy. vmm.v4.2.ahv.policies.PeNotCapableForVmHostAffinityPolicy: type: object properties: minimumAosVersionRequired: type: string description: Minimum AOS version which supports category based VM-Host Affinity policies. example: "6.1" additionalProperties: false description: PE is of an older version which doesn't support category based VM-Host Affinity policies. Re-enforce Host Affinity policy after upgrading PE to supported version. vmm.v4.2.ahv.policies.OtherVmHostAffinityPolicyVmNonComplianceReason: type: object properties: {} additionalProperties: false description: VM is non-compliant with the VM-host affinity policy due to an internal error. vmm.v4.2.ahv.policies.GetVmStartupPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.VmStartupPolicy oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Get operation" vmm.v4.2.ahv.policies.VmStartupPolicy: required: - groups - name - startConditions description: VM startup policy configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 80 minLength: 1 type: string description: Name of the VM startup policy. example: Test VM Startup policy description: type: string description: Description of the VM startup policy. example: Description for your VM startup policy createTime: type: string description: VM startup policy creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: VM startup policy last updated time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.UserReference' updatedBy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.UserReference' groups: maxItems: 6 minItems: 2 type: array description: Ordered list of groups configured for the VM startup policy. Each group is represented by one or more Categories which VMs are expected to be associated with. The list should be ordered in the order in which VMs should be started in an HA event or Cluster restart event. items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.DependencyGroup' startConditions: maxItems: 5 minItems: 1 type: array description: Ordered list of start conditions for the VM startup policy. items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartCondition' numCompliantVms: type: integer description: Number of compliant VMs in the VM startup policy. format: int64 readOnly: true example: 6 numNonCompliantVms: type: integer description: Number of non-compliant VMs in the VM startup policy. format: int64 readOnly: true example: 51 numPendingVms: type: integer description: Number of pending VMs in the VM startup policy. format: int64 readOnly: true example: 1 numDependencyConflicts: type: integer description: Number of dependency conflicts of the VM startup policy. format: int64 readOnly: true example: 82 numStartConditionConflicts: type: integer description: Number of start condition conflicts of the VM startup policy. format: int64 readOnly: true example: 93 additionalProperties: false vmm.v4.2.ahv.policies.UpdateVmStartupPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Put operation" vmm.v4.2.ahv.policies.DeleteVmStartupPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{extId}\ \ Delete operation" vmm.v4.2.ahv.policies.DependencyGroup: type: object properties: categories: maxItems: 5 minItems: 1 uniqueItems: true type: array description: Categories configured for the group. items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' additionalProperties: false description: A group of categories that map to a set of VMs that form a group in the dependency chain. vmm.v4.2.ahv.policies.StartCondition: type: object properties: powerStateCriteria: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.PowerStateCriteriaPowerOn description: The power state criteria that the VM must attain before the dependent VMs are started. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.PowerStateCriteriaPowerOn' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.PowerStateCriteriaGuestBootup' delayDurationSecs: maximum: 600 minimum: 0 type: integer description: The delay in seconds after the power state criteria is met before the dependent VMs are started. format: uint64 default: 0 additionalProperties: false description: The condition that needs to be satisfied for the VMs in the group before the dependent VMs are started. vmm.v4.2.ahv.policies.PowerStateCriteriaPowerOn: type: object properties: {} additionalProperties: false description: The VM must be powered on before the dependent VMs are started. vmm.v4.2.ahv.policies.PowerStateCriteriaGuestBootup: type: object properties: timeoutDurationSecs: maximum: 600 minimum: 0 type: integer description: The timeout in seconds in which the VM's Guest OS boot up should be detected successfully. format: uint64 default: 300 additionalProperties: false description: The VM's Guest OS must be booted up before the dependent VMs are started. Guest bootup is detected using Nutanix Guest Tools (NGT). vmm.v4.2.ahv.policies.ListVmStartupPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Get operation vmm.v4.2.ahv.policies.CreateVmStartupPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies Post operation vmm.v4.2.ahv.policies.ListVmStartupPolicyVmComplianceStatesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyVmComplianceState' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/vm-compliance-states\ \ Get operation" vmm.v4.2.ahv.policies.VmStartupPolicyVmComplianceState: description: The VM compliance states of a policy. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: cluster: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.ClusterReference' associatedCategories: maxItems: 1000 minItems: 1 type: array description: The categories through which the VM is associated with the policy. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' complianceStatus: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.VmStartupPolicyCompliantVm description: The compliance status of the VM. readOnly: true oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyCompliantVm' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyPendingVm' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyNonCompliantVm' additionalProperties: false vmm.v4.2.ahv.policies.VmStartupPolicyCompliantVm: type: object properties: {} additionalProperties: false description: The compliance status of the VM is compliant. vmm.v4.2.ahv.policies.VmStartupPolicyPendingVm: type: object properties: {} additionalProperties: false description: The policy application on the VM is pending. vmm.v4.2.ahv.policies.VmStartupPolicyNonCompliantVm: type: object properties: nonComplianceReason: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.VmStartupPolicyClusterNotSupported description: The reason for non-compliance of the VM-VM anti-affinity policy for the VM. oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyClusterNotSupported' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyNgtNotEnabled' - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyHaNotSupported' additionalProperties: false description: The compliance status of the VM is non-compliant. vmm.v4.2.ahv.policies.VmStartupPolicyClusterNotSupported: type: object properties: {} additionalProperties: false description: The VM is running on a cluster that does not support VM startup policy. Please upgrade AOS to a supported version. vmm.v4.2.ahv.policies.VmStartupPolicyNgtNotEnabled: type: object properties: {} additionalProperties: false description: The VM has power state criteria configured as Guest Bootup but does not have Nutanix Guest Tools (NGT) enabled due to which the guest boot up cannot be detected. The power state criteria would fall back to Power On only. vmm.v4.2.ahv.policies.VmStartupPolicyHaNotSupported: type: object properties: haNotSupportedReasons: maxItems: 10 minItems: 1 type: array description: The reasons due to which the VM does not have guaranteed HA supported. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyHaNotSupportedReason' additionalProperties: false description: The VM does not have guaranteed HA supported. vmm.v4.2.ahv.policies.VmStartupPolicyHaNotSupportedReason: type: string description: The reason due to which the VM does not have guaranteed HA supported. enum: - HA_NOT_SUPPORTED_REASON_PASSTHROUGH_GPU - HA_NOT_SUPPORTED_REASON_PASSTHROUGH_SINGLE_AFFINED_HOST - HA_NOT_SUPPORTED_REASON_AGENT_VM - $UNKNOWN - $REDACTED x-enumDescriptions: HA_NOT_SUPPORTED_REASON_PASSTHROUGH_GPU: The VM has passthrough GPU(s) assigned. HA_NOT_SUPPORTED_REASON_PASSTHROUGH_SINGLE_AFFINED_HOST: The VM has only one affined host as per VM-Host affinity policies. HA_NOT_SUPPORTED_REASON_AGENT_VM: The VM is an agent VM. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.ahv.policies.ListVmStartupPolicyStartConditionConflictsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartConditionConflict' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts\ \ Get operation" vmm.v4.2.ahv.policies.StartConditionConflict: description: The start condition conflict for a dependency has conflict with other start condition. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: dependentCategory: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependeeCategory: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependentVmsAssociatedCategories: maxItems: 1000 minItems: 1 type: array description: The categories through which the dependent VMs are associated with the policies. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependeeVmsAssociatedCategories: maxItems: 1000 minItems: 1 type: array description: The categories through which the dependee VMs are associated with the policies. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' startCondition: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartCondition' conflictingPolicy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyReference' conflictingStartCondition: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartCondition' additionalProperties: false vmm.v4.2.ahv.policies.VmStartupPolicyReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external ID (UUID) of the host. example: 0a617454-087d-4989-9613-cbd770a4b673 additionalProperties: false description: The reference of the VM startup policy. vmm.v4.2.ahv.policies.GetVmStartupPolicyStartConditionConflictApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.StartConditionConflict oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.StartConditionConflict' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{extId}\ \ Get operation" vmm.v4.2.ahv.policies.ListVmStartupPolicyStartConditionConflictDependentVmsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependent-vms\ \ Get operation" vmm.v4.2.ahv.policies.ListVmStartupPolicyStartConditionConflictDependeeVmsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/start-condition-conflicts/{startConditionConflictExtId}/dependee-vms\ \ Get operation" vmm.v4.2.ahv.policies.ListVmStartupPolicyDependencyConflictsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.DependencyConflict' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts\ \ Get operation" vmm.v4.2.ahv.policies.DependencyConflict: description: The dependency is not satisfied as it might lead to a circular dependency between VMs. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: dependentCategory: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependeeCategory: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependentVmsAssociatedCategories: maxItems: 1000 minItems: 1 type: array description: The categories through which the dependent VMs are associated with the policies. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependeeVmsAssociatedCategories: maxItems: 1000 minItems: 1 type: array description: The categories through which the dependee VMs are associated with the policies. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' categoryDependencyChain: maxItems: 600 minItems: 0 type: array description: The category dependencies chain that leads to the circular dependency. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryDependency' additionalProperties: false vmm.v4.2.ahv.policies.CategoryDependency: type: object properties: dependentCategory: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' dependeeCategory: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.CategoryReference' policy: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmStartupPolicyReference' additionalProperties: false description: The dependency between two categories. vmm.v4.2.ahv.policies.GetVmStartupPolicyDependencyConflictApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.policies.DependencyConflict oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.policies.DependencyConflict' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{extId}\ \ Get operation" vmm.v4.2.ahv.policies.ListVmStartupPolicyDependencyConflictDependentVmsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependent-vms\ \ Get operation" vmm.v4.2.ahv.policies.ListVmStartupPolicyDependencyConflictDependeeVmsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.policies.VmReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/policies/vm-startup-policies/{vmStartupPolicyExtId}/dependency-conflicts/{dependencyConflictExtId}/dependee-vms\ \ Get operation" vmm.v4.2.ahv.stats.ListVmStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms Get operation vmm.v4.2.ahv.stats.VmStats: description: A collection of VM stats. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: stats: type: array description: The timestamp of a specific VM stats response data point. items: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmStatsTuple' additionalProperties: false vmm.v4.2.ahv.stats.VmStatsTuple: type: object properties: timestamp: type: string description: The timestamp of a specific VM stats response data point. format: date-time example: 2009-09-23T14:30:00-07:00 controllerAvgIoLatencyMicros: type: integer description: The VM controller average I/O latency in microseconds. format: int64 example: 80 controllerAvgReadIoLatencyMicros: type: integer description: The VM controller average read I/O latency in microseconds. format: int64 example: 79 controllerAvgReadIoSizeKb: type: integer description: The VM controller average read I/O size in kilobytes. format: int64 example: 80 controllerAvgWriteIoLatencyMicros: type: integer description: The VM controller average write I/O latency in microseconds. format: int64 example: 43 controllerAvgWriteIoSizeKb: type: integer description: The VM controller average write I/O size in kilobytes. format: int64 example: 45 controllerIoBandwidthKbps: type: integer description: The VM controller I/O bandwidth in kilobytes per second. format: int64 example: 44 controllerNumIo: type: integer description: The VM controller number of I/O requests. format: int64 example: 66 controllerNumIops: type: integer description: The VM controller number of I/O operations per second. format: int64 example: 48 controllerNumRandomIo: type: integer description: The VM controller number of random I/O. format: int64 example: 3 controllerNumReadIo: type: integer description: The VM controller number of read I/O. format: int64 example: 52 controllerNumReadIops: type: integer description: The VM controller number of read I/O operations per second. format: int64 example: 93 controllerNumSeqIo: type: integer description: The VM controller number of sequential I/Os. format: int64 example: 68 controllerNumWriteIo: type: integer description: The VM controller number of write I/O. format: int64 example: 38 controllerNumWriteIops: type: integer description: The VM controller number of write I/O operations per second. format: int64 example: 71 controllerOplogDrainDestHddBytes: type: integer description: Amount of data in bytes drained to HDD tier of extent store by the VM controller. format: int64 example: 96 controllerOplogDrainDestSsdBytes: type: integer description: Amount of data in bytes drained to SSD tier of extent store by the VM controller. format: int64 example: 25 controllerRandomIoPpm: type: integer description: The VM controller number of random I/O PPM. format: int64 example: 55 controllerReadIoBandwidthKbps: type: integer description: The VM controller number of read I/O bandwidth in kilobytes per second. format: int64 example: 71 controllerReadIoPpm: type: integer description: The VM controller number of read I/O PPM. format: int64 example: 97 controllerReadSourceEstoreHddLocalBytes: type: integer description: "The VM disk controller number of bytes for local read source:\ \ HDD estore." format: int64 example: 71 controllerReadSourceEstoreSsdLocalBytes: type: integer description: "The VM disk controller number of bytes for local read source:\ \ SSD estore." format: int64 example: 62 controllerReadSourceEstoreHddRemoteBytes: type: integer description: "The VM disk controller number of bytes for remote read source:\ \ HDD estore." format: int64 example: 3 controllerReadSourceEstoreSsdRemoteBytes: type: integer description: "The VM disk controller number of bytes for remote read source:\ \ SSD estore." format: int64 example: 75 controllerReadSourceOplogBytes: type: integer description: The VM controller read source oplog in bytes. format: int64 example: 92 controllerSeqIoPpm: type: integer description: The VM controller number of sequential I/O PPM. format: int64 example: 67 controllerSharedUsageBytes: type: integer description: The VM controller shared usage in bytes. format: int64 example: 75 controllerSnapshotUsageBytes: type: integer description: The VM controller snapshot usage in bytes. format: int64 example: 54 controllerStorageTierSsdUsageBytes: type: integer description: The VM controller total usage on SSD tier for the VM. format: int64 example: 29 controllerTimespanMicros: type: integer description: The VM controller timespan in microseconds. format: int64 example: 36 controllerTotalIoSizeKb: type: integer description: The VM controller number of total I/O size in kilobytes. format: int64 example: 61 controllerTotalIoTimeMicros: type: integer description: The VM controller number of total I/O time in microseconds. format: int64 example: 82 controllerTotalReadIoSizeKb: type: integer description: The VM controller number of total read I/O size in kilobytes. format: int64 example: 80 controllerTotalReadIoTimeMicros: type: integer description: The VM controller number of total read I/O time in microseconds. format: int64 example: 22 controllerTotalTransformedUsageBytes: type: integer description: The VM controller number of total transformed usage in bytes. format: int64 example: 50 controllerUserBytes: type: integer description: The VM controller user bytes. format: int64 example: 98 controllerWriteDestEstoreSsdBytes: type: integer description: The VM controller write destination SSD estore in bytes. format: int64 example: 22 controllerWriteDestEstoreHddBytes: type: integer description: The VM controller write destination HDD estore in bytes. format: int64 example: 35 controllerWriteIoBandwidthKbps: type: integer description: The VM controller write I/O bandwidth in kilobytes per second. format: int64 example: 64 controllerWriteIoPpm: type: integer description: The VM controller percentage of write I/O in parts per million. format: int64 example: 29 controllerWss120SecondUnionMb: type: integer description: "The combined working set size of the VM disk controller in\ \ megabytes, 2 minute measurement interval." format: int64 example: 80 controllerWss120SecondReadMb: type: integer description: "The read working set size of the VM disk controller in megabytes,\ \ 2 minute measurement interval." format: int64 example: 50 controllerWss120SecondWriteMb: type: integer description: "The write working set size of the VM disk controller in megabytes,\ \ 2 minute measurement interval." format: int64 example: 70 controllerWss3600SecondUnionMb: type: integer description: "The combined working set size of the VM disk controller in\ \ megabytes, 1-hour measurement interval." format: int64 example: 60 controllerWss3600SecondReadMb: type: integer description: "The read working set size of the VM disk controller in megabytes,\ \ 1 hour measurement interval." format: int64 example: 1 controllerWss3600SecondWriteMb: type: integer description: "The write working set size of the VM disk controller in megabytes,\ \ 1-hour measurement interval." format: int64 example: 81 frameBufferUsagePpm: type: integer description: The VM frame buffer usage in PPM. format: int64 example: 24 gpuUsagePpm: type: integer description: The VM GPU usage in PPM. format: int64 example: 22 guestMemoryUsagePpm: type: integer description: The VM memory usage in percentage reported by a guest. format: int64 example: 30 hypervisorAvgIoLatencyMicros: type: integer description: The average I/O latency of the VM in microseconds format: int64 example: 97 hypervisorCpuReadyTimePpm: type: integer description: "Percentage of time that the VM was ready, but could not get\ \ scheduled to run." format: int64 example: 95 hypervisorCpuUsagePpm: type: integer description: The CPU usage of the VM in parts per million. format: int64 example: 82 hypervisorIoBandwidthKbps: type: integer description: The I/O bandwidth of the VM in kilobytes per second. format: int64 example: 54 hypervisorMemoryBalloonReclaimedBytes: type: integer description: The memory balloon reclaimed by the VM in bytes. format: int64 example: 78 hypervisorMemoryBalloonReclaimTargetBytes: type: integer description: The target memory balloon of the VM to be reclaimed in bytes. format: int64 example: 27 hypervisorMemoryUsagePpm: type: integer description: Consolidated guest memory usage in percentage. format: int64 example: 97 hypervisorNumIo: type: integer description: The number of I/O by the VM. format: int64 example: 1 hypervisorNumIops: type: integer description: The number of I/O operations by the VM per second. format: int64 example: 1 hypervisorNumReadIops: type: integer description: The number of read I/O operations by the VM per second. format: int64 example: 29 hypervisorNumReadIo: type: integer description: The number of read I/O operations by the VM. format: int64 example: 92 hypervisorNumReceivedBytes: type: integer description: The number of bytes received by the VM. format: int64 example: 97 hypervisorNumReceivePacketsDropped: type: integer description: The number of packets dropped by the VM during reception. format: int64 example: 16 hypervisorNumTransmittedBytes: type: integer description: The number of bytes transmitted by the VM. format: int64 example: 90 hypervisorNumTransmitPacketsDropped: type: integer description: The number of packets dropped by the VM during transmission. format: int64 example: 20 hypervisorNumWriteIo: type: integer description: The number of write I/O by the VM. format: int64 example: 66 hypervisorNumWriteIops: type: integer description: The number of write I/O operations by the VM per second. format: int64 example: 30 hypervisorReadIoBandwidthKbps: type: integer description: The number of read I/O bandwidth of the VM in kilobytes per second. format: int64 example: 44 hypervisorTimespanMicros: type: integer description: The timespan of the VM in microseconds. format: int64 example: 67 hypervisorTotalIoSizeKb: type: integer description: The total I/O size of the VM in kilobytes. format: int64 example: 98 hypervisorTotalIoTimeMicros: type: integer description: The total I/O time of the VM in microseconds. format: int64 example: 38 hypervisorTotalReadIoSizeKb: type: integer description: The total read I/O size of the VM in kilobytes. format: int64 example: 44 hypervisorVmRunningTimeUsecs: type: integer description: The running time of the VM in microseconds. format: int64 example: 85 hypervisorWriteIoBandwidthKbps: type: integer description: The write I/O bandwidth of the VM in kilobytes per second. format: int64 example: 17 memoryUsageBytes: type: integer description: The VM memory usage bytes. format: int64 example: 62 memoryUsagePpm: type: integer description: The VM memory usage in PPM. format: int64 example: 27 numVcpusUsedPpm: type: integer description: The VM number of vCPUs used in PPM. format: int64 example: 1 checkScore: type: integer description: The VM NCC health check score. format: int64 example: 90 cluster: type: string description: The UUID of the cluster on which the VM resides. example: string hypervisorType: type: string description: Hypervisor type of the VM. example: string diskUsagePpm: type: integer description: The VM disk usage in PPM. format: int64 example: 30 diskCapacityBytes: type: integer description: The VM disk capacity in bytes. format: int64 example: 86 hypervisorSwapInRateKbps: type: integer description: The swap in rate of the VM in kilobytes per second. format: int64 example: 45 hypervisorSwapOutRateKbps: type: integer description: The swap out rate of the VM in kilobytes per second. format: int64 example: 70 memoryReservedBytes: type: integer description: The reserved memory of the VM in bytes. format: int64 example: 0 physicalMemoryAllocatedBytes: type: integer description: Physical memory allocated to VM in bytes. format: int64 example: 12 additionalProperties: false description: A collection of VM stats. common.v1.0.stats.DownSamplingOperator: type: string description: | The operator to use while performing down-sampling on stats data. Allowed values are SUM, MIN, MAX, AVG, COUNT and LAST. enum: - SUM - MIN - MAX - AVG - COUNT - LAST - $UNKNOWN - $REDACTED x-enumDescriptions: AVG: | Aggregation indicating mean or average of all values. MIN: | Aggregation containing lowest of all values. MAX: | Aggregation containing highest of all values. LAST: | Aggregation containing only the last recorded value. SUM: | Aggregation with sum of all values. COUNT: | Aggregation containing total count of values. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. common.v1.0.response.ApiResponseMetadata: type: object properties: flags: maxItems: 20 minItems: 0 type: array description: | An array of flags that may indicate the status of the response. For example, a flag with the name 'isPaginated' and value 'false', indicates that the response is not paginated. items: $ref: '#/components/schemas/common.v1.0.config.Flag' links: maxItems: 20 minItems: 0 type: array description: | An array of HATEOAS style links for the response that may also include pagination links for list operations. items: $ref: '#/components/schemas/common.v1.0.response.ApiLink' totalAvailableResults: type: integer description: | The total number of entities that are available on the server for this type. format: int32 example: 34 messages: maxItems: 20 minItems: 0 type: array description: | Information, Warning or Error messages that might provide additional contextual information related to the operation. items: $ref: '#/components/schemas/common.v1.0.config.Message' extraInfo: maxItems: 20 minItems: 0 type: array description: | An array of entity-specific metadata items: $ref: '#/components/schemas/common.v1.0.config.KVPair' additionalProperties: false description: | The metadata associated with an API response. This value is always present and minimally contains the self-link for the API request that produced this response. It also contains pagination data for the paginated requests. common.v1.0.response.ExternalizableAbstractModel: description: | A model that represents an object instance that is accessible through an API endpoint. Instances of this type get an extId field that contains the globally unique identifier for that instance. Externally accessible instances are always tenant aware and, therefore, extend the TenantAwareModel allOf: - $ref: '#/components/schemas/common.v1.0.config.TenantAwareModel' - type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: | A globally unique identifier of an instance that is suitable for external consumption. nullable: true readOnly: true example: 5a3026f9-350d-4fed-89b3-d837495215f5 links: maxItems: 20 minItems: 0 type: array description: | A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource. readOnly: true items: $ref: '#/components/schemas/common.v1.0.response.ApiLink' additionalProperties: false common.v1.0.config.Flag: type: object properties: name: maxLength: 128 minLength: 3 type: string description: | Name of the flag. example: string value: type: boolean description: | Value of the flag. default: false additionalProperties: false description: | Many entities in the Nutanix APIs carry flags. This object captures all the flags associated with that entity through this object. The field that hosts this type of object must have an attribute called x-bounded-map-keys that tells which flags are actually present for that entity. common.v1.0.response.ApiLink: type: object properties: href: type: string description: | The URL at which the entity described by the link can be accessed. example: string rel: type: string description: | A name that identifies the relationship of the link to the object that is returned by the URL. The unique value of "self" identifies the URL for the object. example: string additionalProperties: false description: | A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource. common.v1.0.config.Message: type: object properties: code: type: string description: | A code that uniquely identifies a message. example: string message: type: string description: | The description of the message. example: string locale: type: string description: | The locale for the message description. default: en_US severity: $ref: '#/components/schemas/common.v1.0.config.MessageSeverity' additionalProperties: false common.v1.0.config.KVPair: type: object properties: name: maxLength: 128 minLength: 3 type: string description: | The key of the key-value pair. example: string value: description: The value associated with the key for this key-value pair oneOf: - type: string description: | A string value in a key-value pair. example: string - type: integer description: | An integer value in a key-value pair. example: 68 - type: boolean description: | An boolean value in a key-value pair. example: false - maxItems: 100 minItems: 0 type: array description: | A value in a key-value pair that represents a list of strings. items: type: string example: string - type: object additionalProperties: type: string description: | A value in a key-value pair that represents a map of string keys and values. - maxItems: 20 minItems: 0 type: array description: | A value in a key-value pair that represents an array of maps of string keys and values. items: $ref: '#/components/schemas/common.v1.0.config.MapOfStringWrapper' - maxItems: 100 minItems: 0 type: array description: | A value in a key-value pair that represents a list of integers. items: type: integer example: 45 additionalProperties: false description: | A map describing a set of keys and their corresponding values. common.v1.0.config.MessageSeverity: type: string description: | The message severity. enum: - INFO - WARNING - ERROR - $UNKNOWN - $REDACTED x-enumDescriptions: ERROR: | Error indicating failed completion. INFO: | Information about successful completion. $UNKNOWN: | Unknown value. WARNING: | Warning indicating future error. $REDACTED: | Redacted value. common.v1.0.config.MapOfStringWrapper: type: object properties: map: type: object additionalProperties: type: string description: | A map with string keys and values. additionalProperties: false description: | A wrapper schema containing a map with string keys and values. common.v1.0.config.TenantAwareModel: type: object properties: tenantId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: | A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this ID to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server). readOnly: true example: 49ccdd85-0f14-4f29-bb46-836da48a4afe additionalProperties: false description: | A model base class whose instances are bound to a specific tenant. This model adds a tenantId to the base model class that it extends and is automatically set by the server. vmm.v4.2.ahv.stats.GetVmStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.stats.VmStats oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{extId}\ \ Get operation" vmm.v4.2.ahv.stats.GetDiskStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.stats.VmDiskStats oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmDiskStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" vmm.v4.2.ahv.stats.VmDiskStats: description: A collection of VM disk stats. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: vmExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The VM external ID associated with the VM Disk stats. example: 523d5543-816c-449d-912a-457390b512fd stats: type: array description: The timestamp of a specific VM stats response data point. items: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmDiskStatsTuple' additionalProperties: false vmm.v4.2.ahv.stats.VmDiskStatsTuple: type: object properties: timestamp: type: string description: The timestamp of a specific VM stats response data point. format: date-time example: 2009-09-23T14:30:00-07:00 controllerAvgIoLatencyMicros: type: integer description: The VM disk controller average I/O latency in microseconds. format: int64 example: 40 controllerAvgReadIoLatencyMicros: type: integer description: The VM disk controller average read I/O latency in microseconds. format: int64 example: 50 controllerAvgReadIoSizeKb: type: integer description: The VM disk controller average read I/O size in kilobytes. format: int64 example: 16 controllerNumReadIops: type: integer description: The VM disk controller number of read I/O operations per second. format: int64 example: 30 controllerReadIoPpm: type: integer description: The VM disk controller percentage of read I/O in parts per million. format: int64 example: 56 controllerNumWriteIo: type: integer description: The VM disk controller number of write I/O. format: int64 example: 75 controllerAvgWriteIoLatencyMicros: type: integer description: The VM disk controller average write I/O latency in microseconds. format: int64 example: 69 controllerAvgWriteIoSizeKb: type: integer description: The VM disk controller average write I/O size in kilobytes. format: int64 example: 72 controllerIoBandwidthKbps: type: integer description: The VM disk controller number of I/O bandwidth in kilobytes per second. format: int64 example: 46 controllerFrontendReadOps: type: integer description: The VM disk controller number of frontend read operations. format: int64 example: 98 controllerFrontendWriteOps: type: integer description: The VM disk controller number of frontend write operations. format: int64 example: 87 controllerNumIo: type: integer description: The VM disk controller number of I/O. format: int64 example: 99 controllerNumIops: type: integer description: The VM disk controller number of I/O operations per second. format: int64 example: 69 controllerNumReadIo: type: integer description: The VM disk controller number of read I/O. format: int64 example: 97 controllerRandomReadOps: type: integer description: The VM disk controller number of random read operations. format: int64 example: 44 controllerRandomWriteOps: type: integer description: The VM disk controller number of random write operations. format: int64 example: 90 controllerReadIoBandwidthKbps: type: integer description: The VM disk controller number of read I/O bandwidth in kilobytes per second. format: int64 example: 12 controllerSeqIoPpm: type: integer description: The VM disk controller percentage of sequential I/O in parts per million. format: int64 example: 94 controllerTimespanMicros: type: integer description: The VM disk controller timespan in microseconds. format: int64 example: 6 controllerTotalIoSizeKb: type: integer description: The VM disk controller total I/O size in kilobytes. format: int64 example: 90 controllerTotalIoTimeMicros: type: integer description: The VM disk controller total I/O time in microseconds. format: int64 example: 3 controllerTotalReadIoSizeKb: type: integer description: The VM disk controller total read I/O size in kilobytes. format: int64 example: 65 controllerTotalReadIoTimeMicros: type: integer description: The VM disk controller total read I/O time in microseconds. format: int64 example: 33 controllerUserBytes: type: integer description: The VM disk controller user bytes. format: int64 example: 22 controllerVdiskCpuTimeMicros: type: integer description: The VM disk controller vDisk CPU time in microseconds. format: int64 example: 71 controllerWriteIoBandwidthKbps: type: integer description: The VM disk controller write I/O bandwidth in kilobytes per second. format: int64 example: 64 controllerWriteIoPpm: type: integer description: The VM disk controller percentage of write I/O in parts per million. format: int64 example: 23 additionalProperties: false description: A collection of VM disk stats. vmm.v4.2.ahv.stats.GetNicStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.ahv.stats.VmNicStats oneOf: - $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmNicStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/ahv/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" vmm.v4.2.ahv.stats.VmNicStats: description: A collection of VM NIC stats. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: vmExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The VM external ID associated with the VM NIC stats. example: 9cf87154-b392-4d1a-b77f-50d63e34560a stats: type: array description: The timestamp of a specific VM stats response data point. items: $ref: '#/components/schemas/vmm.v4.2.ahv.stats.VmNicStatsTuple' additionalProperties: false vmm.v4.2.ahv.stats.VmNicStatsTuple: type: object properties: timestamp: type: string description: The timestamp of a specific VM stats response data point. format: date-time example: 2009-09-23T14:30:00-07:00 networkDroppedReceivedPackets: type: integer description: The VM NIC number of dropped received packets. format: int64 example: 64 networkDroppedTransmittedPackets: type: integer description: The VM NIC number of dropped transmitted packets. format: int64 example: 96 additionalProperties: false description: A collection of VM NIC stats. vmm.v4.2.config.ListTemplatePlacementPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.config.TemplatePlacementPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Get operation vmm.v4.2.config.TemplatePlacementPolicy: required: - clusterFilter - contentFilter - name - placementType allOf: - $ref: '#/components/schemas/catalogCommon.v1.0.config.CommonPlacementPolicy' - type: object properties: phony: type: string description: This readonly attribute is unused. readOnly: true example: string additionalProperties: false vmm.v4.2.config.CreateTemplatePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies Post operation vmm.v4.2.config.GetTemplatePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.config.TemplatePlacementPolicy oneOf: - $ref: '#/components/schemas/vmm.v4.2.config.TemplatePlacementPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Get operation" vmm.v4.2.config.UpdateTemplatePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Put operation" vmm.v4.2.config.DeleteTemplatePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/config/template-placement-policies/{extId}\ \ Delete operation" vmm.v4.2.esxi.config.AssociateVmCategoriesParams: required: - categories type: object properties: categories: maxItems: 256 minItems: 1 type: array items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CategoryReference' additionalProperties: false description: List of categories to be associated to the VM. vmm.v4.2.esxi.config.AssociateCategoriesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/associate-categories\ \ Post operation" vmm.v4.2.esxi.config.CategoryReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an instance of type UUID. example: ba51d418-8fa6-4062-848b-a251d36dd036 additionalProperties: false description: Reference to a category. vmm.v4.2.esxi.config.DisassociateVmCategoriesParams: required: - categories type: object properties: categories: maxItems: 256 minItems: 1 type: array items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CategoryReference' additionalProperties: false description: List of categories to be disassociated from the VM. vmm.v4.2.esxi.config.DisassociateCategoriesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/disassociate-categories\ \ Post operation" vmm.v4.2.esxi.config.GetVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.esxi.config.Vm oneOf: - $ref: '#/components/schemas/vmm.v4.2.esxi.config.Vm' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}\ \ Get operation" vmm.v4.2.esxi.config.Vm: description: VM configuration. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 80 type: string description: VM name. example: Test VM cluster: $ref: '#/components/schemas/vmm.v4.2.esxi.config.ClusterReference' host: $ref: '#/components/schemas/vmm.v4.2.esxi.config.HostReference' description: type: string description: VM description. example: Description for your VM categories: maxItems: 256 minItems: 0 type: array description: Categories for the VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CategoryReference' ownershipInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.OwnershipInfo' nutanixGuestTools: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestTools' powerState: $ref: '#/components/schemas/vmm.v4.2.esxi.config.PowerState' memorySizeBytes: minimum: 1 type: integer description: Memory size in bytes. format: int64 readOnly: true example: 60 numCoresPerSocket: minimum: 1 type: integer description: Number of cores per socket. format: int64 readOnly: true example: 45 numCpus: minimum: 1 type: integer description: Number of vCPUs. format: int64 readOnly: true example: 47 guestOsName: maxLength: 256 type: string description: Name of the guest OS. readOnly: true example: CentOS 7 (64-bit) virtualHardwareVersion: minimum: 1 type: integer description: Virtual hardware version of the VM. format: int64 readOnly: true example: 32 disks: maxItems: 256 minItems: 0 type: array description: Disks attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.Disk' cdRoms: maxItems: 256 minItems: 0 type: array description: CD-ROMs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CdRom' nics: maxItems: 32 minItems: 0 type: array description: NICs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.Nic' additionalProperties: false vmm.v4.2.esxi.config.HostReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of a host type UUID. example: 06e9dc8b-6b63-4290-a244-8078aa56882d additionalProperties: false description: "Reference to the host, the VM is running on." vmm.v4.2.esxi.config.OwnershipInfo: required: - owner type: object properties: owner: $ref: '#/components/schemas/vmm.v4.2.esxi.config.OwnerReference' additionalProperties: false description: Ownership information for the VM. vmm.v4.2.esxi.config.NutanixGuestTools: type: object properties: version: type: string description: Version of Nutanix Guest Tools installed on the VM. readOnly: true example: string isInstalled: type: boolean description: Indicates whether Nutanix Guest Tools is installed on the VM or not. readOnly: true example: true isEnabled: type: boolean description: Indicates whether Nutanix Guest Tools is enabled or not. example: true isIsoInserted: type: boolean description: Indicates whether Nutanix Guest Tools ISO is inserted or not. readOnly: true example: true capabilities: maxItems: 2 minItems: 0 uniqueItems: true type: array description: The list of the application names that are enabled on the guest VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestToolsCapability' availableVersion: type: string description: Version of Nutanix Guest Tools available on the cluster. readOnly: true example: string guestOsVersion: type: string description: "Version of the operating system on the VM. This object is\ \ now deprecated. If both deprecated and new objects are present, the\ \ new object GuestInfo/GuestOsFullName takes precedence." readOnly: true example: string deprecated: true isReachable: type: boolean description: Indicates whether the communication from VM to CVM is active or not. readOnly: true example: false isVssSnapshotCapable: type: boolean description: Indicates whether the VM is configured to take VSS snapshots through NGT or not. readOnly: true example: true isVmMobilityDriversInstalled: type: boolean description: "Indicates whether the VM mobility drivers are installed on\ \ the VM or not. This object is now deprecated. If both deprecated and\ \ new objects are present, the new object GuestInfoVmMobilityDriversInstalledDescription\ \ takes precedence." readOnly: true example: true deprecated: true guestInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.GuestInfo' additionalProperties: false description: The details about Nutanix Guest Tools for a VM. vmm.v4.2.esxi.config.PowerState: type: string description: The current power state of the VM. enum: - "ON" - "OFF" - SUSPENDED - UNDETERMINED - $UNKNOWN - $REDACTED x-enumDescriptions: UNDETERMINED: The VM power state is currently unknown. SUSPENDED: The VM power state is currently suspended. $UNKNOWN: | Unknown value. "OFF": The VM is powered-off. $REDACTED: | Redacted value. "ON": The VM is powered-on. vmm.v4.2.esxi.config.Disk: description: Virtual Machine disk (VM disk). allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: diskAddress: $ref: '#/components/schemas/vmm.v4.2.esxi.config.DiskAddress' backingInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.VmDisk' additionalProperties: false vmm.v4.2.esxi.config.CdRom: description: Virtual Machine CD-ROM. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: diskAddress: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CdRomAddress' backingInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CdRomBackingInfo' additionalProperties: false vmm.v4.2.esxi.config.Nic: description: Virtual Machine NIC. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: backingInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NicBackingInfo' networkInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NicNetworkInfo' additionalProperties: false vmm.v4.2.esxi.config.ClusterReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an instance of type UUID. example: f6110938-7cf2-42b0-9789-ffc7ed5b4349 additionalProperties: false description: Reference to a cluster. vmm.v4.2.esxi.config.OwnerReference: type: object properties: entityType: $ref: '#/components/schemas/vmm.v4.2.esxi.config.OwnerReferenceEntityType' extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The globally unique identifier of an instance of type UUID. example: 170a4dd8-39e1-48b2-8194-0d8476145797 additionalProperties: false description: Owner reference. vmm.v4.2.esxi.config.OwnerReferenceEntityType: type: string description: Type of the entity that the owner reference is pointing to. enum: - USER - $UNKNOWN - $REDACTED x-enumDescriptions: USER: Entity type that the owner reference is pointing to is User. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.esxi.config.NutanixGuestToolsCapability: type: string description: The capabilities of the Nutanix Guest Tools in the VM. enum: - SELF_SERVICE_RESTORE - VSS_SNAPSHOT - $UNKNOWN - $REDACTED x-enumDescriptions: VSS_SNAPSHOT: Enablement status of the Volume Snapshot Service application. $UNKNOWN: | Unknown value. SELF_SERVICE_RESTORE: Enablement status of the Self Service Restore application. $REDACTED: | Redacted value. vmm.v4.2.esxi.config.GuestInfo: type: object properties: guestOsFullName: maxLength: 128 type: string description: Guest operating system full name. readOnly: true example: string isVmMobilityDriversInstalled: type: boolean description: Indicates whether the VM mobility drivers are installed on the VM or not. readOnly: true example: true lastBootUpTime: type: string description: Timestamp indicating the last time the guest OS was booted. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 dnsName: $ref: '#/components/schemas/common.v1.0.config.FQDN' installedVirtIoVersion: maxLength: 12 type: string description: Version of the VirtIO drivers installed on the guest OS. readOnly: true example: string guestOsBuildNumber: maxLength: 32 type: string description: Indicates build number of the guest operating system. readOnly: true example: string additionalProperties: false description: Information retrieved from the guest operating system. vmm.v4.2.esxi.config.DiskAddress: type: object properties: busType: $ref: '#/components/schemas/vmm.v4.2.esxi.config.DiskBusType' index: minimum: 0 type: integer description: Device index on the bus. This field is ignored unless the bus details are specified. format: int32 readOnly: true example: 31 additionalProperties: false description: Disk address. vmm.v4.2.esxi.config.VmDisk: type: object properties: diskSizeBytes: minimum: 1 type: integer description: Size of the disk in bytes. format: int64 readOnly: true example: 93 storageContainer: $ref: '#/components/schemas/vmm.v4.2.esxi.config.VmDiskContainerReference' storageConfig: $ref: '#/components/schemas/vmm.v4.2.esxi.config.VmDiskStorageConfig' additionalProperties: false description: Storage provided by Nutanix ADSF. vmm.v4.2.esxi.config.DiskBusType: type: string description: "Bus type for the device. The acceptable values are: SCSI, IDE,\ \ PCI, SATA, SPAPR (only PPC)." enum: - SCSI - IDE - SATA - NVME - $UNKNOWN - $REDACTED x-enumDescriptions: SCSI: The type of disk bus is SCSI. NVME: The type of disk bus is NVME. IDE: The type of disk bus is IDE. $UNKNOWN: | Unknown value. SATA: The type of disk bus is SATA. $REDACTED: | Redacted value. vmm.v4.2.esxi.config.VmDiskContainerReference: type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk container. It should be of type UUID. readOnly: true example: 0aad9657-70d5-4560-b6fe-ee6d85659c5b additionalProperties: false description: This reference is for disk level storage container preference. This preference specifies the storage container to which this disk belongs. vmm.v4.2.esxi.config.VmDiskStorageConfig: type: object properties: isFlashModeEnabled: type: boolean description: Indicates whether the virtual disk is pinned to the hot tier or not. readOnly: true example: false additionalProperties: false description: Storage configuration for VM disks. vmm.v4.2.esxi.config.CdRomAddress: type: object properties: busType: $ref: '#/components/schemas/vmm.v4.2.esxi.config.CdRomBusType' index: minimum: 0 type: integer description: Device index on the bus. This field is ignored unless the bus details are specified. format: int32 readOnly: true example: 93 additionalProperties: false description: CD-ROM address. vmm.v4.2.esxi.config.CdRomBackingInfo: type: object properties: diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: A globally unique identifier of a VM disk of type UUID. readOnly: true example: bb788f0f-0eaf-4363-a9c1-78d34509d53c storageContainer: $ref: '#/components/schemas/vmm.v4.2.esxi.config.VmDiskContainerReference' additionalProperties: false description: Storage provided by Nutanix ADSF. vmm.v4.2.esxi.config.CdRomBusType: type: string description: "Bus type for the device. The acceptable values are: IDE or SATA." enum: - IDE - SATA - $UNKNOWN - $REDACTED x-enumDescriptions: IDE: The type of CD-ROM bus is IDE. $UNKNOWN: | Unknown value. SATA: The type of CD-ROM bus is SATA. $REDACTED: | Redacted value. vmm.v4.2.esxi.config.NicBackingInfo: type: object properties: macAddress: pattern: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$" type: string description: MAC address of the NIC. readOnly: true example: ed:8c:98:6a:56:89 isConnected: type: boolean description: Indicates whether the NIC is connected or not. Default is True. readOnly: true example: false adapterType: $ref: '#/components/schemas/vmm.v4.2.esxi.config.AdapterType' additionalProperties: false description: Information about how NIC is associated with a VM. vmm.v4.2.esxi.config.NicNetworkInfo: type: object properties: portGroupInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.PortGroupInfo' ipAddressInfo: $ref: '#/components/schemas/vmm.v4.2.esxi.config.IpAddressInfo' additionalProperties: false description: "Networking information object for a NIC. This object is now deprecated.\ \ If both deprecated and new objects are present, the new object VirtualEthernetNicNetworkInfo\ \ takes precedence." vmm.v4.2.esxi.config.AdapterType: type: string description: Adapter type for VM NIC. enum: - E1000 - PCNET32 - VMXNET - VMXNET2 - VMXNET3 - E1000E - SRIOV - $UNKNOWN - $REDACTED x-enumDescriptions: E1000E: The NIC adapter type is E1000e. E1000: The NIC adapter type is E1000. SRIOV: The NIC adapter type is Sriov. PCNET32: The NIC adapter type is PCNet32. VMXNET: The NIC adapter type is Vmxnet. $UNKNOWN: | Unknown value. VMXNET3: The NIC adapter type is Vmxnet3. $REDACTED: | Redacted value. VMXNET2: The NIC adapter type is Vmxnet2. vmm.v4.2.esxi.config.PortGroupInfo: type: object properties: name: maxLength: 128 type: string description: Name of the Port Group. readOnly: true example: string additionalProperties: false description: Information about the virtual network in the datacenter. vmm.v4.2.esxi.config.IpAddressInfo: type: object properties: ipv4Addresses: maxItems: 128 minItems: 0 type: array description: IP addresses for the NIC. readOnly: true items: $ref: '#/components/schemas/common.v1.0.config.IPv4Address' ipv6Addresses: maxItems: 128 minItems: 0 type: array description: IPV6 addresses for the NIC. readOnly: true items: type: string example: string additionalProperties: false description: The IP address information of NIC. vmm.v4.2.esxi.config.ListVmsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.Vm' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/config/vms Get operation vmm.v4.2.esxi.config.RevertParams: title: VM revert specification. required: - vmRecoveryPointExtId type: object properties: vmRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of the VM Recovery Point. example: dbdf2902-f131-49ca-9267-6de697b5782f additionalProperties: false description: Input for the VM revert operation. Specify the VM Recovery Point ID to which the VM would be reverted. vmm.v4.2.esxi.config.RevertVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/revert\ \ Post operation" vmm.v4.2.esxi.config.GetNutanixGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.esxi.config.NutanixGuestTools oneOf: - $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestTools' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Get operation" vmm.v4.2.esxi.config.UpdateNutanixGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools\ \ Put operation" vmm.v4.2.esxi.config.NutanixGuestToolsInstallConfig: required: - credential type: object properties: capabilities: maxItems: 2 minItems: 0 uniqueItems: true type: array description: The list of the application names that are enabled on the guest VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestToolsCapability' credential: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixCredential' rebootPreference: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixRebootPreference' additionalProperties: false description: Arguments for installing Nutanix Guest Tools. vmm.v4.2.esxi.config.InstallNutanixGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install\ \ Post operation" vmm.v4.2.esxi.config.NutanixCredential: required: - password - username type: object properties: username: maxLength: 256 type: string description: Username for the server. example: test_user password: type: string description: Password for the server. writeOnly: true example: test_password additionalProperties: false description: Sign in credentials for the server. vmm.v4.2.esxi.config.NutanixRebootPreference: type: object properties: scheduleType: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixScheduleType' schedule: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixRebootPreferenceSchedule' additionalProperties: false description: The restart schedule after installing or upgrading Nutanix Guest Tools. vmm.v4.2.esxi.config.NutanixScheduleType: type: string description: Schedule type for restart. enum: - SKIP - IMMEDIATE - LATER - $UNKNOWN - $REDACTED x-enumDescriptions: LATER: Schedule a restart for a specific time. SKIP: Do not schedule a restart. $UNKNOWN: | Unknown value. IMMEDIATE: Schedule an immediate restart. $REDACTED: | Redacted value. vmm.v4.2.esxi.config.NutanixRebootPreferenceSchedule: type: object properties: startTime: type: string description: The start time for a scheduled restart. format: date-time example: 2009-09-23T14:30:00-07:00 additionalProperties: false description: Restart schedule. vmm.v4.2.esxi.config.NutanixGuestToolsUpgradeConfig: type: object properties: rebootPreference: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixRebootPreference' additionalProperties: false description: Arguments for upgrading Nutanix Guest Tools. vmm.v4.2.esxi.config.UpgradeNutanixGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade\ \ Post operation" vmm.v4.2.esxi.config.NutanixGuestToolsInsertConfig: type: object properties: capabilities: maxItems: 2 minItems: 0 uniqueItems: true type: array description: The list of the application names that are enabled on the guest VM. items: $ref: '#/components/schemas/vmm.v4.2.esxi.config.NutanixGuestToolsCapability' additionalProperties: false description: Argument for inserting a Nutanix Guest Tools ISO into an available slot. vmm.v4.2.esxi.config.InsertNutanixGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso\ \ Post operation" vmm.v4.2.esxi.config.UninstallNutanixGuestToolsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall\ \ Post operation" vmm.v4.2.esxi.config.AssignVmOwnerApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/assign-owner\ \ Post operation" vmm.v4.2.esxi.config.PowerOnVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-on\ \ Post operation" vmm.v4.2.esxi.config.PowerOffVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/power-off\ \ Post operation" vmm.v4.2.esxi.config.ResetVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/reset\ \ Post operation" vmm.v4.2.esxi.config.SuspendVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/suspend\ \ Post operation" vmm.v4.2.esxi.config.ShutdownVmApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-shutdown\ \ Post operation" vmm.v4.2.esxi.config.RebootGuestOSApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/config/vms/{extId}/$actions/guest-reboot\ \ Post operation" vmm.v4.2.esxi.stats.ListVmStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms Get operation vmm.v4.2.esxi.stats.VmStats: description: A collection of VM stats. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: stats: type: array description: The timestamp of a specific VM stats response data point. items: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmStatsTuple' additionalProperties: false vmm.v4.2.esxi.stats.VmStatsTuple: type: object properties: checkScore: type: integer description: The VM NCC health check score. format: int64 example: 51 cluster: type: string description: The UUID of the cluster on which the VM resides. example: string controllerAvgIoLatencyMicros: type: integer description: The VM controller average I/O latency in microseconds. format: int64 example: 25 controllerAvgReadIoLatencyMicros: type: integer description: The VM controller average read I/O latency in microseconds. format: int64 example: 33 controllerAvgReadIoSizeKb: type: integer description: The VM controller average read I/O size in kilobytes. format: int64 example: 37 controllerAvgWriteIoLatencyMicros: type: integer description: The VM controller average write I/O latency in microseconds. format: int64 example: 92 controllerAvgWriteIoSizeKb: type: integer description: The VM controller average write I/O size in kilobytes. format: int64 example: 32 controllerIoBandwidthKbps: type: integer description: The VM controller I/O bandwidth in kilobytes per second. format: int64 example: 87 controllerNumIo: type: integer description: The VM controller number of I/O requests. format: int64 example: 60 controllerNumIops: type: integer description: The VM controller number of I/O operations per second. format: int64 example: 28 controllerNumRandomIo: type: integer description: The VM controller number of random I/O. format: int64 example: 33 controllerNumReadIo: type: integer description: The VM controller number of read I/O. format: int64 example: 84 controllerNumReadIops: type: integer description: The VM controller number of read I/O operations per second. format: int64 example: 93 controllerNumSeqIo: type: integer description: The VM controller number of sequential I/Os. format: int64 example: 84 controllerNumWriteIo: type: integer description: The VM controller number of write I/O. format: int64 example: 64 controllerNumWriteIops: type: integer description: The VM controller number of write I/O operations per second. format: int64 example: 14 controllerRandomIoPpm: type: integer description: The VM controller number of random I/O PPM. format: int64 example: 59 controllerReadIoBandwidthKbps: type: integer description: The VM controller number of read I/O bandwidth in kilobytes per second. format: int64 example: 76 controllerReadIoPpm: type: integer description: The VM controller number of read I/O PPM. format: int64 example: 37 controllerSeqIoPpm: type: integer description: The VM controller number of sequential I/O PPM. format: int64 example: 41 controllerStorageTierSsdUsageBytes: type: integer description: The VM controller total usage on SSD tier for the VM. format: int64 example: 26 controllerTimespanMicros: type: integer description: The VM controller timespan in microseconds. format: int64 example: 60 controllerTotalIoSizeKb: type: integer description: The VM controller number of total I/O size in kilobytes. format: int64 example: 75 controllerTotalIoTimeMicros: type: integer description: The VM controller number of total I/O time in microseconds. format: int64 example: 73 controllerTotalReadIoSizeKb: type: integer description: The VM controller number of total read I/O size in kilobytes. format: int64 example: 40 controllerTotalReadIoTimeMicros: type: integer description: The VM controller number of total read I/O time in microseconds. format: int64 example: 32 controllerTotalTransformedUsageBytes: type: integer description: The VM controller number of total transformed usage in bytes. format: int64 example: 40 controllerUserBytes: type: integer description: The VM controller user bytes. format: int64 example: 52 controllerWriteIoBandwidthKbps: type: integer description: The VM controller write I/O bandwidth in kilobytes per second. format: int64 example: 43 controllerWriteIoPpm: type: integer description: The VM controller percentage of write I/O in parts per million. format: int64 example: 33 hypervisorAvgIoLatencyMicros: type: integer description: The average I/O latency of the VM in microseconds format: int64 example: 52 hypervisorCpuReadyTimePpm: type: integer description: "Percentage of time that the VM was ready, but could not get\ \ scheduled to run." format: int64 example: 6 hypervisorCpuUsagePpm: type: integer description: The CPU usage of the VM in parts per million. format: int64 example: 35 hypervisorIoBandwidthKbps: type: integer description: The I/O bandwidth of the VM in kilobytes per second. format: int64 example: 25 hypervisorMemoryUsagePpm: type: integer description: Consolidated guest memory usage in percentage. format: int64 example: 81 hypervisorNumIo: type: integer description: The number of I/O by the VM. format: int64 example: 68 hypervisorNumIops: type: integer description: The number of I/O operations by the VM per second. format: int64 example: 48 hypervisorNumReadIo: type: integer description: The number of read I/O operations by the VM. format: int64 example: 92 hypervisorNumReadIops: type: integer description: The number of read I/O operations by the VM per second. format: int64 example: 21 hypervisorNumReceivedBytes: type: integer description: The number of bytes received by the VM. format: int64 example: 67 hypervisorNumTransmittedBytes: type: integer description: The number of bytes transmitted by the VM. format: int64 example: 47 hypervisorNumWriteIo: type: integer description: The number of write I/O by the VM. format: int64 example: 62 hypervisorNumWriteIops: type: integer description: The number of write I/O operations by the VM per second. format: int64 example: 29 hypervisorReadIoBandwidthKbps: type: integer description: The number of read I/O bandwidth of the VM in kilobytes per second. format: int64 example: 14 hypervisorSwapInRateKbps: type: integer description: The swap in rate of the VM in kilobytes per second. format: int64 example: 17 hypervisorSwapOutRateKbps: type: integer description: The swap out rate of the VM in kilobytes per second. format: int64 example: 60 hypervisorTimespanMicros: type: integer description: The timespan of the VM in microseconds. format: int64 example: 3 hypervisorTotalIoSizeKb: type: integer description: The total I/O size of the VM in kilobytes. format: int64 example: 65 hypervisorTotalIoTimeMicros: type: integer description: The total I/O time of the VM in microseconds. format: int64 example: 27 hypervisorTotalReadIoSizeKb: type: integer description: The total read I/O size of the VM in kilobytes. format: int64 example: 80 hypervisorWriteIoBandwidthKbps: type: integer description: The write I/O bandwidth of the VM in kilobytes per second. format: int64 example: 41 hypervisorType: type: string description: Hypervisor type of the VM. example: string memoryUsagePpm: type: integer description: The VM memory usage in PPM. format: int64 example: 28 timestamp: type: string description: The timestamp of a specific VM stats response data point. format: date-time example: 2009-09-23T14:30:00-07:00 additionalProperties: false description: A collection of VM stats. vmm.v4.2.esxi.stats.GetVmStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.esxi.stats.VmStats oneOf: - $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{extId}\ \ Get operation" vmm.v4.2.esxi.stats.GetNicStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.esxi.stats.VmNicStats oneOf: - $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmNicStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/nics/{extId}\ \ Get operation" vmm.v4.2.esxi.stats.VmNicStats: description: A collection of VM NIC stats. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: vmExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The VM external ID associated with the VM NIC stats. example: d46cf869-23fc-471e-ac8d-e866482aa984 stats: type: array description: The timestamp of a specific VM stats response data point. items: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmNicStatsTuple' additionalProperties: false vmm.v4.2.esxi.stats.VmNicStatsTuple: type: object properties: timestamp: type: string description: The timestamp of a specific VM stats response data point. format: date-time example: 2009-09-23T14:30:00-07:00 networkDroppedReceivedPackets: type: integer description: The VM NIC number of dropped received packets. format: int64 example: 27 networkDroppedTransmittedPackets: type: integer description: The VM NIC number of dropped transmitted packets. format: int64 example: 2 additionalProperties: false description: A collection of VM NIC stats. vmm.v4.2.esxi.stats.GetDiskStatsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.esxi.stats.VmDiskStats oneOf: - $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmDiskStats' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/esxi/stats/vms/{vmExtId}/disks/{extId}\ \ Get operation" vmm.v4.2.esxi.stats.VmDiskStats: description: A collection of VM disk stats. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: vmExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The VM external ID associated with the VM Disk stats. example: da08c807-6eec-4515-b972-707a51b24ef2 stats: type: array description: The timestamp of a specific VM stats response data point. items: $ref: '#/components/schemas/vmm.v4.2.esxi.stats.VmDiskStatsTuple' additionalProperties: false vmm.v4.2.esxi.stats.VmDiskStatsTuple: type: object properties: timestamp: type: string description: The timestamp of a specific VM stats response data point. format: date-time example: 2009-09-23T14:30:00-07:00 controllerNumIops: type: integer description: The VM disk controller number of I/O operations per second. format: int64 example: 79 controllerTotalReadIoTimeMicros: type: integer description: The VM disk controller total read I/O time in microseconds. format: int64 example: 30 controllerNumWriteIo: type: integer description: The VM disk controller number of write I/O. format: int64 example: 7 controllerTotalIoTimeMicros: type: integer description: The VM disk controller total I/O time in microseconds. format: int64 example: 9 controllerNumSeqIo: type: integer description: The VM disk controller number of sequential I/O. format: int64 example: 86 controllerTotalIoSizeKb: type: integer description: The VM disk controller total I/O size in kilobytes. format: int64 example: 57 controllerNumIo: type: integer description: The VM disk controller number of I/O. format: int64 example: 95 controllerWriteIoPpm: type: integer description: The VM disk controller percentage of write I/O in parts per million. format: int64 example: 90 controllerNumWriteIops: type: integer description: The VM disk controller number of write I/O operations per second. format: int64 example: 0 controllerAvgWriteIoLatencyMicros: type: integer description: The VM disk controller average write I/O latency in microseconds. format: int64 example: 37 controllerNumReadIops: type: integer description: The VM disk controller number of read I/O operations per second. format: int64 example: 56 controllerTotalReadIoSizeKb: type: integer description: The VM disk controller total read I/O size in kilobytes. format: int64 example: 22 controllerReadIoPpm: type: integer description: The VM disk controller percentage of read I/O in parts per million. format: int64 example: 56 controllerAvgIoLatencyMicros: type: integer description: The VM disk controller average I/O latency in microseconds. format: int64 example: 4 controllerNumReadIo: type: integer description: The VM disk controller number of read I/O. format: int64 example: 52 controllerSeqIoPpm: type: integer description: The VM disk controller percentage of sequential I/O in parts per million. format: int64 example: 55 controllerReadIoBandwidthKbps: type: integer description: The VM disk controller number of read I/O bandwidth in kilobytes per second. format: int64 example: 63 controllerIoBandwidthKbps: type: integer description: The VM disk controller number of I/O bandwidth in kilobytes per second. format: int64 example: 50 controllerWriteIoBandwidthKbps: type: integer description: The VM disk controller write I/O bandwidth in kilobytes per second. format: int64 example: 2 controllerUserBytes: type: integer description: The VM disk controller user bytes. format: int64 example: 61 controllerRandomIoPpm: type: integer description: The VM disk controller percentage of random I/O in parts per million. format: int64 example: 17 controllerAvgReadIoSizeKb: type: integer description: The VM disk controller average read I/O size in kilobytes. format: int64 example: 51 controllerAvgWriteIoSizeKb: type: integer description: The VM disk controller average write I/O size in kilobytes. format: int64 example: 67 controllerAvgReadIoLatencyMicros: type: integer description: The VM disk controller average read I/O latency in microseconds. format: int64 example: 97 controllerTimespanMicros: type: integer description: The VM disk controller timespan in microseconds. format: int64 example: 30 additionalProperties: false description: A collection of VM disk stats. dataprotection.v4.0.common.BaseVmRecoveryPoint: title: VM Recovery point properties description: A model that represents common properties of a VM Recovery point resources allOf: - $ref: '#/components/schemas/dataprotection.v4.0.common.BaseRecoveryPoint' - type: object properties: consistencyGroupExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the Consistency group which the VM was part of at the time of recovery point creation. readOnly: true example: bad1f307-a9c5-4d70-8dc7-ee9c4a3cb9f1 diskRecoveryPoints: maxItems: 1024 minItems: 1 type: array readOnly: true items: $ref: '#/components/schemas/dataprotection.v4.0.common.DiskRecoveryPoint' vmExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: VM external identifier which is captured as a part of this recovery point. example: e4cca047-a8aa-4474-9aa0-82832e8591ec vmCategories: maxItems: 256 minItems: 1 type: array description: "Category key-value pairs associated with the VM at the time\ \ of recovery point creation. The category key and value are separated\ \ by '/'. For example, a category with key 'dept' and value 'hr' is\ \ displayed as 'dept/hr'." readOnly: true items: type: string example: dept_1/hr applicationConsistentProperties: required: - $objectType properties: $objectType: type: string example: dataprotection.v4.common.VssProperties description: User-defined application-consistent properties for the recovery point. oneOf: - $ref: '#/components/schemas/dataprotection.v4.0.common.VssProperties' additionalProperties: false common.v1.0.config.FQDN: type: object properties: value: pattern: "^([a-zA-Z0-9À-ÿ]+(?:-[a-zA-Z0-9À-ÿ]+)*\\.)+[a-zA-ZÀ-ÿ]{2,63}$" type: string description: | The fully qualified domain name of the host. example: string additionalProperties: false description: | A fully qualified domain name that specifies its exact location in the tree hierarchy of the Domain Name System. common.v1.0.config.IPv4Address: required: - value type: object properties: value: pattern: "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" type: string description: | The IPv4 address of the host. example: 102.213.206.82 prefixLength: maximum: 32 minimum: 0 type: integer description: | The prefix length of the network to which this host IPv4 address belongs. format: int32 default: 32 additionalProperties: false description: | An unique address that identifies a device on the internet or a local network in IPv4 format. common.v1.0.config.IPv6Address: required: - value type: object properties: value: pattern: "^(?:(?:(?:[A-Fa-f0-9]{1,4}:){6}|(?=(?:[A-Fa-f0-9]{0,4}:){0,6}(?:[0-9]{1,3}\\\ .){3}[0-9]{1,3}$)(([0-9a-fA-F]{1,4}:){0,5}|:)((:[0-9a-fA-F]{1,4}){1,5}:|:)|::(?:[A-Fa-f0-9]{1,4}:){5})(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\\ .){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[A-Fa-f0-9]{1,4}:){7}[A-Fa-f0-9]{1,4}|(?=(?:[A-Fa-f0-9]{0,4}:){0,7}[A-Fa-f0-9]{0,4}$)(([0-9a-fA-F]{1,4}:){1,7}|:)((:[0-9a-fA-F]{1,4}){1,7}|:)|(?:[A-Fa-f0-9]{1,4}:){7}:|:(:[A-Fa-f0-9]{1,4}){7})$" type: string description: | The IPv6 address of the host. example: a3b2:2eee:2796:5766:7931:14d9:0993:9b0c prefixLength: maximum: 128 minimum: 0 type: integer description: | The prefix length of the network to which this host IPv6 address belongs. format: int32 default: 128 additionalProperties: false description: | An unique address that identifies a device on the internet or a local network in IPv6 format. dataprotection.v4.0.common.BaseRecoveryPoint: title: Recovery point properties description: A model that represents common properties of a Recovery point resources allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: locationAgnosticId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Location agnostic identifier of the Recovery point. readOnly: true example: ab2fa5e2-3b34-49da-bb04-95c86231e30a name: maxLength: 256 type: string description: The name of the Recovery point. example: RecoveryPoint_1 creationTime: type: string description: The UTC date and time in ISO-8601 format when the Recovery point is created. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 expirationTime: type: string description: The UTC date and time in ISO-8601 format when the current Recovery point expires and will be garbage collected. format: date-time example: 2009-09-23T14:30:00-07:00 status: $ref: '#/components/schemas/dataprotection.v4.0.common.RecoveryPointStatus' recoveryPointType: $ref: '#/components/schemas/dataprotection.v4.0.common.RecoveryPointType' totalExclusiveUsageBytes: type: integer description: "Indicates the total exclusive usage of this recovery point,\ \ which is the total space that could be reclaimed after deleting this\ \ recovery point." format: int64 readOnly: true example: 78 additionalProperties: false dataprotection.v4.0.common.DiskRecoveryPoint: title: Disk recovery point model type: object properties: diskRecoveryPointExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Disk recovery point identifier. readOnly: true example: b5e151dc-0e59-4bfd-9db6-4fb50c8d4157 diskExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Disk external identifier which is captured as a part of this recovery point. readOnly: true example: 4e41d319-ba14-4b7d-bcc7-dd3ff0631164 additionalProperties: false description: A model that represents the disk recovery point properties. dataprotection.v4.0.common.VssProperties: title: Application consistent properties. required: - backupType type: object properties: backupType: $ref: '#/components/schemas/dataprotection.v4.0.common.BackupType' shouldIncludeWriters: type: boolean description: "Indicates whether the given set of VSS writers' UUIDs should\ \ be included or excluded from the application consistent recovery point.\ \ By default, the value is set to false, indicating that all listed VSS\ \ writers' UUIDs will be excluded." default: false writers: maxItems: 25 minItems: 1 type: array description: List of VSS writer UUIDs that are used in an application consistent recovery point. The default values are the system and the registry writer UUIDs. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 21020f05-7ac4-40bc-9e4b-a2719038800e shouldStoreVssMetadata: type: boolean description: "Indicates whether to store the VSS metadata if the user is\ \ interested in application-specific backup/restore. The VSS metadata\ \ consists of VSS writers and requester metadata details. These are compressed\ \ into a cabinet file(.cab file) during a VSS backup operation. This cabinet\ \ file must be saved to the backup media during a backup operation, as\ \ it is required during the restore operation." default: false additionalProperties: false description: "For Windows VMs/agents, application-consistent recovery points\ \ are selected using the Windows-specific Volume Shadow Copy Service (VSS).\ \ The enclosed properties, also called VSS properties, are used by the Windows\ \ platform to decide the type of application-consistent recovery points to\ \ consider." dataprotection.v4.0.common.RecoveryPointStatus: type: string description: "The status of the Recovery point, which indicates whether this\ \ Recovery point is fit to be consumed." enum: - COMPLETE - $UNKNOWN - $REDACTED x-enumDescriptions: COMPLETE: The Recovery point is in a complete state and ready to be consumed. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. dataprotection.v4.0.common.RecoveryPointType: type: string description: Type of the Recovery point. enum: - CRASH_CONSISTENT - APPLICATION_CONSISTENT - $UNKNOWN - $REDACTED x-enumDescriptions: $UNKNOWN: | Unknown value. CRASH_CONSISTENT: Crash-consistent Recovery points capture all the VM and application level details. $REDACTED: | Redacted value. APPLICATION_CONSISTENT: Application-consistent Recovery points can capture all the data stored in the memory and also the in-progress transaction details. dataprotection.v4.0.common.BackupType: title: Backup type for vss snapshot type: string description: |- The backup type specifies the criteria for identifying the files to be backed up. This property should be specified to the application-consistent recovery points for Windows VMs/agents. The following backup types are supported for the application-consistent recovery points: 1. FULL_BACKUP - All files are backed up irrespective of their last backup date/time and state. Also, this backup type updates the backup history of every file that was involved in the recovery point. 2. COPY_BACKUP - All files are backed up regardless of their last backup date/time and state. However, this backup type does not update the backup history of individual files involved in the recovery point. enum: - FULL_BACKUP - COPY_BACKUP - $UNKNOWN - $REDACTED x-enumDescriptions: FULL_BACKUP: "All the files are backed up irrespective of their last backup\ \ date/time or state. Also, this backup type updates the backup history\ \ of each file that participated in the recovery point. If not explicitly\ \ specified, this is the default backup type." $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. COPY_BACKUP: "All the files are backed up regardless of their last backup\ \ date/time and state; however, this backup type does not update the backup\ \ history of individual files involved in the recovery point." vmm.v4.2.ahv.config.OvaVmConfigOverrideSpec: required: - nics type: object properties: name: maxLength: 80 type: string description: VM name. example: string numSockets: minimum: 1 type: integer description: Number of vCPU sockets. format: int32 example: 21 numCoresPerSocket: minimum: 1 type: integer description: Number of cores per socket. format: int32 example: 36 numThreadsPerCore: minimum: 1 type: integer description: Number of threads per core. format: int32 example: 71 memorySizeBytes: minimum: 1 type: integer description: Memory size in bytes. format: int64 example: 61 nics: maxItems: 64 minItems: 0 type: array description: NICs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' cdRoms: maxItems: 4 minItems: 0 type: array description: CD-ROMs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CdRom' categories: maxItems: 256 minItems: 0 type: array description: Categories for the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.CategoryReference' additionalProperties: false description: VM config override spec for OVA VM deploy endpoint. catalogCommon.v1.0.config.CommonPlacementPolicy: title: Placement policy. description: Placement policy model. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: name: maxLength: 256 minLength: 1 type: string description: Name of the placement policy. example: string description: maxLength: 1000 type: string description: Description of the placement policy. example: string placementType: $ref: '#/components/schemas/catalogCommon.v1.0.config.ContentPlacementType' contentFilter: $ref: '#/components/schemas/catalogCommon.v1.0.config.CategoriesFilter' clusterFilter: $ref: '#/components/schemas/catalogCommon.v1.0.config.CategoriesFilter' createTime: type: string description: The time when the placement policy was created. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: The time when the placement policy was last updated. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the user who created the placement policy. readOnly: true example: 84efb591-00a0-468e-9af9-6345d26ba68f updatedBy: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the user who updated the placement policy. readOnly: true example: f48f08b8-2f58-475e-afc8-4927a37ea19b additionalProperties: false catalogCommon.v1.0.config.ContentPlacementType: type: string description: Type of placement policy. enum: - SOFT - $UNKNOWN - $REDACTED x-enumDescriptions: SOFT: | Soft placement policy. Entities can be placed on clusters beyond those mandated by the placement policy. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. catalogCommon.v1.0.config.CategoriesFilter: title: Category-based entity filter. required: - categoryExtIds - type type: object properties: type: $ref: '#/components/schemas/catalogCommon.v1.0.config.CategoriesMatchType' categoryExtIds: maxItems: 100 minItems: 1 type: array description: Filter to match entities based on the provided categories. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 7205144a-df70-474e-94b3-ff0468546ff1 additionalProperties: false description: Category-based entity filter. catalogCommon.v1.0.config.CategoriesMatchType: type: string description: Filter matching type. enum: - CATEGORIES_MATCH_ALL - CATEGORIES_MATCH_ANY - $UNKNOWN - $REDACTED x-enumDescriptions: CATEGORIES_MATCH_ALL: The policy only applies to the entities matching all the categories attached to the policy. CATEGORIES_MATCH_ANY: The policy only applies to the entities matching a subset of categories attached to the policy. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.content.VmConfigOverride: type: object properties: name: maxLength: 80 minLength: 1 type: string description: VM name. example: LinuxServer_VM numSockets: minimum: 1 type: integer description: Number of vCPU sockets. format: int32 example: 13 numCoresPerSocket: minimum: 1 type: integer description: Number of cores per socket. format: int32 example: 56 numThreadsPerCore: minimum: 1 type: integer description: Number of threads per core. format: int32 example: 11 memorySizeBytes: minimum: 1 type: integer description: (VmMemorySizeBytesDescription) format: int64 example: 53 nics: maxItems: 64 minItems: 0 type: array description: NICs attached to the VM. items: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Nic' guestCustomization: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestCustomizationParams' guestCustomizationProfileConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileConfig' additionalProperties: false description: Overrides specification for VM creation from a template. vmm.v4.2.error.ErrorResponse: type: object properties: error: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.error.AppMessage' - $ref: '#/components/schemas/vmm.v4.2.error.SchemaValidationError' additionalProperties: false description: An error response indicates that the operation has failed either due to a client error(4XX) or server error(5XX). Please look at the HTTP status code and namespace specific error code and error message for further details. x-platform-generated: true vmm.v4.2.error.AppMessage: type: object properties: message: type: string description: The message string. example: string severity: $ref: '#/components/schemas/common.v1.0.config.MessageSeverity' code: type: string description: "The code associated with this message. This string is typically\ \ prefixed with the namespace to which the endpoint belongs. For example:\ \ VMM-40000" example: string locale: type: string description: Locale for this message. The default locale would be 'en-US'. default: en_US errorGroup: type: string description: The error group associated with this message of severity ERROR. example: string argumentsMap: type: object additionalProperties: type: string description: The map of argument name to value. additionalProperties: false description: Message with associated severity describing status of the current operation. x-platform-generated: true vmm.v4.2.error.MessageSeverity: type: string description: Enum schema MessageSeverity enum: - INFO - WARNING - ERROR - $UNKNOWN - $REDACTED x-platform-generated: true x-codegen-hint: $any: - type: entity-identifier properties: identifiers: - value: $UNKNOWN index: 201 - value: $REDACTED index: 202 - value: INFO index: 203 - value: WARNING index: 204 - value: ERROR index: 205 vmm.v4.2.error.SchemaValidationError: type: object properties: timestamp: type: string description: Timestamp of the response. format: date-time example: 2009-09-23T14:30:00-07:00 statusCode: type: integer description: The HTTP status code of the response. example: 25 error: type: string description: The generic error message for the response. example: string path: type: string description: API path on which the request was made. example: string validationErrorMessages: type: array description: List of validation error messages items: $ref: '#/components/schemas/vmm.v4.2.error.SchemaValidationErrorMessage' additionalProperties: false description: This schema is generated from SchemaValidationError.java x-platform-generated: true vmm.v4.2.error.SchemaValidationErrorMessage: type: object properties: location: type: string description: "The part of the request that failed validation. Validation\ \ can fail for path, query parameters, and request body." example: string message: type: string description: The detailed message for the validation error. example: string attributePath: type: string description: The path of the attribute that failed validation in the schema. example: string additionalProperties: false description: This schema is generated from SchemaValidationErrorMessage.java x-platform-generated: true prism.v4.3.config.TaskReference: type: object properties: extId: pattern: "^[a-zA-Z0-9/+]*={0,2}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" type: string description: A globally unique identifier for a task. example: QmFzZTY0RW5jb2RlZA==:ab65cdd0-14f5-4ace-81dd-53f63ac6a639 additionalProperties: false description: A reference to a task tracking an asynchronous operation. The status of the task can be queried by making a GET request to the task URI provided in the metadata section of the API response. vmm.v4.2.content.ListImagesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.content.Image' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Get operation vmm.v4.2.content.Image: allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: Virtual disk image. required: - name - type type: object properties: name: maxLength: 256 minLength: 1 type: string description: The user-defined name of an image. example: LinuxInstaller.iso description: maxLength: 1000 type: string description: The user-defined description of an image. example: Installer with updated kernel type: $ref: '#/components/schemas/vmm.v4.2.content.ImageType' checksum: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.ImageSha1Checksum description: The checksum of an image. oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.ImageSha1Checksum' - $ref: '#/components/schemas/vmm.v4.2.content.ImageSha256Checksum' sizeBytes: type: integer description: The size of an image in bytes. format: int64 readOnly: true example: 66 source: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.UrlSource description: "The source of an image, which can be a VM disk, a URL, or\ \ an Objects Lite key." oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.UrlSource' - $ref: '#/components/schemas/vmm.v4.2.content.VmDiskSource' - $ref: '#/components/schemas/vmm.v4.2.content.ObjectsLiteSource' categoryExtIds: maxItems: 1250 minItems: 0 type: array description: List of external identifier of the category for an image. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ad497809-dc3e-4411-99da-a64df948ffcd clusterLocationExtIds: maxItems: 200 minItems: 0 type: array description: List of external identifier of the cluster where the image is located. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 09b49b83-6578-45ba-94e2-96a17964f0f2 createTime: type: string description: Image creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 lastUpdateTime: type: string description: Last updated time of an image. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 ownerExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the owner of the image. readOnly: true example: 35924930-1a1b-4996-b50b-baa39c18e733 ownerName: type: string description: Name of the owner of the image. readOnly: true example: string placementPolicyStatus: maxItems: 100 minItems: 0 type: array description: Status of an image placement policy. readOnly: true items: $ref: '#/components/schemas/vmm.v4.2.content.ImagePlacementStatus' additionalProperties: false description: Image that can be attached to a VM. x-required-by-operation: create: - source vmm.v4.2.content.CreateImageApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images Post operation vmm.v4.2.content.ImageType: type: string description: The type of an image. enum: - DISK_IMAGE - ISO_IMAGE - $UNKNOWN - $REDACTED x-enumDescriptions: DISK_IMAGE: A flat disk image. ISO_IMAGE: An image of type ISO that can only be attached as a CDROM. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.content.ImageSha1Checksum: required: - hexDigest type: object properties: hexDigest: pattern: "^([a-fA-F0-9]{40})$" type: string description: The SHA1 digest of an image file in hexadecimal format. example: f8dFbc6Bd25EfF0EcBA2aE6FAb5c4cBcF0eC8cDB additionalProperties: false description: The SHA1 checksum of an image. vmm.v4.2.content.ImageSha256Checksum: required: - hexDigest type: object properties: hexDigest: pattern: "^([a-fA-F0-9]{64})$" type: string description: The SHA256 digest of an image file in hexadecimal format. example: C97Bb893caB51D1caeCbDCEbB2A7aefF9930eb5C0aFE66EdB9a6E776D13ABc5e additionalProperties: false description: The SHA256 checksum of an image. vmm.v4.2.content.UrlSource: required: - url type: object properties: url: pattern: "^((http[s]?|nfs):\\/)?\\/?([^:\\/\\s]*)((\\/\\w+)*(:[0-9]+)*?\\\ /)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$" type: string description: The URL for creating an image. example: https://example.com/images/linux_installer.iso shouldAllowInsecureUrl: type: boolean description: Ignore the certificate errors if the value is true. Default is false. writeOnly: true default: false basicAuth: $ref: '#/components/schemas/vmm.v4.2.content.UrlBasicAuth' additionalProperties: false description: The source URL details for creating an image. vmm.v4.2.content.VmDiskSource: required: - extId type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of a VM disk. example: 351f733a-0710-4d02-8877-f3722ca53682 additionalProperties: false description: VM disk to create an image. VM disk external identifier is available from the `disks` list in VMs APIs. vmm.v4.2.content.ObjectsLiteSource: required: - key type: object properties: key: maxLength: 1024 minLength: 1 type: string description: "Key that identifies the source object in the bucket. The resource\ \ implies the bucket, 'vmm-images' for Image and 'vmm-ovas' for OVA." example: object_key additionalProperties: false description: The object details for creating an image or OVA. vmm.v4.2.content.ImagePlacementStatus: required: - complianceStatus - enforcementMode - placementPolicyExtId type: object properties: placementPolicyExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of image placement policy. example: 44634e7c-a3e4-4740-b4bd-18d3739980b0 complianceStatus: $ref: '#/components/schemas/vmm.v4.2.content.ComplianceStatus' enforcementMode: $ref: '#/components/schemas/vmm.v4.2.content.EnforcementMode' policyClusterExtIds: maxItems: 200 minItems: 0 type: array description: List of cluster external identifiers of the image location for the enforced placement policy. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 88dfbec7-c491-4fd1-a53a-dcf6eb45cfd2 enforcedClusterExtIds: maxItems: 200 minItems: 0 type: array description: List of cluster external identifiers for the enforced placement policy. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 181b0d15-344d-4d87-ad14-c8c84d392e7b conflictingPolicyExtIds: maxItems: 100 minItems: 0 type: array description: List of image placement policy external identifiers that conflict with the current one. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: e7999e09-0e6e-422a-86db-aa3f263ed7ce additionalProperties: false description: Status of an image placement policy. vmm.v4.2.content.UrlBasicAuth: required: - password - username type: object properties: username: maxLength: 1000 minLength: 1 type: string description: Username for basic authentication. example: test_user password: type: string description: Password for basic authentication. example: test_password additionalProperties: false description: Basic authentication credentials for image source HTTP/S URL. vmm.v4.2.content.ComplianceStatus: type: string description: Compliance status for a placement policy. enum: - COMPLIANT - NON_COMPLIANT - $UNKNOWN - $REDACTED x-enumDescriptions: COMPLIANT: "The image placement policy is compliant, and there are no conflicting\ \ policies." NON_COMPLIANT: "The image placement policy is not compliant, and there might\ \ be some conflicting policies." $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.content.EnforcementMode: type: string description: Indicates whether the placement policy enforcement is ongoing or has failed. enum: - ENFORCING - ENFORCEMENT_FAILED - $UNKNOWN - $REDACTED x-enumDescriptions: ENFORCEMENT_FAILED: The image placement policy enforcement by the backend service has failed. ENFORCING: The image placement policy is being enforced by the backend service. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.content.GetImageApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.Image oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.Image' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Get operation" vmm.v4.2.content.UpdateImageApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Put operation" vmm.v4.2.content.DeleteImageApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{extId}\ \ Delete operation" vmm.v4.2.content.ImageImportConfig: required: - clusterExtId - imagesExtIds type: object properties: clusterExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Cluster external identifier. example: 44cb13ea-4039-4952-a90a-65f808493637 imagesExtIds: maxItems: 100 minItems: 0 type: array description: List of external identifiers for images that need to be imported. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: b9c1e191-8237-4be9-986d-3a547c3c946c additionalProperties: false description: The references to Prism Element cluster and respective retained images. vmm.v4.2.content.ImportImageApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/images/$actions/import Post operation vmm.v4.2.content.GetImageFileApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: string format: binary example: QmFzZTY0RW5jb2RlZA== - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/images/{imageExtId}/file\ \ Get operation" vmm.v4.2.content.ListOvasApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.content.Ova' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Get operation vmm.v4.2.content.Ova: allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: Virtual Machine Model as OVA. required: - name type: object properties: name: maxLength: 256 minLength: 1 type: string description: Name of the OVA. example: LinuxServer_2.1_OVA checksum: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.OvaSha1Checksum description: The checksum of an OVA. oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.OvaSha1Checksum' - $ref: '#/components/schemas/vmm.v4.2.content.OvaSha256Checksum' sizeBytes: minimum: 1 type: integer description: Size of OVA in bytes. format: int64 readOnly: true example: 31 source: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.OvaUrlSource description: | Source of the created OVA file. The source can either be a VM, URL, or a local upload. oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.OvaUrlSource' - $ref: '#/components/schemas/vmm.v4.2.content.OvaVmSource' - $ref: '#/components/schemas/vmm.v4.2.content.ObjectsLiteSource' createTime: type: string description: Time when the OVA was created time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 lastUpdateTime: type: string description: Time when the OVA was last updated time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/iam.v4.1.b2.authn.User' clusterLocationExtIds: maxItems: 200 minItems: 0 type: array description: List of cluster identifiers where the OVA is located. This field is required when creating an OVA from URL or Objects lite upload. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 86b147fd-8054-4532-a6cd-11c2b7e91993 parentVm: type: string description: The parent VM used for creating the OVA. readOnly: true example: LinuxServer_VM vmConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' diskFormat: $ref: '#/components/schemas/vmm.v4.2.content.OvaDiskFormat' additionalProperties: false description: OVA that can be used to deploy a VM. x-required-by-operation: create: - source vmm.v4.2.content.CreateOvaApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/ovas Post operation vmm.v4.2.content.OvaSha1Checksum: required: - hexDigest type: object properties: hexDigest: pattern: "^([a-fA-F0-9]{40})$" type: string description: The SHA1 digest of an OVA file in hexadecimal format. example: dA25Bca3e0EdbEbF3F28BA1455682aB19dd94979 additionalProperties: false description: The SHA1 checksum of an OVA. vmm.v4.2.content.OvaSha256Checksum: required: - hexDigest type: object properties: hexDigest: pattern: "^([a-fA-F0-9]{64})$" type: string description: The SHA256 digest of an OVA file in hexadecimal format. example: 1a2B40EfCECeFb4CBc9BcCfbFd5B5ebf892c9EAAbD1E5Eebc7d6EAa0CBBfcAde additionalProperties: false description: The SHA256 checksum of an OVA. vmm.v4.2.content.OvaUrlSource: required: - url type: object properties: url: pattern: "^((http[s]?|nfs):\\/)?\\/?([^:\\/\\s]*)((\\/\\w+)*(:[0-9]+)*?\\\ /)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$" type: string description: The URL that can be used to download an OVA. example: string shouldAllowInsecureUrl: type: boolean description: Ignore the certificate errors if the value is true. Default is false. writeOnly: true default: false basicAuth: $ref: '#/components/schemas/vmm.v4.2.content.UrlBasicAuth' additionalProperties: false description: URL to create an OVA. vmm.v4.2.content.OvaVmSource: required: - diskFileFormat - vmExtId type: object properties: vmExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The identifier of a VM to be exported to an OVA. example: 32834b89-b0a3-4322-9c2d-fdd193a0b54a diskFileFormat: $ref: '#/components/schemas/vmm.v4.2.content.OvaDiskFormat' additionalProperties: false description: VM to export an OVA. vmm.v4.2.content.OvaDiskFormat: type: string description: Disk format of an OVA. enum: - QCOW2 - VMDK - $UNKNOWN - $REDACTED x-enumDescriptions: VMDK: The VMDK disk format of an OVA. $UNKNOWN: | Unknown value. QCOW2: The QCOW2 disk format of an OVA. $REDACTED: | Redacted value. vmm.v4.2.content.GetOvaApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.Ova oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.Ova' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Get operation" vmm.v4.2.content.UpdateOvaApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Put operation" vmm.v4.2.content.DeleteOvaApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}\ \ Delete operation" vmm.v4.2.content.GetOvaFileApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: string format: binary example: QmFzZTY0RW5jb2RlZA== - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{ovaExtId}/file\ \ Get operation" vmm.v4.2.content.OvaDeploymentSpec: required: - clusterLocationExtId - overrideVmConfig type: object properties: overrideVmConfig: $ref: '#/components/schemas/vmm.v4.2.ahv.config.OvaVmConfigOverrideSpec' clusterLocationExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Cluster identifier to deploy VM from OVA. This field is required when deploying an OVA and must be a part of the OVA location list. example: 834c72ae-6294-451f-bc7a-e001fb82c4a5 additionalProperties: false description: The OVA deployment model. vmm.v4.2.content.DeployOvaApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/ovas/{extId}/$actions/deploy\ \ Post operation" vmm.v4.2.content.ListTemplatesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.content.Template' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Get operation vmm.v4.2.content.Template: allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: The template model. type: object properties: templateName: maxLength: 256 minLength: 1 type: string description: The user-defined name of a template. example: LinuxServer_VM_Template templateDescription: maxLength: 1000 type: string description: The user-defined description of a template. example: Template for deploying Linux Server virtual machines. templateVersionSpec: $ref: '#/components/schemas/vmm.v4.2.content.TemplateVersionSpec' guestUpdateStatus: $ref: '#/components/schemas/vmm.v4.2.content.GuestUpdateStatus' createTime: type: string description: Time when the template was created. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 updateTime: type: string description: Time when the template was last updated. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/vmm.v4.2.content.TemplateUser' updatedBy: $ref: '#/components/schemas/vmm.v4.2.content.TemplateUser' categoryExtIds: maxItems: 1250 minItems: 0 type: array description: List of category external identifiers for a VM Template. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 036187bf-5c06-4369-aa7d-b1b24dc73c2d additionalProperties: false description: The template model. x-required-by-operation: create: - templateName - templateVersionSpec vmm.v4.2.content.CreateTemplateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/content/templates Post operation vmm.v4.2.content.TemplateVersionSpec: description: The template version model. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: Version of a template. required: - versionSource type: object properties: versionName: maxLength: 256 type: string description: The user-defined name of a template version. example: v2.1 versionDescription: maxLength: 1000 minLength: 1 type: string description: The user-defined description of a template version. example: Updated version with 8GB memory. vmSpec: $ref: '#/components/schemas/vmm.v4.2.ahv.config.Vm' createTime: type: string description: Time when the template was created. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: $ref: '#/components/schemas/vmm.v4.2.content.TemplateUser' versionSource: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.TemplateVmReference description: | Source of the template version created. When creating a new template, the source must be a VM. When creating a new version, the source can be either a VM or an existing version within the template. writeOnly: true oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.TemplateVmReference' - $ref: '#/components/schemas/vmm.v4.2.content.TemplateVersionReference' versionSourceDiscriminator: type: string description: | Source type of the template version created. It can be either a VM or a template version. writeOnly: true example: vmm.v4.content.TemplateVersionReference isActiveVersion: type: boolean description: | Specify whether to mark the template version as active or not. The newly created version during template creation, update, or guest OS update is set to active by default unless specified otherwise. default: true isGcOverrideEnabled: type: boolean description: Allow or disallow overriding guest customization during template deployment. example: true clusterLocationExtIds: maxItems: 200 minItems: 0 type: array description: List of external identifier of the cluster where the image is located. readOnly: true items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: ba7f6ab9-9581-432f-8e12-449360939911 guestCustomizationProfile: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileReference' additionalProperties: false x-required-by-operation: update: - versionName - versionDescription vmm.v4.2.content.GuestUpdateStatus: type: object properties: deployedVmReference: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The identifier of the temporary VM created when the guest OS update was initiated. example: 7122e07a-ed43-4137-95f6-eacdcc8c9af8 additionalProperties: false description: Status of a guest update. vmm.v4.2.content.TemplateUser: description: Details for the user who created or modified the template. allOf: - $ref: '#/components/schemas/iam.v4.1.b2.authn.User' vmm.v4.2.content.TemplateVmReference: required: - extId type: object properties: extId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The identifier of a VM. example: 7a596f35-13ec-4f05-9b19-807864746f62 guestCustomizationProfile: $ref: '#/components/schemas/vmm.v4.2.ahv.config.VmGcProfileReference' guestCustomization: $ref: '#/components/schemas/vmm.v4.2.ahv.config.GuestCustomizationParams' additionalProperties: false description: The template VM reference model. vmm.v4.2.content.TemplateVersionReference: required: - overrideVmConfig - versionId type: object properties: versionId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The identifier of a version. example: 6c6827f8-0e0c-4d55-8437-7744b394862d overrideVmConfig: $ref: '#/components/schemas/vmm.v4.2.content.VmConfigOverride' additionalProperties: false description: Template version reference model. vmm.v4.2.content.GetTemplateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.Template oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.Template' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Get operation" vmm.v4.2.content.UpdateTemplateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Put operation" vmm.v4.2.content.DeleteTemplateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}\ \ Delete operation" vmm.v4.2.content.TemplateDeployment: required: - clusterReference - numberOfVms type: object properties: versionId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The identifier of a version. example: 55a7ebd7-1a79-4313-9499-d9c5f0d6770b numberOfVms: maximum: 250 minimum: 1 type: integer description: Number of VMs to be deployed. format: int32 default: 1 overrideVmConfigMap: type: object additionalProperties: $ref: '#/components/schemas/vmm.v4.2.content.VmConfigOverride' description: | The map specifies the VM configuration overrides for each of the specified VM(s) to be created. The overrides can include the created VM Name, configuration and guest customization. For each VM to be created, the map has the index of the VM as the key and the corresponding VM override configurations as the value. clusterReference: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: | The identifier of the cluster where the VM(s) will be created using a template. example: 0affbb1a-9bd0-46c3-967a-ccd3ab40d15f additionalProperties: false description: The template deployment model. vmm.v4.2.content.DeployTemplateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/deploy\ \ Post operation" vmm.v4.2.content.ListTemplateVersionsApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.content.TemplateVersionSpec' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions\ \ Get operation" vmm.v4.2.content.GetTemplateVersionApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.content.TemplateVersionSpec oneOf: - $ref: '#/components/schemas/vmm.v4.2.content.TemplateVersionSpec' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Get operation" vmm.v4.2.content.DeleteTemplateVersionApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{templateExtId}/versions/{extId}\ \ Delete operation" vmm.v4.2.content.InitiateGuestUpdateSpec: type: object properties: versionId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The identifier of a version. example: 08ca1b18-3311-41b5-a251-b21d35a7f8ec additionalProperties: false description: Input to template guest OS update. vmm.v4.2.content.InitiateGuestUpdateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/initiate-guest-update\ \ Post operation" vmm.v4.2.content.CompleteGuestUpdateSpec: required: - versionDescription - versionName type: object properties: versionName: maxLength: 256 type: string description: The user-defined name of a template version. example: v2.1 versionDescription: maxLength: 1000 type: string description: The user-defined description of a template version. example: Updated version with 8GB memory. isActiveVersion: type: boolean description: | Specify whether to mark the template version as active or not. The newly created version during template creation, update, or guest OS update is set to active by default unless specified otherwise. default: true additionalProperties: false description: Input to template complete guest OS update. vmm.v4.2.content.CompleteGuestUpdateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/complete-guest-update\ \ Post operation" vmm.v4.2.content.CancelGuestUpdateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/cancel-guest-update\ \ Post operation" vmm.v4.2.content.TemplatePublishSpec: required: - versionId type: object properties: versionId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: | The active version of a template. The active version is the default version for creating VMs from the template or during guest OS updates. example: 822eb01d-d862-403c-8e50-a9db13a2abc3 additionalProperties: false vmm.v4.2.content.PublishTemplateApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/content/templates/{extId}/$actions/publish\ \ Post operation" vmm.v4.2.images.config.ListPlacementPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Get operation vmm.v4.2.images.config.PlacementPolicy: allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: Image placement policy. required: - clusterEntityFilter - imageEntityFilter - name - placementType type: object properties: name: maxLength: 256 minLength: 1 type: string description: Name of the image placement policy. example: Linux images placement policy description: maxLength: 1000 type: string description: Description of the image placement policy. example: Distribute linux images to data centers placementType: $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementType' imageEntityFilter: $ref: '#/components/schemas/vmm.v4.2.images.config.Filter' clusterEntityFilter: $ref: '#/components/schemas/vmm.v4.2.images.config.Filter' enforcementState: $ref: '#/components/schemas/vmm.v4.2.images.config.EnforcementState' createTime: type: string description: Image placement policy creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 lastUpdateTime: type: string description: Last updated time of an image placement policy. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 ownerExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the owner of the image placement policy. readOnly: true example: 7c36c05b-7f87-4474-b554-71b2f53c8713 ownerName: type: string description: Name of the owner of the image placement policy. readOnly: true example: string additionalProperties: false description: Image placement policy model. vmm.v4.2.images.config.CreatePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies Post operation vmm.v4.2.images.config.PlacementType: type: string description: Type of the image placement policy. enum: - SOFT - HARD - $UNKNOWN - $REDACTED x-enumDescriptions: HARD: | Hard placement policy. Images can only be placed on clusters enforced by the image placement policy. SOFT: | Soft placement policy. Images can be placed on clusters apart from those enforced by the image placement policy. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.images.config.Filter: title: Category-based entity filter. required: - categoryExtIds - type type: object properties: type: $ref: '#/components/schemas/vmm.v4.2.images.config.FilterMatchType' categoryExtIds: maxItems: 100 minItems: 1 type: array description: Filter matches entities that have these categories attached. items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 0051cc55-ff76-4e94-90e7-17267cba2751 additionalProperties: false description: Category-based entity filter. vmm.v4.2.images.config.EnforcementState: type: string description: Enforcement status of the image placement policy. enum: - ACTIVE - SUSPENDED - $UNKNOWN - $REDACTED x-enumDescriptions: ACTIVE: The image placement policy is being actively enforced. SUSPENDED: The policy enforcement for image placement is suspended. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.images.config.FilterMatchType: type: string description: Filter matching type. enum: - CATEGORIES_MATCH_ALL - CATEGORIES_MATCH_ANY - $UNKNOWN - $REDACTED x-enumDescriptions: CATEGORIES_MATCH_ALL: Image policy only applies to the entities that are matched to all the corresponding entity categories attached to the image policy. CATEGORIES_MATCH_ANY: Image policy applies to the entities that match any subset of the entity categories attached to the image policy. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. vmm.v4.2.images.config.GetPlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.images.config.PlacementPolicy oneOf: - $ref: '#/components/schemas/vmm.v4.2.images.config.PlacementPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Get operation" vmm.v4.2.images.config.UpdatePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Put operation" vmm.v4.2.images.config.DeletePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}\ \ Delete operation" vmm.v4.2.images.config.SuspendPlacementPolicyConfig: type: object properties: shouldCancelRunningTasks: type: boolean description: Boolean to indicate whether tasks running to enforce the image placement policy should be suspended. default: false additionalProperties: false description: | Indicates whether the tasks running to enforce policy should be cancelled. These would be tasks to transfer and/or remove images to/from the cluster(s). vmm.v4.2.images.config.SuspendPlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/suspend\ \ Post operation" vmm.v4.2.images.config.ResumePlacementPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/placement-policies/{extId}/$actions/resume\ \ Post operation" vmm.v4.2.images.config.ListRateLimitPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.images.config.RateLimitPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Get operation vmm.v4.2.images.config.RateLimitPolicy: allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: Image rate limit policy specification. required: - clusterEntityFilter - name - rateLimitKbps type: object properties: name: maxLength: 256 minLength: 1 type: string description: Name of the image rate limit policy. example: Data center rate limit policy description: maxLength: 1000 type: string description: Image rate limit policy specification. example: Bandwidth throttling for image operations rateLimitKbps: maximum: 4294967296 minimum: 1 type: integer description: Network bandwidth in KBps that the rate limited image operation can utilize. format: int64 example: 60 clusterEntityFilter: $ref: '#/components/schemas/vmm.v4.2.images.config.Filter' createTime: type: string description: Image rate limit policy creation time. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 lastUpdateTime: type: string description: Last updated time of an image rate limit policy. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 ownerExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: External identifier of the owner of the rate limit policy. readOnly: true example: 32dc95f0-df80-4a66-bc5f-c4380e0351ec ownerName: type: string description: Name of the owner of the rate limit policy. readOnly: true example: string matchingClusterExtIds: maxItems: 200 minItems: 0 type: array description: External identifier of the Prism Elements where a rate limit is the effective rate limit policy. readOnly: true items: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string example: 86cee785-5887-4c71-8286-2b71a3ef440c additionalProperties: false description: Image rate limit policy specification. vmm.v4.2.images.config.CreateRateLimitPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies Post operation vmm.v4.2.images.config.GetRateLimitPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: vmm.v4.images.config.RateLimitPolicy oneOf: - $ref: '#/components/schemas/vmm.v4.2.images.config.RateLimitPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Get operation" vmm.v4.2.images.config.UpdateRateLimitPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Put operation" vmm.v4.2.images.config.DeleteRateLimitPolicyApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: required: - $objectType properties: $objectType: type: string example: prism.v4.config.TaskReference oneOf: - $ref: '#/components/schemas/prism.v4.3.config.TaskReference' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: "REST response for all response codes in API path /vmm/v4.2/images/config/rate-limit-policies/{extId}\ \ Delete operation" vmm.v4.2.images.config.ListEffectiveRateLimitPoliciesApiResponse: type: object properties: metadata: $ref: '#/components/schemas/common.v1.0.response.ApiResponseMetadata' data: oneOf: - type: array items: $ref: '#/components/schemas/vmm.v4.2.images.config.EffectiveRateLimitPolicy' - $ref: '#/components/schemas/vmm.v4.2.error.ErrorResponse' additionalProperties: false description: REST response for all response codes in API path /vmm/v4.2/images/config/effective-rate-limit-policies Get operation vmm.v4.2.images.config.EffectiveRateLimitPolicy: allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - title: Effective rate limit for a cluster. required: - clusterExtId - rateLimitExtId type: object properties: clusterExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Cluster external identifier. example: 3498f2c3-7b0d-4851-8b35-6d8ffe64f1c6 rateLimitExtId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: The external identifier of image rate limit policy. example: a7ba3fe5-b1d2-4a9e-b4cd-56adcdc7d77f additionalProperties: false description: The enforced rate limit on the cluster when multiple image rate limit policies apply. iam.v4.1.b2.authn.User: required: - userType - username description: Information of the user. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - type: object properties: username: maxLength: 255 minLength: 1 pattern: "^[^<>;'()&+%\\/\\\\\"`]*$" type: string description: Identifier of the user. example: john_doe userType: $ref: '#/components/schemas/iam.v4.1.b2.authn.UserType' idpId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Identifier of the IDP for the user. example: 689ca672-0a03-4054-8a11-c26d15579085 displayName: maxLength: 255 minLength: 1 pattern: "^[^<>;'()&+%\\/\\\\\"`]*$" type: string description: "Display name of the user. For LDAP and SAML users, this\ \ is set from AD config." example: john jane doe firstName: maxLength: 255 minLength: 1 pattern: "^[^<>;'()&+%\\/\\\\\"`]*$" type: string description: First name of the user. example: john middleInitial: maxLength: 255 minLength: 1 pattern: "^[^<>;'()&+%\\/\\\\\"`]*$" type: string description: Middle name of the user. example: jane lastName: maxLength: 255 minLength: 1 pattern: "^[^<>;'()&+%\\/\\\\\"`]*$" type: string description: Last name of the user. example: doe emailId: maxLength: 255 pattern: "^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$" type: string description: Email ID of the user. example: john.doe@example.com locale: type: string description: Default locale of the user. example: en-US region: type: string description: Default region of the user. example: en-US password: type: string description: Password of the user. writeOnly: true example: string isForceResetPasswordEnabled: type: boolean description: Flag to force the user to reset password. example: true additionalAttributes: maxItems: 10 minItems: 0 type: array description: Indicates additional attributes of the user. items: $ref: '#/components/schemas/common.v1.0.config.KVPair' status: $ref: '#/components/schemas/iam.v4.1.b2.authn.UserStatusType' bucketsAccessKeys: maxItems: 5 minItems: 0 type: array description: Bucket access keys for the user. readOnly: true items: $ref: '#/components/schemas/iam.v4.1.b2.authn.BucketsAccessKey' lastLoginTime: type: string description: The last successful login time for the user. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdTime: type: string description: Creation time of the user. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 lastUpdatedTime: type: string description: The last updated time for the user. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 createdBy: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: User or Service who created the user. readOnly: true example: 3e3ea271-6870-49c8-8560-ab66593bde7c lastUpdatedBy: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Last updated by this user ID. readOnly: true example: 0d7331f8-6642-455d-88de-54fc58252508 description: type: string description: Description of the user. readOnly: false example: IT user creationType: $ref: '#/components/schemas/iam.v4.1.b2.authn.CreationType' additionalProperties: false iam.v4.1.b2.authn.UserType: type: string description: "User type like SAML user or local user, and so on." enum: - LOCAL - SAML - LDAP - EXTERNAL - SERVICE_ACCOUNT - $UNKNOWN - $REDACTED x-enumDescriptions: SERVICE_ACCOUNT: "User stored locally in IAM and is used by customer applications,\ \ scripts and internal services." LDAP: User belonging to a directory service (OpenLDAP/AD). EXTERNAL: User not stored locally nor belonging to any IDP or directory service. LOCAL: User stored locally in IAM. SAML: User belonging to a SAML IDP. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. iam.v4.1.b2.authn.UserStatusType: type: string description: Status of the user. enum: - ACTIVE - INACTIVE - $UNKNOWN - $REDACTED x-enumDescriptions: ACTIVE: Denotes that the local user is active. INACTIVE: Denotes that the local user is inactive and needs to be reactivated. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. iam.v4.1.b2.authn.BucketsAccessKey: description: Information of bucket access key. allOf: - $ref: '#/components/schemas/common.v1.0.response.ExternalizableAbstractModel' - required: - accessKeyName type: object properties: accessKeyName: maxLength: 255 minLength: 1 pattern: "^[^<>;'()&+%\\/\\\\\"`]*$" type: string description: Name of the bucket access key. example: key1 secretAccessKey: type: string description: "This represents secret access key, which will be returned\ \ only during access key creation." readOnly: true example: string userId: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: User identifier who owns the bucket access key. readOnly: true example: 5ae65809-a410-40e1-8215-f09f4c059f06 createdTime: type: string description: Creation time for the bucket access key. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 lastUpdatedBy: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Entity that updated the buckets access key. readOnly: true example: 15d22646-7fb3-4845-9bb0-2bf9186d1c6a assignedTo: maxLength: 255 minLength: 3 type: string description: External client to whom this key is allocated. example: user2 creationType: $ref: '#/components/schemas/iam.v4.1.b2.authn.CreationType' expiryTime: type: string description: The expiry time of the buckets access Key. format: date-time example: 2009-09-23T14:30:00-07:00 status: $ref: '#/components/schemas/iam.v4.1.b2.authn.BucketsAccessKeyStatusType' createdBy: pattern: "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" type: string description: Service account user who created the buckets access key. readOnly: true example: ac9e8849-7f1c-475a-9622-bc2c7998dc1d lastUpdatedTime: type: string description: Creation time for the bucket access key. format: date-time readOnly: true example: 2009-09-23T14:30:00-07:00 additionalProperties: false iam.v4.1.b2.authn.CreationType: type: string description: The creation mechanism of this entity. enum: - PREDEFINED - USERDEFINED - SERVICEDEFINED - $UNKNOWN - $REDACTED x-enumDescriptions: PREDEFINED: Predefined creator workflow type is for entity created by the system. SERVICEDEFINED: Servicedefined creator workflow type is for entity created by the service. USERDEFINED: Userdefined creator workflow type is for entity created by the users. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. iam.v4.1.b2.authn.BucketsAccessKeyStatusType: type: string description: "The status of the buckets access key, that is, valid, expired\ \ or revoked." enum: - VALID - REVOKED - EXPIRED - $UNKNOWN - $REDACTED x-enumDescriptions: REVOKED: Buckets access key is revoked. VALID: Buckets access key is valid. EXPIRED: Buckets access key is expired. $UNKNOWN: | Unknown value. $REDACTED: | Redacted value. securitySchemes: basicAuthScheme: type: http scheme: basic apiKeyAuthScheme: type: apiKey name: X-ntnx-api-key in: header