Start a Conversation

Unsolved

This post is more than 5 years old

1664

August 15th, 2016 05:00

Can XMCLI commands like 'show-reports' output be accessed via REST?

Found a the following command 'show-report report-id=9' that displays all the CPU utilization for all storage controllers. Currently creating a report via REST, but walking the tree of JSON for each storage controller to view this information takes a lot of requests accessing this output with 1 rest call would simplify the process. If this is possible what is the syntax of the JSON string (i.e. something like.. https://xmsserver/api/json/v2/types/???? The output of the command at cli looks close to a JSON format - wondering if its truly available via REST. Example of xmcli below:


xmcli (narn1)> show-report report-id=9                                                                                                                              

Name:                                                                                                                                                               

Index: 9                                                                                                                                                            

Title: Xenv Utilization                                                                                                                                             

Entity: XEnv                                                                                                                                                        

Category: Resources                                                                                                                                                 

Object-List: [['f95b12cc967e4edab64cc66776369b1a', 'X3-SC2-E1', 11], ['4997608e91d04bc6bbeddd5979bb5c50', 'X3-SC1-E2', 10], ['1fa7b4687c3640f3a125c362bc05a769', 'X4-

SC1-E1', 13], ['e2f7c9c26fb64774bf481c7d9e587d17', 'X3-SC2-E2', 12], ['80657da01aa84044835963635a03d1da', 'X4-SC2-E1', 15], ['d25c68a0769643d784baee7c00fb60dd', 'X4-

SC1-E2', 14], ['8336c12243f5498e8e1b593b71c03356', 'X4-SC2-E2', 16], ['da4150bf7e9b4e5a9db7d16aa0599e0b', 'X1-SC1-E1', 1], ['4a59b640566c4e128aea44651d4026b6', 'X1-S

C2-E1', 3], ['ae570cbb09714fe280ed74d3c323289f', 'X1-SC1-E2', 2], ['1ddda2f0580640c2884c5d4d5c78adb8', 'X2-SC1-E1', 5], ['8e2e53c67016425cb817be6f35132979', 'X1-SC2-

E2', 4], ['71fbdfe5caef41bab88634f156e0b08b', 'X2-SC2-E1', 7], ['974fd8927794449bb3a5c33b36f209ce', 'X2-SC1-E2', 6], ['5f8597873cf3434f844ac9dc58224cbb', 'X3-SC1-E1'

, 9], ['1cd6265805c3476ba250d696fe114aa8', 'X2-SC2-E2', 8], ['af781041350d4bfda103e6349f31e23f', 'X3-SC2-E1', 11], ['2f90e3b895284162ac6afafa03a1ebb1', 'X3-SC1-E2',

10], ['1b089a31516841fd918529e3182a8c16', 'X4-SC1-E1', 13], ['a28d45761b674196a663b5dd193df73b', 'X3-SC2-E2', 12], ['af8821da6ed749d6be217b64fe190219', 'X4-SC2-E1',

15], ['891cdb044bd349f0bc15c7b243e00016', 'X4-SC1-E2', 14], ['ca3b7aa7bc3c45eb973dcc006dd88311', 'X4-SC2-E2', 16], ['c4743444a626434c8ac380a74e6dfee8', 'X1-SC1-E1',

1], ['9463c1397b1845c0829f8ef7065d94ce', 'X1-SC2-E1', 3], ['ad7077fe34894d7ab815a935a62870a3', 'X1-SC1-E2', 2], ['b08b7f996e8542d6a5f2c4185e80241a', 'X2-SC1-E1', 5],

['28e62702964c4a259cf6f82858c54c14', 'X1-SC2-E2', 4], ['a0911b417c4845b7bc7e41358aa004fa', 'X2-SC2-E1', 7], ['51ff73d1f4dc42f989ac5fddf3ad80f3', 'X2-SC1-E2', 6], ['

2f1ab169a6de4ea09a2a52772a117269', 'X3-SC1-E1', 9], ['cb4972f0016b48f8ac835b49b4ab42bc', 'X2-SC2-E2', 8]]                                                           

Property-List: ['cpu_usage']                                                                                                                                        

Source-Definition: predefined                                                                                                                                       

View-Type: bar                                                                                                                                                      

Public: True                                                                   

64 Posts

August 15th, 2016 15:00

The equivalent interface to get "Reports" data from the REST API is the "performance" object.

Unlike the GUI/CLI where you create a report and then run it to get the data (like you've done above - although that's probably one of the pre-configured reports), from the REST API you just get raw access to whatever data you request - both real time and historic.

For example, if you want to get the CPU utilization (aka "XEnv" utilization in XtremIO-speak) for the past hour, in one minute granualarity, then you'd use :

https://xms.example.com/api/json/v2/types/performance?entity=XEnv&time-frame=last_hour&granularity=one_minute

This would give you 60 timepoints, each with one entry for each of the XEnv's (ie, 4 for a single brick, 8 for a dual brick, etc).  Each of these will looks like :

        [

            1471297740000,

            "43f43133972d4a30b7e26d9a70f047dc",

            "X2-SC1-E2",

            6,

            25.5

        ],

which if you scroll to the bottom of the results you'll get the details of what each one is :

    "members": [

        "timestamp",

        "guid",

        "name",

        "index",

        "avg__cpu_usage"

    ],

timestamp is in "epoch" time in microseconds. guid is just an internal unique identifier for that X-Env. name is the friendly name of the XEnv. Index is an internal index number. avg__cpu_usage is the one you're interested in, which is the average utilization over the 1 minute period being reported on.

If you want to know the utilization "right now" then you can pass a "time-frame" option of "real-time", but be aware that you'll occasionally get back an empty result for this if you hit it right as it's updating the data - the better option if you absolutely need live data is to query each of the XEnv objects (/api/json/v2/types/xenvs/X), but as you've said that needs a number of calls to achieve it.

No Events found!

Top