Sm_PolicyApi_AddToGroup()

Adds an item to the group identified by pszGroupOid.
sm1252sp1
Adds an item to the group identified by
pszGroupOid
.
The item (which may be a group) and the group must exist and must be of the same type.
The
pszDomainOid
parameter is required by a rule group or response group. An agent group does not require a domain OID because it is not a domain-based object.
Type
Group function, global scope (agents) or domain scope (responses, rules).
Syntax
int SM_EXTERN Sm_PolicyApi_AddToGroup (
void*pSessionHandle,
Sm_PolicyApi_Groups_tdwGroup,
const char*pszItemOid,
const char*pszGroupOid,
const char*pszDomainOid
);
Parameter
I/O
Description
pSessionHandle
I
A pointer to an internal Policy Management API data structure. The structure holds information about the administrator session and the client session.
dwGroup
I
The type of group.
pszItemOid
I
A null-terminated string containing the object identifier of an existing item of the same type as the group.
pszGroupOid
I
A null-terminated string containing the object identifier of a group of the type indicated by
dwGroup
.
pszDomainOid
I
A null-terminated string containing the object identifier of an existing domain. Required for rule and response objects.
Returns
  • Sm_PolicyApi_Success. The add was successful.
  • Sm_PolicyApi_Failure. The add was not successful.
  • Sm_PolicyApi_InvalidHandle. There was no valid initialization prior to this call.
  • Sm_PolicyApi_NoSession. There is no valid administrator session.
  • Sm_PolicyApi_NoPrivilege. The administrator does not have the privilege to add a rule, response, or agent OID to its respective group.
  • Sm_PolicyApi_InvalidOid:
    • The domain OID was not found (for a domain-based group).
    • The group OID was not found.
    • The rule, response, or agent OID or group OID was not found.
  • Sm_PolicyApi_BadGroup. Parameter
    dwGroup
    is not the rule, response, or agent type.