시스템 조회 예제
이 예제에서 관리 클래스 조회에서는 특정 관리 클래스에 대한 백업 및 아카이브 사본 그룹에 있는 모든 필드의 값을 출력합니다.
dsInt16 rc;
qryMCData qMCData;
DataBlk qData;
qryRespMCDetailData qRespMCData, *mcResp;
char *mc, *s;
dsBool_t done = bFalse;
dsUint32_t qry_item;
/* Fill in the qMCData structure with the query criteria we want */
qMCData.stVersion = qryMCDataVersion; /* structure version */
qMCData.mcName = mc; /* management class name */
qMCData.mcDetail = bTrue; /* want full details? */
/* Set parameters of the data block used to get or send data */
qData.stVersion = DataBlkVersion;
qData.bufferLen = sizeof(qryRespMCDetailData);
qData.bufferPtr = (char *)&qRespMCData;
qRespMCData.stVersion = qryRespMCDetailDataVersion;
if ((rc = dsmBeginQuery(dsmHandle,qtMC,(dsmQueryBuff *)&qMCData)))
{
printf("*** dsmBeginQuery failed: ");
rcApiOut(dsmHandle, rc);
rc = (RC_SESSION_FAILED);
}
else
{
done = bFalse;
qry_item = 0;
while (!done)
{
rc = dsmGetNextQObj(dsmHandle,&qData);
if (( (rc == DSM_RC_MORE_DATA)
|| (rc == DSM_RC_FINISHED))
&& qData.numBytes)
{
qry_item++;
mcResp = (qryRespMCDetailData *)qData.bufferPtr;
printf("Mgmt. Class
printf(" Name:
printf(" Backup CG Name:
.
. /* other fields of backup and archive copy groups */
.
printf(" Copy Destination:
}
else
{
done = bTrue;
if (rc != DSM_RC_FINISHED)
{
printf("*** dsmGetNextQObj failed: ");
rcApiOut(dsmHandle, rc);
}
}
if (rc == DSM_RC_FINISHED) done = bTrue;
}
rc = dsmendQuery (dsmHandle);
}