Get efficiency state for VMs using API | Nutanix Community
Skip to main content
Solved

Get efficiency state for VMs using API

  • April 18, 2024
  • 2 replies
  • 176 views

Ahmed_Elyacoubi

Is there a way to fetch the efficiency state for VMs (Bully, Over Provisioned, Constrained, Inactive VM, Good) using API requests?"

Best answer by Ahmed_Elyacoubi

this works:

get https://pc_ip:9440/api/nutanix/v3/groups

body: 

{

    "entity_type": "mh_vm",

    "query_name": "eb:data:Efficiency-1713467304436",

    "grouping_attribute": " ",

    "group_count": 3,

    "group_offset": 0,

    "group_member_count": 120,

    "group_member_sort_attribute": "vm_name",

    "group_member_sort_order": "ASCENDING",

    "group_member_attributes": [

        {

            "attribute": "vm_name"

        },

        {

            "attribute": "capacity.vm_efficiency_status"

        }

    ],

 

    "filter_criteria": "(platform_type!=aws,platform_type==[no_val]);is_cvm==0;feature_name==VM_INEFFICIENCY_DETECTION"

}

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

2 replies

Forum|alt.badge.img+3
  • Trendsetter
  • 42 replies
  • April 19, 2024

Hi

Didn’t find anything, the closest information we could retrieve is using this API call https://www.nutanix.dev/api_reference/apis/prism_v3.html#tag/vms/paths/~1vms~1list/post


Ahmed_Elyacoubi

this works:

get https://pc_ip:9440/api/nutanix/v3/groups

body: 

{

    "entity_type": "mh_vm",

    "query_name": "eb:data:Efficiency-1713467304436",

    "grouping_attribute": " ",

    "group_count": 3,

    "group_offset": 0,

    "group_member_count": 120,

    "group_member_sort_attribute": "vm_name",

    "group_member_sort_order": "ASCENDING",

    "group_member_attributes": [

        {

            "attribute": "vm_name"

        },

        {

            "attribute": "capacity.vm_efficiency_status"

        }

    ],

 

    "filter_criteria": "(platform_type!=aws,platform_type==[no_val]);is_cvm==0;feature_name==VM_INEFFICIENCY_DETECTION"

}