Alarm Manager Create Alarm

Alarm Manager Create Alarm
Creates an alarm.

Creates an alarm.

In addition to the Alarm.Create privilege, may also require the Global.ScriptAction if a RunScriptAction action is specified in the AlarmSpec.

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/AlarmManager/{moId}/CreateAlarm
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case AlarmManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 9.1.0.0 APIs.


Request Body
CreateAlarmRequestType of type(s) application/json
Required

Show optional properties

{
    "entity": {},
    "spec": {}
}
{
    "entity": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "spec": {
        "_typeName": "string",
        "name": "string",
        "systemName": "string",
        "description": "string",
        "enabled": false,
        "expression": {
            "_typeName": "string"
        },
        "action": {
            "_typeName": "string"
        },
        "actionFrequency": 0,
        "setting": {
            "_typeName": "string",
            "toleranceRange": 0,
            "reportingFrequency": 0
        }
    }
}
entity
Required

The entity with which the alarm is associated.

Required privileges: Alarm.Create

spec
Required

The specification for the new alarm.

Authentication
This operation uses the following authentication methods.
Responses
200

A reference to the Alarm object created by the operation.

Returns MoRefAlarm of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

InvalidName: if the alarm name is empty or too long.

DuplicateName: if an alarm with the name already exists.

InvalidArgument: if the specification is invalid.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": {
        "_typeName": "string",
        "faultCause": "MethodFault Object",
        "faultMessage": [
            {
                "_typeName": "string",
                "key": "string",
                "arg": [
                    {
                        "_typeName": "string",
                        "key": "string",
                        "value": {
                            "_typeName": "string"
                        }
                    }
                ],
                "message": "string"
            }
        ]
    },
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"entity":"{}","spec":"{}"}' https://{api_host}/sdk/vim25/{release}/AlarmManager/{moId}/CreateAlarm