VMware {code} Community
Ernesto_Camilo
Contributor
Contributor
Jump to solution

Error creating acq-specs in VStats API VSphere

Good afternoon 

I'm trying to create a acq-specs with this configuration but I've got this error:

Invalid Resource: a valid Resource Address must contain one of (Host,VM,DVS) Resource ID with EQUAL Query-Predicate

{
    "counters": {
        "cid_mid": {
            "cid": "cpu.usage.PCPU"
        }
    },
    "expiration": 0,
    "interval": 30,
    "memo_": "Create acq Specs Test",
    "resources": [
        {
            "id_value": "datacenter-1001",
            "predicate": "ALL",
            "type": "PCPU"
        }
    ]
}



0 Kudos
1 Solution

Accepted Solutions
doskiran
Enthusiast
Enthusiast
Jump to solution

Try with this spec:


POST: https://{{vc}}/api/stats/acq-specs

 

{
    "counters": {
        "cid_mid": {
            "cid": "cpu.usage.PCPU"
        }
    },
    "expiration": 0,
    "interval": 30,
    "memo_": "Create acq Specs Test",
    "resources": [
        {
            "id_value": "*",
            "predicate": "EQUAL",
            "type": "HOST"
        }
    ]
}

 

 
Response- eg:
------------
"110"

View solution in original post

2 Replies
doskiran
Enthusiast
Enthusiast
Jump to solution

Try with this spec:


POST: https://{{vc}}/api/stats/acq-specs

 

{
    "counters": {
        "cid_mid": {
            "cid": "cpu.usage.PCPU"
        }
    },
    "expiration": 0,
    "interval": 30,
    "memo_": "Create acq Specs Test",
    "resources": [
        {
            "id_value": "*",
            "predicate": "EQUAL",
            "type": "HOST"
        }
    ]
}

 

 
Response- eg:
------------
"110"
Ernesto_Camilo
Contributor
Contributor
Jump to solution

There is any way to manage alerts in vSphere through some API?

Thanks for you answer. It worked for me

0 Kudos