CIM Tutorial > CIM > Overview > Meta Schema > Method

CIM Meta Schema - Method

A method is an operation that can be invoked . Methods are scoped by the class that owns the method and must be unique within the class. A class can have zero or more methods.

A method signature includes a name, return type, optional input parameters and optional output parameters.

The method return type must be one of the CIM supported data types.  Return types must not be arrays.

A method parameter must be one of the CIM supported data types, fixed or variable length array of one of those types, or an object reference. A parameter can be an input parameter, an output parameter or both. The type of parameter is specified using the IN or OUT qualifier

Examples

[Description (
    "The StartService method places the Service in the started "
    "state. Note that this method's function overlaps with the "
    "RequestedStatus property. RequestedStatus was added to "
    "the model to maintain a record (i.e., a persisted value) "
    "of the last status request. Invoking the StartService "
    "method should set the RequestedStatus property appropriately."
    " The method returns an integer value of 0 if the Service was "
    "successfully started, 1 if the request is not supported and "
    "any other number to indicate an error. In a subclass, the "
    "set of possible return codes could be specified, using a "
    "ValueMap qualifier on the method. The strings to which the "
    "ValueMap contents are 'translated' may also be specified in "
    "the subclass as a Values array qualifier.") ]
uint32 StartService();
[Description (
    "AddNode brings a new ComputerSystem into a Cluster. "
    "The node to be added is specified as a parameter to the "
    "method. The return value should be 0 if the Computer"
    "System is successfully added, 1 if the method is not "
    "supported and any other number if an error occurred. "
    "In a subclass, the set of possible return codes could be "
    "specified, using a ValueMap qualifier on the method. The "
    "strings to which the ValueMap contents are 'translated' "
    "may also be specified in the subclass as a Values array "
    "qualifier.") ]
uint32 AddNode ([IN] CIM_ComputerSystem ref CS);