Creates new session variables or updates existing session variables.
Syntax
int Sm_AgentApi_SetSessionVariables ( const void* pHandle, const Sm_AgentApi_ResourceContext_t* pResourceContext, const char* lpszSessionId, long nNumReqAttributes, Sm_AgentApi_Attribute_t* pReqAttributes, long* pRespNumAttributes, Sm_AgentApi_Attribute_t** ppRespAttributes );
Parameter |
I/O |
Description |
---|---|---|
pHandle |
I |
Agent API session handle returned in parameter ppHandle of Sm_AgentApi_Init(). |
pResourceContext |
I |
Reserved for future use. Set all fields to 0. |
lpszSessionId |
I |
A unique identifier of the session for which the variable is to be set. Variables can only be set for an active session. After a successful login, the session ID is returned in the lpszSessionId field of the structure Sm_AgentApi_Session_t. |
nNumReqAttributes |
I |
Size of the array of session variables in pReqAttributes. |
pReqAttributes |
I |
An array of attributes representing session variable values. Set the variable name in the field lpszAttributeOid of structure Sm_AgentApi_Attribute_t:
Set the nAttributeFlags field of the Sm_AgentApi_Attribute_t structure to SM_AGENTAPI_REQATTR_FLAGS_NONE. The structure's nAttributeId and nAttributeTTL fields are ignored. |
pRespNumAttributes |
O |
Size of the array of responses in ppRespAttributes. |
ppRespAttributes |
O |
An array of response attributes representing variables that could not be set. If this function returns SM_AGENTAPI_UNRESOLVED, the response attribute result set will contain unresolved variables. Also, for each unresolved variable returned, the field nAttributeFlags of the structure Sm_AgentApi_Attribute_t will be set to SM_AGENTAPI_RESPATTR_UNRESOLVED. The structure's nAttributeId and nAttributeTTL fields are ignored. |
Returns
Remarks
This function fails if the session referenced by lpszSessionId is not active or the connection to the session store is lost.
To release the memory allocated for any unresolved variable values returned in the ppRespAttributes parameter, call Sm_AgentApi_FreeAttributes().
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |