EN
ADIC logo
Official user manual

ADIC 601355 Rev A

1192 pages·5.7 MB·Digital Camera·PDF·ENDEFRITNLJA
ADIC 601355 Rev A
Table of Contents 1306 sections Preface · Purpose of This Book · Who Should Read This Book · How This Book is Organized · … ShowHide
Prefacep.13Purpose of This Bookp.15Who Should Read This Bookp.15How This Book is Organizedp.15Conventionsp.16Booksp.17Online Booksp.17Related Publicationsp.18Contact Publications Departmentp.18Secured Web Sitep.18Getting Startedp.19API Directory Structurep.21Application Program Interfacep.23Extensiblep.23Consistentp.23Portablep.23Flexiblep.23Client Interface Summaryp.25Unsolicited Communicationp.27VolServ API Integrationp.28API Typesp.30Objectsp.30Handlesp.30Naming Conventionsp.33Dispatch Routinesp.37Global Parametersp.38Global Variablesp.39API Error Handlingp.40Using the APIp.42Command Handlep.42Command Callsp.42Command Defaultsp.43Command Statusp.44Processingp.46Asynchronousp.46Synchronousp.47API Functionsp.48API Functionsp.51VS_Archive_Createp.58Synopsisp.58Argumentsp.58Return Valuesp.58Examplep.58See Alsop.60VS_Archive_ Destroyp.61Synopsisp.61Argumentsp.61Return Valuesp.61Examplep.61Notesp.63See Alsop.64VS_Archive_ GetFieldsp.65Synopsisp.65Argumentsp.65Parametersp.65Return Valuesp.68Examplep.69Notesp.73See Alsop.74VS_Archive_ SetFieldsp.75Synopsisp.75Argumentsp.75Parametersp.75Return Valuesp.77Examplep.77Notesp.79See Alsop.81VS_Archive MediaClass_ Createp.82Synopsisp.82Argumentsp.82Return Valuesp.82Examplep.82Notesp.85See Alsop.85VS_Archive MediaClass_ Destroyp.86Synopsisp.86Argumentsp.86Return Valuesp.86Examplep.86Notesp.89See Alsop.90VS_Archive MediaClass_ GetFieldsp.91Synopsisp.91Argumentsp.91Parametersp.91Return Valuesp.93Examplep.94Notesp.97See Alsop.98VS_Archive MediaClass_ SetFieldsp.99Synopsisp.99Argumentsp.99Parametersp.100Return Valuesp.102Examplep.103Notesp.106See Alsop.107VS_ Command_ Createp.108Synopsisp.108Argumentsp.108Return Valuesp.108Examplep.108Notesp.110See Alsop.110VS_ Command_ Destroyp.111Synopsisp.111Argumentsp.111Return Valuesp.111Examplep.112Notesp.113See Alsop.114VS_ Command_ GetErrorFieldsp.115Synopsisp.115Argumentsp.115Parametersp.115Return Valuesp.116Notesp.116See Alsop.117VS_ Command_ GetFieldsp.118Synopsisp.118Argumentsp.118Parametersp.118Return Valuesp.119Examplep.119Notesp.121See Alsop.121VS_ Command_ GetStatusFieldsp.122Synopsisp.122Argumentsp.122Parametersp.123Return Valuesp.130Notesp.131See Alsop.131VS_ Command_ SetFieldsp.132Synopsisp.132Argumentsp.132Parametersp.133Return Valuesp.133Examplep.134Notesp.135See Alsop.135VS_ Component_ Createp.137Synopsisp.137Argumentsp.137Return Valuesp.137Examplep.137Notesp.141See Alsop.142VS_ Component_ Destroyp.143Synopsisp.143Argumentsp.143Return Valuesp.143Examplep.143Notesp.145See Alsop.145VS_ Component_ GetFieldsp.146Synopsisp.146Argumentsp.146Parametersp.146Return Valuesp.147Examplep.147Notesp.148See Alsop.148VS_ Component_ SetFieldsp.150Synopsisp.150Argumentsp.150Parametersp.150Return Valuesp.151Examplep.151Notesp.156See Alsop.156VS_Connect_ Createp.157Synopsisp.157Argumentsp.157Return Valuesp.157Examplep.157Notesp.159See Alsop.159VS_Connect_ Destroyp.160Synopsisp.160Argumentsp.160Return Valuesp.160Examplep.160Notesp.162See Alsop.162VS_Connect_ GetFieldsp.164Synopsisp.164Argumentsp.164Parametersp.164Return Valuesp.165Examplep.165Notesp.167See Alsop.167VS_Connect_ SetFieldsp.168Synopsisp.168Argumentsp.168Parametersp.168Return Valuesp.169Examplep.169Notesp.172See Alsop.172VS_Criteria_ Createp.173Synopsisp.173Argumentsp.173Return Valuesp.173Examplep.174Notesp.178See Alsop.178VS_Criteria_ Destroyp.179Synopsisp.179Argumentsp.179Return Valuesp.179Examplep.179Notesp.185See Alsop.185VS_Criteria_ GetFieldsp.186Synopsisp.186Argumentsp.186Parametersp.186Return Valuesp.187Examplep.187Notesp.190See Alsop.190VS_Criteria_ SetFieldsp.192Synopsisp.192Argumentsp.192Parametersp.192Return Valuesp.193Examplep.193Notesp.198See Alsop.198VS_ CriteriaGroup _Createp.199Synopsisp.199Argumentsp.199Return Valuesp.199Examplep.199Notesp.204See Alsop.204VS_ CriteriaGroup _Destroyp.205Synopsisp.205Argumentsp.205Return Valuesp.205Examplep.205Notesp.210See Alsop.210VS_ CriteriaGroup _GetFieldsp.211Synopsisp.211Argumentsp.211Parametersp.211Return Valuesp.211Examplep.212Notesp.215See Alsop.215VS_ CriteriaGroup _SetFieldsp.216Synopsisp.216Argumentsp.216Parametersp.216Return Valuesp.217Examplep.217Notesp.222See Alsop.222VS_Drive_ Createp.223Synopsisp.223Argumentsp.223Return Valuesp.223Examplep.223Notesp.225See Alsop.226VS_Drive_ Destroyp.227Synopsisp.227Argumentsp.227Return Valuesp.227Examplep.227Notesp.230See Alsop.230VS_Drive_Get Fieldsp.231Synopsisp.231Argumentsp.231Parametersp.231Return Valuesp.232Examplep.233Notesp.236See Alsop.236VS_Drive_Set Fieldsp.237Synopsisp.237Argumentsp.237Parametersp.237Return Valuesp.238Examplep.239Notesp.241See Alsop.242VS_DrivePool _Createp.243Synopsisp.243Argumentsp.243Return Valuesp.243Examplep.243Notesp.244See Alsop.245VS_DrivePool _Destroyp.246Synopsisp.246Argumentsp.246Return Valuesp.246Examplep.246Notesp.248See Alsop.248VS_DrivePool _GetFieldsp.249Synopsisp.249Argumentsp.249Parametersp.249Return Valuesp.250Examplep.251Notesp.252See Alsop.252VS_DrivePool _SetFieldsp.254Synopsisp.254Argumentsp.254Parametersp.254Return Valuesp.254Examplep.255Notesp.256See Alsop.257VS_Error_Get Fieldsp.258Synopsisp.258Argumentsp.258Parametersp.259Return Valuesp.259Examplep.259Notesp.261See Alsop.261VS_ Expression_ Createp.262Synopsisp.262Argumentsp.262Return Valuesp.262Examplep.262Notesp.267See Alsop.267VS_ Expression_ Destroyp.268Synopsisp.268Argumentsp.268Return Valuesp.268Examplep.268Notesp.274See Alsop.274VS_ Expression_ GetFieldsp.275Synopsisp.275Argumentsp.275Parametersp.275Return Valuesp.276Examplep.276Notesp.279See Alsop.279VS_ Expression_ SetFieldsp.281Synopsisp.281Argumentsp.281Parametersp.281Return Valuesp.282Examplep.282Notesp.287See Alsop.287VS_Global_ GetFieldsp.288Synopsisp.288Argumentsp.288Parametersp.289Return Valuesp.290Examplep.291Notesp.292See Alsop.292VS_Global_ SetFieldsp.293Synopsisp.293Argumentsp.293Parametersp.294Return Valuesp.295Examplep.296Notesp.297See Alsop.297VS_Initializep.299Synopsisp.299Argumentsp.299Return Valuesp.300Examplep.300Notesp.302See Alsop.302VS_Media_ Createp.303Synopsisp.303Argumentsp.303Return Valuesp.303Examplep.303Notesp.306See Alsop.306VS_Media_ Destroyp.307Synopsisp.307Argumentsp.307Return Valuesp.307Examplep.307Notesp.310See Alsop.310VS_Media_ GetFieldsp.311Synopsisp.311Argumentsp.311Parametersp.311Return Valuesp.313Examplep.313Notesp.316See Alsop.316VS_Media_ SetFieldsp.317Synopsisp.317Argumentsp.317Parametersp.317Return Valuesp.319Examplep.319Notesp.322See Alsop.322VS_ MediaClass_ Createp.323Synopsisp.323Argumentsp.323Return Valuesp.323Examplep.323Notesp.326See Alsop.327VS_ MediaClass_ Destroyp.328Synopsisp.328Argumentsp.328Return Valuesp.328Examplep.328Notesp.332See Alsop.332VS_ MediaClass_ GetFieldsp.333Synopsisp.333Argumentsp.333Parametersp.333Return Valuesp.336Examplep.336Notesp.340See Alsop.340VS_ MediaClass_ SetFieldsp.341Synopsisp.341Argumentsp.341Parametersp.341Return Valuesp.344Examplep.344Notesp.348See Alsop.348VS_ MediaType_ Createp.349Synopsisp.349Argumentsp.349Return Valuesp.349Examplep.349Notesp.351See Alsop.351VS_ MediaType_ Destroyp.352Synopsisp.352Argumentsp.352Return Valuesp.352Examplep.352Notesp.354See Alsop.354VS_ MediaType_ GetFieldsp.355Synopsisp.355Argumentsp.355Parametersp.355Return Valuesp.356Examplep.356Notesp.357See Alsop.358VS_ MediaType_ SetFieldsp.359Synopsisp.359Argumentsp.359Parametersp.359Return Valuesp.360Examplep.360Notesp.362See Alsop.362VS_Mount_ Createp.363Synopsisp.363Argumentsp.363Return Valuesp.363Examplep.363Notesp.366See Alsop.367VS_Mount_ Destroyp.368Synopsisp.368Argumentsp.368Return Valuesp.368Examplep.368Notesp.371See Alsop.371VS_ MediaClass_ GetFieldsp.372Synopsisp.372Argumentsp.372Parametersp.372Return Valuesp.374Examplep.374Notesp.379See Alsop.379VS_Mount_ SetFieldsp.380Synopsisp.380Argumentsp.380Parametersp.380Return Valuesp.382Examplep.383Notesp.386See Alsop.387VS_Notify_ Createp.388Synopsisp.388Argumentsp.388Return Valuesp.388Examplep.388Notesp.391See Alsop.392VS_Notify_ Destroyp.393Synopsisp.393Argumentsp.393Return Valuesp.393Examplep.393Notesp.397See Alsop.397VS_Notify_ GetFieldsp.398Synopsisp.398Argumentsp.398Parametersp.398Return Valuesp.400Examplep.401Notesp.404See Alsop.405VS_Notify_ Listenp.406Synopsisp.406Argumentsp.406Return Valuesp.406Examplep.407Notesp.410See Alsop.411VS_Notify_ SetFieldsp.412Synopsisp.412Argumentsp.412Parametersp.412Return Valuesp.413Examplep.414Notesp.417See Alsop.418VS_Request_ Createp.419Synopsisp.419Argumentsp.419Return Valuesp.419Examplep.419Notesp.421See Alsop.421VS_Request_ Destroyp.422Synopsisp.422Argumentsp.422Return Valuesp.422Examplep.422Notesp.424See Alsop.424VS_Request_ GetFieldsp.425Synopsisp.425Argumentsp.425Parametersp.425Return Valuesp.426Examplep.426Notesp.428See Alsop.428VS_Request_ SetFieldsp.429Synopsisp.429Argumentsp.429Parametersp.429Return Valuesp.430Examplep.431Notesp.432See Alsop.432VS_Selectp.433Synopsisp.433Argumentsp.433Return Valuesp.433Examplep.434Notesp.435See Alsop.435VS_Status_ GetFieldsp.436Synopsisp.436Argumentsp.436Parametersp.436Return Valuesp.444Examplep.444Notesp.447See Alsop.449VS_Table_ AddEntryp.450Synopsisp.450Argumentsp.450Return Valuesp.450Examplep.451Notesp.455See Alsop.456VS_Table_ Createp.457Synopsisp.457Argumentsp.457Return Valuesp.457Examplep.458Notesp.462See Alsop.463VS_Table_ CreateAddEntryp.464Synopsisp.464Argumentsp.464Return Valuesp.464Examplep.465Notesp.467See Alsop.467VS_Table_ Destroyp.468Synopsisp.468Argumentsp.468Return Valuesp.468Examplep.468Notesp.470See Alsop.471VS_Table_Get Fieldsp.472Synopsisp.472Argumentsp.472Parametersp.472Return Valuesp.473Examplep.473Notesp.475See Alsop.475VS_Table_ RemoveEntryp.476Synopsisp.476Argumentsp.476Return Valuesp.476Examplep.477Notesp.479See Alsop.479VS_Table_Set Fieldsp.480Synopsisp.480Argumentsp.480Parametersp.480Return Valuesp.481Examplep.481Notesp.483See Alsop.484VS_Terminatep.485Synopsisp.485Argumentsp.485Return Valuesp.485Examplep.485Notesp.486See Alsop.486VS_ TypeCapacity _Createp.487Synopsisp.487Return Valuesp.487Examplep.487Notesp.490See Alsop.490VS_ TypeCapacity _Destroyp.491Synopsisp.491Argumentsp.491Return Valuesp.491Examplep.491Notesp.494See Alsop.495VS_ TypeCapacity _GetFieldsp.496Synopsisp.496Argumentsp.496Parametersp.496Return Valuesp.498Examplep.498Notesp.501See Alsop.502VS_ TypeCapacity _SetFieldsp.503Synopsisp.503Argumentsp.503Parametersp.503Return Valuesp.505Examplep.505Notesp.508See Alsop.509VSCMD_ ArchiveQueryp.510Synopsisp.510Argumentsp.510Parametersp.510Return Valuesp.512Examplep.514Notesp.517See Alsop.519VSCMD_ ArchiveQuery _SetDefaultsp.520Synopsisp.520Argumentsp.521Parametersp.521Return Valuesp.523Examplep.523Notesp.524See Alsop.525VSCMD_ ArchiveVaryp.526Synopsisp.526Argumentsp.526Parametersp.527Return Valuesp.528Examplep.530Notesp.531See Alsop.533VSCMD_ ArchiveVary_ SetDefaultsp.534Synopsisp.534Argumentsp.535Parametersp.535Return Valuesp.537Examplep.537Notesp.538See Alsop.539VSCMD_Auditp.540Synopsisp.540Argumentsp.541Parametersp.541Return Valuesp.542Examplep.544Notesp.545See Alsop.548VSCMD_Audit _SetDefaultsp.549Synopsisp.549Argumentsp.549Parametersp.551Return Valuesp.552Examplep.553Notesp.554See Alsop.554VSCMD_ Cancelp.555Synopsisp.555Argumentsp.556Parametersp.556Return Valuesp.558Examplep.559Notesp.561See Alsop.563VSCMD_ Cancel_ SetDefaultsp.564Synopsisp.564Argumentsp.565Parametersp.565Return Valuesp.567Examplep.567Notesp.568See Alsop.569VSCMD_ Checkinp.570Synopsisp.570Argumentsp.570Parametersp.571Return Valuesp.572Examplep.574Notesp.576See Alsop.578VSCMD_ Checkin_ SetDefaultsp.579Synopsisp.579Argumentsp.579Parametersp.580Return Valuesp.581Examplep.582Notesp.583See Alsop.583VSCMD_ Checkoutp.584Synopsisp.584Argumentsp.584Parametersp.585Return Valuesp.586Examplep.588Notesp.590See Alsop.592VSCMD_ Checkout_Set Defaultsp.593Synopsisp.593Argumentsp.593Parametersp.594Return Valuesp.595Examplep.596Notesp.597See Alsop.597VSCMD_Clear Ejectp.598Synopsisp.598Argumentsp.598Parametersp.599Return Valuesp.600Examplep.602Notesp.603See Alsop.606VSCMD_Clear Eject_ SetDefaultsp.607Synopsisp.607Argumentsp.608Parametersp.608Return Valuesp.610Examplep.610Notesp.611See Alsop.612VSCMD_ Connectp.613Synopsisp.614Argumentsp.614Parametersp.615Return Valuesp.617Examplep.618Notesp.621See Alsop.624VSCMD_ Connect_Set Defaultsp.625Synopsisp.625Argumentsp.625Parametersp.626Return Valuesp.628Examplep.628Notesp.630See Alsop.630VSCMD_ ConnectQueryp.631Synopsisp.631Argumentsp.631Parametersp.632Return Valuesp.633Examplep.635Notesp.636See Alsop.638VSCMD_ ConnectQuery_ Set-Defaultsp.640Synopsisp.640Argumentsp.641Parametersp.641Return Valuesp.642Examplep.643Notesp.644See Alsop.644VSCMD_ CreateArchiv eMediaClassp.645Synopsisp.645Argumentsp.646Parametersp.646Return Valuesp.649Examplep.650Notesp.655See Alsop.658VSCMD_ CreateArchiv eMediaClass_ SetDefaultsp.659Synopsisp.659Argumentsp.660Parametersp.660Return Valuesp.663Examplep.663Notesp.668See Alsop.668VSCMD_ CreateMediaClassp.669Synopsisp.669Argumentsp.669Parametersp.670Return Valuesp.673Examplep.675Notesp.679See Alsop.681VSCMD_ CreateMediaClass_ SetDefaultsp.682Synopsisp.682Argumentsp.683Parametersp.683Return Valuesp.687Examplep.687Notesp.689See Alsop.689VSCMD_Drive Varyp.691Synopsisp.691Argumentsp.691Parametersp.692Return Valuesp.694Examplep.695Notesp.698See Alsop.701VSCMD_Drive Vary_ SetDefaultsp.702Synopsisp.702Argumentsp.702Parametersp.702Return Valuesp.705Examplep.705Notesp.708See Alsop.709VSCMD_ Exportp.710Synopsisp.710Argumentsp.711Parametersp.711Return Valuesp.713Examplep.714Notesp.716See Alsop.718VSCMD_ Export_ SetDefaultsp.719Synopsisp.719Argumentsp.719Parametersp.719Return Valuesp.721Examplep.721Notesp.722See Alsop.723VSCMD_ Importp.724Synopsisp.724Argumentsp.724Parametersp.725Return Valuesp.727Examplep.728Notesp.730See Alsop.733VSCMD_ Import_ SetDefaultsp.734Synopsisp.734Argumentsp.734Parametersp.734Return Valuesp.736Examplep.737Notesp.738See Alsop.738VSCMD_ IntransitQueryp.739Synopsisp.739Argumentsp.739Parametersp.740Return Valuesp.741Examplep.742Notesp.744See Alsop.746VSCMD_ IntransitQuery_SetDefaultsp.747Synopsisp.747Argumentsp.747Parametersp.747Return Valuesp.749Examplep.749Notesp.750See Alsop.751VSCMD_Lockp.752Synopsisp.752Argumentsp.753Parametersp.753Return Valuesp.755Examplep.756Notesp.758See Alsop.761VSCMD_Lock _SetDefaultsp.762Synopsisp.762Argumentsp.762Parametersp.762Return Valuesp.764Examplep.765Notesp.766See Alsop.766VSCMD_ MediaClassQueryp.767Synopsisp.767Argumentsp.767Parametersp.768Return Valuesp.769Examplep.771Notesp.773See Alsop.775VSCMD_ MediaClassQuery_ SetDefaultsp.776Synopsisp.776Argumentsp.776Parametersp.776Return Valuesp.778Examplep.778Notesp.780See Alsop.780VSCMD_ MediaQueryp.781Synopsisp.781Argumentsp.781Parametersp.781Return Valuesp.783Examplep.784Notesp.786VSCMD_ MediaQuery_ SetDefaultsp.789Synopsisp.789Argumentsp.789Parametersp.789Return Valuesp.791Examplep.791Notesp.793See Alsop.793VSCMD_ MediaTypeQueryp.794Synopsisp.794Argumentsp.794Parametersp.794Return Valuesp.796Examplep.798Notesp.800See Alsop.802VSCMD_ MediaTypeQuery_ SetDefaultsp.803Synopsisp.803Argumentsp.803Parametersp.804Return Valuesp.805Examplep.806Notesp.807See Alsop.807VSCMD_ ModifyMediap.809Synopsisp.809Argumentsp.809Parametersp.809Return Valuesp.811Examplep.813Notesp.816See Alsop.818VSCMD_ ModifyMedia_ SetDefaultsp.819Synopsisp.819Argumentsp.819Parametersp.820Return Valuesp.822Examplep.822Notesp.825See Alsop.825VSCMD_ CreatePoolp.826Synopsisp.826Argumentsp.826Parametersp.827Return Valuesp.828Examplep.830Notesp.831See Alsop.834VSCMD_ CreatePool_ SetDefaultsp.835Synopsisp.835Argumentsp.836Parametersp.836Return Valuesp.838Examplep.838Notesp.839See Alsop.840VSCMD_ DeleteArchive MediaClassp.841Synopsisp.841Argumentsp.841Parametersp.842Return Valuesp.843Examplep.845Notesp.847See Alsop.849VSCMD_ DeleteArchive MediaClass_ SetDefaultsp.850Synopsisp.850Argumentsp.851Parametersp.851Return Valuesp.853Examplep.853Notesp.855See Alsop.855VSCMD_ DeleteMedia Classp.856Synopsisp.856Argumentsp.856Parametersp.857Return Valuesp.858Examplep.860Notesp.861See Alsop.863VSCMD_ DeleteMedia Class_Set Defaultsp.864Synopsisp.864Argumentsp.865Parametersp.865Return Valuesp.866Examplep.867Notesp.868See Alsop.868VSCMD_ DeletePoolp.869Synopsisp.869Argumentsp.869Parametersp.870Return Valuesp.871Examplep.873Notesp.874See Alsop.876VSCMD_ DeletePool_ SetDefaultsp.877Synopsisp.877Argumentsp.878Parametersp.878Return Valuesp.879Examplep.880Notesp.881See Alsop.881VSCMD_ Disconnectp.882Synopsisp.882Argumentsp.882Parametersp.883Return Valuesp.885Examplep.886Notesp.888See Alsop.891VSCMD_ Disconnect_ SetDefaultsp.892Synopsisp.892Argumentsp.893Parametersp.893Return Valuesp.895Examplep.896Notesp.897See Alsop.897VSCMD_ Dismountp.898Synopsisp.898Argumentsp.899Parametersp.899Return Valuesp.901Examplep.902Notesp.904See Alsop.906VSCMD_ Dismount_Set Defaultsp.907Synopsisp.907Argumentsp.908Parametersp.908Return Valuesp.910Examplep.910Notesp.911See Alsop.912VSCMD_Drive PoolQueryp.913Synopsisp.913Argumentsp.913Parametersp.914Return Valuesp.915Examplep.917Notesp.919See Alsop.921VSCMD_Drive PoolQuery_ SetDefaultsp.922Synopsisp.922Argumentsp.923Parametersp.923Return Valuesp.925Examplep.925Notesp.926See Alsop.927VSCMD_Drive Queryp.928Synopsisp.928Argumentsp.928Parametersp.928Return Valuesp.930Examplep.931Notesp.933See Alsop.936VSCMD_Drive Query_ SetDefaultsp.937Synopsisp.937Argumentsp.938Parametersp.938Return Valuesp.940Examplep.940Notesp.941See Alsop.942VSCMD_ Modify ArchiveMedia Classp.943Synopsisp.943Argumentsp.943Parametersp.945Return Valuesp.947Examplep.948Notesp.953See Alsop.957VSCMD_ Modify ArchiveMedia Class_Set Defaultsp.958Synopsisp.958Argumentsp.958Parametersp.959Return Valuesp.961Examplep.961Notesp.963See Alsop.963VSCMD_ ModifyMedia Classp.964Synopsisp.964Argumentsp.964Parametersp.964Return Valuesp.968Examplep.969Notesp.974See Alsop.976VSCMD_ ModifyMedia Class_Set Defaultsp.977Synopsisp.977Argumentsp.977Parametersp.978Return Valuesp.981Examplep.982Notesp.983See Alsop.984VSCMD_ ModifyPoolp.985Synopsisp.985Argumentsp.985Parametersp.985Return Valuesp.987Examplep.989Notesp.991See Alsop.994VSCMD_ ModifyPool_ SetDefaultsp.995Synopsisp.995Argumentsp.995Parametersp.996Return Valuesp.998Examplep.998Notesp.999See Alsop.1000VSCMD_ Mountp.1001Synopsisp.1002Argumentsp.1002Parametersp.1003Return Valuesp.1006Examplep.1008Notesp.1011See Alsop.1016VSCMD_ Mount_Set Defaultsp.1017Synopsisp.1017Argumentsp.1017Parametersp.1018Return Valuesp.1021Examplep.1022Notesp.1023See Alsop.1024VSCMD_Movep.1025Synopsisp.1026Argumentsp.1026Parametersp.1026Return Valuesp.1028Examplep.1030Notesp.1032See Alsop.1035VSCMD_Move _SetDefaultsp.1036Synopsisp.1036Argumentsp.1036Parametersp.1037Return Valuesp.1039Examplep.1039Notesp.1040See Alsop.1041VSCMD_Multi Mountp.1042Synopsisp.1042ARGUMENTSp.1042Parametersp.1042Return Valuesp.1044Examplep.1046Notesp.1048See Alsop.1052VSCMD_ MultiMount_ SetDefaultsp.1053Synopsisp.1053Argumentsp.1053Parametersp.1054Return Valuesp.1056Examplep.1056Notesp.1057See Alsop.1058VSCMD_Pingp.1059Synopsisp.1059Argumentsp.1059Return Valuesp.1059Examplep.1060Notesp.1062See Alsop.1062VSCMD_ QueryMountp.1063Synopsisp.1063Argumentsp.1063Parametersp.1064Return Valuesp.1065Examplep.1066Notesp.1068See Alsop.1070VSCMD_ QueryMount_ SetDefaultsp.1072Synopsisp.1072Argumentsp.1072Parametersp.1073Return Valuesp.1074Examplep.1075Notesp.1076See Alsop.1076VSCMD_ Reclassifyp.1077Synopsisp.1077Argumentsp.1077Parametersp.1078Return Valuesp.1080Examplep.1081Notesp.1084See Alsop.1088VSCMD_ Reclassify_ SetDefaultsp.1089Synopsisp.1089Argumentsp.1089Parametersp.1090Return Valuesp.1091Examplep.1092Notesp.1093See Alsop.1094VSCMD_ Reprioritizep.1095Synopsisp.1095Argumentsp.1095Parametersp.1096Return Valuesp.1098Examplep.1099Notesp.1101See Alsop.1103VSCMD_ Reprioritize_ SetDefaultsp.1104Synopsisp.1104Argumentsp.1104Parametersp.1105Return Valuesp.1107Examplep.1107Notesp.1108See Alsop.1109VSCMD_ RequestQueryp.1110Synopsisp.1110Argumentsp.1110Parametersp.1110Return Valuesp.1112Examplep.1113Notesp.1115See Alsop.1117VSCMD_ Request Query_Set Defaultsp.1118Synopsisp.1118Argumentsp.1118Parametersp.1119Return Valuesp.1120Examplep.1121Notesp.1122See Alsop.1122VSCMD_ Unlockp.1123Synopsisp.1123Argumentsp.1123Parametersp.1123Return Valuesp.1125Examplep.1126Notesp.1128See Alsop.1130VSCMD_ Unlock_Set Defaultsp.1131Synopsisp.1131Argumentsp.1131Parametersp.1132Return Valuesp.1133Examplep.1134Notesp.1135See Alsop.1135Valid Status Fieldsp.1139Error Codesp.1157Error Codesp.1159Mount Examplep.1177Examplep.1179
Page 1 of the ADIC 601355 Rev A user manual — VolServ Version 5.0
Page 1 · click to enlarge
Page 1

VolServ Version 5.0

September 2001

601355 Rev A

Page 2 of the ADIC 601355 Rev A user manual — Documentation
Page 2 · click to enlarge
Page 2

Trademark Notice

AMASS, DataMgr, EMASS, FileServ, and VolServ are either trademarks or registered trademarks of ADIC, Advanced Digital Information Corporation. DAS is a trademark of Grau, an ADIC subsidiary. All other product names and identifications are trademarks or registered trademarks of their respective manufacturers.

Copyright Notice

© 1996-2001 ADIC®. All rights reserved. This document is the property of ADIC. No part of this document may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual, or otherwise, without the express written permission of:

ADIC 10949 East Peakview Ave. Englewood, CO 80111 USA Phone: 303-792-9700 FAX: 303-792-2465

U.S. Government Rights Restricted

Use, duplication, or disclosure of either the software or documentation is subject to restrictions set forth by the U.S. Government in FAR 52.227-19(c)(2) and subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 52.227- 7013 and/or in similar or following clauses in the FAR, DoD, or NASA FAR Supplement.

Technical Assistance

ADIC Technical Assistance Center:

  • In the USA and Canada, call 1-800-827-3822.
  • Outside the USA and Canada, call 303-874-0188 or toll-free 00800-9999-3822.
  • Send e-mail to: support@<a href="http://adic.com" rel="nofollow noopener" target="_blank">adic.com</a>.

Documentation

Although the material contained herein has been carefully reviewed, ADIC does not warrant it to be free of errors or omissions. We reserve the right to make corrections, updates, revisions, or changes to the information contained herein.

  • Send e-mail to: techdocs@<a href="http://adic.com" rel="nofollow noopener" target="_blank">adic.com</a>
Page 3 of the ADIC 601355 Rev A user manual — READER COMMENT FORM
Page 3 · click to enlarge
Page 3

READER COMMENT FORM

ADIC includes this Form in an effort to provide the best possible documentation to our customers. Please take a few moments to mail or FAX your response to:

ADIC Software Documentation 10949 East Peakview Ave. Englewood, CO 80111 FAX: 303-792-2465 E-mail: techdocs@adic.com

QuestionCircle One Information was complete.AgreeDisagree Information was easy to find.AgreeDisagree Information was easy to follow.AgreeDisagree

Is there anything you especially like or dislike about the organization, presentation,

or writing in this manual?

Book TitleDocument Number Customer NameTelephone E-mail Address Company Name Address City, State, Zip
Show 4 more labels / short text on this page
___________________________________________________________________ · ___________________________________________________________________ · ___________________________________________________________________ · ___________________________________________________________________
Page 4 of the ADIC 601355 Rev A user manual — NOTES
Page 4 · click to enlarge
Page 4

NOTES

Page 5 of the ADIC 601355 Rev A user manual — Getting Started 1
Page 5 · click to enlarge
Page 5

Contents

Preface

Purpose of This Book P-3 Who Should Read This Book P-3 How This Book is Organized P-3 Conventions P-4 Books P-5

Getting Started 1

API Directory Structure 1-3 Application Program Interface 1-5 Client Interface Summary 1-7 Unsolicited Communication 1-9 VolServ API Integration 1-10 API Types 1-12 Naming Conventions 1-15

Dispatch Routines 1-19 Global Parameters 1-20 API Error Handling 1-22 Using the API 1-24 Processing 1-28 API Functions 1-30

601355 Rev A i

Page 6 of the ADIC 601355 Rev A user manual — API Functions 2
Page 6 · click to enlarge
Page 6

API Functions 2

VS_Archive_Destroy 2-11 VS_Archive_GetFields 2-15 VS_Archive_SetFields 2-25 VS_ArchiveMediaClass_Create 2-32 VS_ArchiveMediaClass_Destroy 2-36 VS_ArchiveMediaClass_GetFields 2-41 VS_ArchiveMediaClass_SetFields 2-49 VS_Command_Create 2-58 VS_Command_Destroy 2-61 VS_Command_GetErrorFields 2-65 VS_Command_GetFields 2-68 VS_Command_GetStatusFields 2-72 VS_Command_SetFields 2-82 VS_Component_Create 2-87 VS_Component_Destroy 2-93 VS_Component_GetFields 2-96 VS_Component_SetFields 2-100 VS_Connect_Create 2-107 VS_Connect_Destroy 2-110 VS_Connect_GetFields 2-114 VS_Connect_SetFields 2-118 VS_Criteria_Create 2-123 VS_Criteria_Destroy 2-129 VS_Criteria_GetFields 2-136 VS_Criteria_SetFields 2-142

ii Contents 601355 Rev A

Page 7 of the ADIC 601355 Rev A user manual
Page 7 · click to enlarge
Page 7

VS_CriteriaGroup_Create 2-149 VS_CriteriaGroup_Destroy 2-155 VS_CriteriaGroup_GetFields 2-161 VS_CriteriaGroup_SetFields 2-166 VS_Drive_Create 2-173 VS_Drive_Destroy 2-177 VS_Drive_GetFields 2-181 VS_Drive_SetFields 2-187 VS_DrivePool_Create 2-193 VS_DrivePool_Destroy 2-196 VS_DrivePool_GetFields 2-199 VS_DrivePool_SetFields 2-204 VS_Error_GetFields 2-208 VS_Expression_Create 2-212 VS_Expression_Destroy 2-218 VS_Expression_GetFields 2-225 VS_Expression_SetFields 2-231 VS_Global_GetFields 2-238 VS_Global_SetFields 2-243 VS_Initialize 2-249 VS_Media_Create 2-253 VS_Media_Destroy 2-257 VS_Media_GetFields 2-261 VS_Media_SetFields 2-267 VS_MediaClass_Create 2-273 VS_MediaClass_Destroy 2-278 VS_MediaClass_GetFields 2-283 VS_MediaClass_SetFields 2-291

601355 Rev A Contents iii

Page 8 of the ADIC 601355 Rev A user manual
Page 8 · click to enlarge
Page 8

VS_MediaType_Create 2-299 VS_MediaType_Destroy 2-302 VS_MediaType_GetFields 2-305 VS_MediaType_SetFields 2-309 VS_Mount_Create 2-313 VS_Mount_Destroy 2-318 VS_MediaClass_GetFields 2-322 VS_Mount_SetFields 2-330 VS_Notify_Create 2-338 VS_Notify_Destroy 2-343 VS_Notify_GetFields 2-348 VS_Notify_Listen 2-356 VS_Notify_SetFields 2-362 VS_Request_Create 2-369 VS_Request_Destroy 2-372 VS_Request_GetFields 2-375 VS_Request_SetFields 2-379 VS_Select 2-383 VS_Status_GetFields 2-386 VS_Table_AddEntry 2-400 VS_Table_Create 2-407 VS_Table_CreateAdd-Entry 2-414 VS_Table_Destroy 2-418 VS_Table_GetFields 2-422 VS_Table_RemoveEntry 2-426 VS_Table_SetFields 2-430 VS_Terminate 2-435 VS_TypeCapacity_Create 2-437

iv Contents 601355 Rev A

Page 9 of the ADIC 601355 Rev A user manual
Page 9 · click to enlarge
Page 9

VS_TypeCapacity_Destroy 2-441 VS_TypeCapacity_GetFields 2-446 VS_TypeCapacity_SetFields 2-453 VSCMD_ArchiveQuery 2-460 VSCMD_ArchiveQuery_SetDefaults 2-470 VSCMD_ArchiveVary 2-476 VSCMD_ArchiveVary_SetDefaults 2-484 VSCMD_Audit 2-490 VSCMD_Audit_SetDefaults 2-499 VSCMD_Cancel 2-505 VSCMD_Cancel_SetDefaults 2-514 VSCMD_Checkin 2-520 VSCMD_Checkin_SetDefaults 2-529 VSCMD_Checkout 2-534 VSCMD_Checkout_SetDefaults 2-543 VSCMD_ClearEject 2-548 VSCMD_ClearEject_SetDefaults 2-557 VSCMD_Connect 2-563 VSCMD_Connect_SetDefaults 2-575 VSCMD_Connect-Query 2-581 VSCMD_Connect-Query_Set-Defaults 2-590 VSCMD_CreateArchiveMediaClass 2-595 VSCMD_CreateArchiveMediaClass_SetDefaults 2-609 VSCMD_CreateMedia-Class 2-619 VSCMD_CreateMedia-Class_SetDefaults 2-632 VSCMD_DriveVary 2-641 VSCMD_DriveVary_SetDefaults 2-652 VSCMD_Export 2-660

601355 Rev A Contents v

Page 10 of the ADIC 601355 Rev A user manual
Page 10 · click to enlarge
Page 10

VSCMD_Export_SetDefaults 2-669 VSCMD_Import 2-674 VSCMD_Import_SetDefaults 2-684 VSCMD_Intransit-Query 2-689 VSCMD_Intransit-Query_Set-Defaults 2-697 VSCMD_Lock 2-702 VSCMD_Lock_SetDefaults 2-712 VSCMD_MediaClass-Query 2-717 VSCMD_MediaClass-Query_SetDefaults 2-726 VSCMD_MediaQuery 2-731 VSCMD_MediaQuery_SetDefaults 2-739 VSCMD_MediaType-Query 2-744 VSCMD_MediaType-Query_SetDefaults 2-753 VSCMD_ModifyMedia 2-759 VSCMD_ModifyMedia_SetDefaults 2-769 VSCMD_CreatePool 2-776 VSCMD_CreatePool_SetDefaults 2-785 VSCMD_DeleteArchiveMediaClass 2-791 VSCMD_DeleteArchiveMediaClass_SetDefaults 2-800 VSCMD_DeleteMediaClass 2-806 VSCMD_DeleteMediaClass_SetDefaults 2-814 VSCMD_DeletePool 2-819 VSCMD_DeletePool_SetDefaults 2-827 VSCMD_Disconnect 2-832 VSCMD_Disconnect_SetDefaults 2-842 VSCMD_Dismount 2-848 VSCMD_Dismount_SetDefaults 2-857 VSCMD_DrivePoolQuery 2-863

vi Contents 601355 Rev A

Page 11 of the ADIC 601355 Rev A user manual
Page 11 · click to enlarge
Page 11

VSCMD_DrivePoolQuery_SetDefaults 2-872 VSCMD_DriveQuery 2-878 VSCMD_DriveQuery_SetDefaults 2-887 VSCMD_ModifyArchiveMediaClass 2-893 VSCMD_ModifyArchiveMediaClass_SetDefaults 2-908 VSCMD_ModifyMediaClass 2-914 VSCMD_ModifyMediaClass_SetDefaults 2-927 VSCMD_ModifyPool 2-935 VSCMD_ModifyPool_SetDefaults 2-945 VSCMD_Mount 2-951 VSCMD_Mount_SetDefaults 2-967 VSCMD_Move 2-975 VSCMD_Move_SetDefaults 2-986 VSCMD_MultiMount 2-992 VSCMD_MultiMount_SetDefaults 2-1003 VSCMD_Ping 2-1009 VSCMD_QueryMount 2-1013 VSCMD_QueryMount_SetDefaults 2-1022 VSCMD_Reclassify 2-1027 VSCMD_Reclassify_SetDefaults 2-1039 VSCMD_Reprioritize 2-1045 VSCMD_Reprioritize_SetDefaults 2-1054 VSCMD_Request-Query 2-1060 VSCMD_RequestQuery_SetDefaults 2-1068 VSCMD_Unlock 2-1073 VSCMD_Unlock_SetDefaults 2-1081 Error Codes B-3 Example C-3

601355 Rev A Contents vii

Page 12 of the ADIC 601355 Rev A user manual
Page 12 · click to enlarge
Page 12

viii Contents 601355 Rev A

Page 13 of the ADIC 601355 Rev A user manual — Preface
Page 13 · click to enlarge
Page 13

Preface

P

Purpose of This Book P-3 Who Should Read This Book P-3 How This Book is Organized P-3 Conventions P-4 Books P-5

Preface

Online Books P-5 Related Publications P-6 Contact Publications Department P-6 Secured Web Site P-6

Page 14 of the ADIC 601355 Rev A user manual — NOTES
Page 14 · click to enlarge
Page 14

NOTES

P-2 Preface 601355 Rev A

Page 15 of the ADIC 601355 Rev A user manual — How This Book is Organized
Page 15 · click to enlarge
Page 15

Preface

Purpose of This Book

This book describes the VolServ application programming interface (API). The API consists of functions, iterators, symbolic names, type definitions, and data structures.

Using the API provides the programmer with the ability to directly manipulate VolServ file system metadata and media.

Who Should Read This Book

This book is written for programmers who are creating or modifying an application that requires tight control over data in the file system managed by VolServ

How This Book is Organized

This book contains the following chapters:

Chapter 1: Getting Started — Describes API types and naming conventions, dispatch routines and global parameters,.and error handling.

Chapter 2: Functions — Alphabetical list of API function calls.

Appendix A: Valid Status Fields — A matrix shows which status fields are valid for each command.

Appendix B: Error Codes.

Appendix C: Mount Example.

601355 Rev A Preface P-3

Page 16 of the ADIC 601355 Rev A user manual — Convention Example
Page 16 · click to enlarge
Page 16

Conventions The conventions used throughout the VolServ technical books are listed below:

Convention Example

Screen text, file names, program names, and commands are in Courier font.

Request to add a new volume: Volume group will be “20” Volume position will be “A123”.

The root prompt is shown as a number symbol.

What you should type in is shown in Courier bold font.

Site-specific variables are in a Times italics font.

A backward slash ( \ ) denotes the input is continued onto the next line; the printed page is just not wide enough to accommodate the line.

# remsh nodename -n dd if=/dev \ /tapedevicename/bs=20b | tar xvfb \ - 20

(You should type the entire command without the backward slash.)

Pressing after each command is assumed.

A menu name with an arrow refers to a sequence of menus.

P-4 Preface 601355 Rev A

Show 4 more labels / short text on this page
# su root · vsarchiveqry · tar -xvf tapedevicename · Config-->MediaType-->Redefine
Page 17 of the ADIC 601355 Rev A user manual — Preface
Page 17 · click to enlarge
Page 17

Preface

Books The books described below are part of the technical documentation set, and are shipped on CD along with the VolServ software:

Overview Provides an overview of VolServ. Contains a glossary.

Administrative Tasks Describes how to perform system administrative tasks using VolServ commands.

Installing VolServ Describes server requirements, installation instructions, troubleshooting procedures, and configuration parameters.

Command Reference Contains a list of VolServ commands

Error Messages Provides corrective action for system log errors.

Using the VolServ GUI Describes how to perform system administrative tasks using the graphical user interface.

Quick Reference Card Summarizes commands.

API Guide Provides a list of API functions.

Online Books The documentation CD contains VolServ book files and Adobe® Acrobat® Reader. The Reader allows you to view and navigate the online documentation files yet preserves the page design and graphics from the printed books.

601355 Rev A Preface P-5

Page 18 of the ADIC 601355 Rev A user manual — Secured Web Site
Page 18 · click to enlarge
Page 18

Related Publications

The publications described in the table below are created and distributed on an as-needed basis.

Related Publications Description

“Release Notes” For each version of VolServ, the “Release Notes” contain:

  • Summary of enhancements.
  • Describes:

- Fixed problems.

- Known problems.

- Installation and configuration issues.

  • Lists:

- Operating system patches.

- System requirements.

“Product Alerts” Informs customers of technical problems and solutions.

“Product Bulletins” Conveys technical information—not problems—to customers.

Contact Publications Department

To make corrections or to comment on VolServ publications, please contact Software Technical Publications at our e-mail address: techdocs@adic.com.

Secured Web Site

To receive access to the secured site on our home page contain- ing technical product information (Release Notes, Product Alerts, Product Bulletins, FAQs), visit http://partners.adic.com/ and follow the password request procedure. In return, ADIC will send you instructions and a password.

P-6 Preface 601355 Rev A

Page 19 of the ADIC 601355 Rev A user manual — Getting Started
Page 19 · click to enlarge
Page 19

API Directory Structure 1-3 Application Program Interface 1-5

Extensible 1-5 Consistent 1-5 Portable 1-5 Flexible 1-5 Client Interface Summary 1-7 Unsolicited Communication 1-9 VolServ API Integration 1-10 API Types 1-12

Getting Started

Getting

Started

Objects 1-12 Handles 1-12 Naming Conventions 1-15 Dispatch Routines 1-19 Global Parameters 1-20

Global Variables 1-21 API Error Handling 1-22 Using the API 1-24

Command Handle 1-24 Command Calls 1-24 Command Defaults 1-25 Command Status 1-26 Processing 1-28

Asynchronous 1-28 Synchronous 1-29 API Functions 1-30

Page 20 of the ADIC 601355 Rev A user manual — Roadmap
Page 20 · click to enlarge
Page 20

Roadmap

Naming conventions.

Global parameters.

Error handling.

API functions. 2

Valid staus fields. A

Error codes. B

Mount example. C

1-2 Getting Started 601355 Rev A

Topic Refer To · Chapter

Page 21 of the ADIC 601355 Rev A user manual — Getting Started
Page 21 · click to enlarge
Page 21

API Directory Structure

All files necessary for client interface to the VolServ software are contained in the volserv/vsapi directory by default. However, the installer may choose a different location during execution of the installation script, except that the vsapi directory is always appended to the specified location. Refer to Installing VolServ for more information.

Getting Started

Client software may use the API to interface to VolServ software. Clients are responsible for creating and linking their own applications to the appropriate API header and library files.

The default API directory structure is shown in following figure and defined in the table below.

/util /lib /include /man

include Contains six header files used by API library.

lib Contains the API library.

man Contains man pages for all VolServ API library functions.

601355 Rev A Getting Started 1-3

/volserv/vsapi · Directory Contents

Page 22 of the ADIC 601355 Rev A user manual — API Directory Structure
Page 22 · click to enlarge
Page 22

util Contains various utilities used to clean up configuration problems, save copies of VolServ software logs, change the number sequence of label pattern generation, or to perform maintenance.

1-4 Getting Started 601355 Rev A

Directory Contents

Page 23 of the ADIC 601355 Rev A user manual — Getting Started
Page 23 · click to enlarge
Page 23

Application Program Interface

The VolServ Application Programmer’s Interface (API) allows a programmer to interface with VolServ. The VolServ API is a set of ‘C’ library routines, written for a UNIX system, that the client software uses to communicate with VolServ.

The VolServ API allows the user to send commands, receive command statuses, and receive VolServ MediaClass notifications.

Getting Started

The VolServ API interface uses the VolServ Remote Procedure Call (RPC) interface to communicate with VolServ. All features available in the VolServ RPC interface are supported in the VolServ API.

Extensible The VolServ API is extensible. Any change in the VolServ RPC interface is handled by the API. Thus, the client program does not have to be updated to maintain compatibility when the VolServ RPC interface is modified. The client program is updated only to use new VolServ features.

Consistent The VolServ API is consistent. All commands and their related functions have the same interface and operate similarly.

Portable The VolServ API is designed to be highly portable to other platforms. (If the client program is ported to a platform supported by the VolServ API, the client program does not need to be concerned with VolServ connectivity.)

Flexible The VolServ API is flexible. A client program can send a command to VolServ and either

601355 Rev A Getting Started 1-5

Page 24 of the ADIC 601355 Rev A user manual — Application Program Interface
Page 24 · click to enlarge
Page 24
  • Wait for final status before continuing processing (synchronous processing).
  • Or, continue processing after VolServ has received the command. The client software receives the command’s status at a later time (asynchronous processing).

A client program can also mix these operation modes.

1-6 Getting Started 601355 Rev A

Page 25 of the ADIC 601355 Rev A user manual — Getting Started
Page 25 · click to enlarge
Page 25

Client Interface Summary

The figure below illustrates the communication paths supported by VolServ:

Clients using Commands in Client scripts

Getting Started

API

RPC

RPC

RPC

The following outline shows the flow of information through these communication paths.

  • Clients using the Command Line Interface and Client Scripts.

- The client-to-client script issues a request from the command line.

- The CLI software performs first-level validation on the request and forwards the request to the API software.

- The API software serializes the request into XDR format and transmits the request to VolServ using the RPC/XDR protocol.

- VolServ returns data and/or status to the API software using the RPC/XDR protocol.

601355 Rev A Getting Started 1-7

Show 7 more labels / short text on this page
Command · Line Interface · Client Software · using API · VolServ · Client Software · using RPC/XDR protocol
Page 26 of the ADIC 601355 Rev A user manual — Client Interface Summary
Page 26 · click to enlarge
Page 26

- The API software deserializes the data and/or status from the XDR formats and forwards the information to the CLI software.

- The CLI software formats the data and/or status and forwards this information to the client that issued the request.

- The client/client script processes the data and/or status returned by the CLI software.

  • Client software using the API.

- The client software issues a request to the API software by calling an API function/routine.

- The API software serializes the request into XDR format and transmits the request to VolServ using the RPC/XDR protocol.

- VolServ returns data and/or status to the API software using the RPC/XDR protocol.

- The API software deserializes the data and/or status from the XDR formats and forwards the information to the client software.

- The client software processes the data and/or status returned by the API software.

  • Client software using the RPC/XDR protocol.

- The client software serializes the request into XDR format and transmits the request to VolServ using the RPC/XDR protocol.

- VolServ returns data and/or status to the client software using the RPC/XDR protocol.

- The client software deserializes the information from the XDR format and processes the returned information.

1-8 Getting Started 601355 Rev A

Page 27 of the ADIC 601355 Rev A user manual — Getting Started
Page 27 · click to enlarge
Page 27

Unsolicited Communication

VolServ can generate unsolicited communication after specific client and operator commands. This unsolicited communication is referred to in some VolServ documentation as “Callbacks” or “Notifications.”

Unsolicited communication from VolServ can be directed to either:

Getting Started

  • A preselected RPC address.
  • Or, to an internet address associated with an enterprise. The RPC address or enterprise assigned for unsolicited communication is assignable at the MediaClass level. Refer to the Command Reference book for detailed information about defining unsolicited communication parameters for a MediaClass group.

This address is used as the receiver for unsolicited messages that VolServ transmits. These messages are transmitted at the completion of VolServ processing that had an impact on any medium associated with the particular MediaClass group.

Running the following commands: VSCMD_Import, VSCMD_Export, VSCMD_CheckIn, VSCMD_CheckOut, VSCMD_Mount, VSCMD_Dismount, and VSCMD_Reclassify can generate unsolicited communication from VolServ. This unsolicited communication is returned to the client issuing the command only if that client is specified in the processing parameters as the destination for all unsolicited communication for the MediaClass group.

601355 Rev A Getting Started 1-9

Page 28 of the ADIC 601355 Rev A user manual — VolServ API Integration
Page 28 · click to enlarge
Page 28

VolServ API Integration

To integrate the VolServ API in a client application, the client includes the header file vs_client.h in the source modules that reference the VolServ API types and functions. The client then links the program with the VolServ API library libvsapi.a with the -lvsapi option for the cc or ld commands.

The following five header files are delivered with the VolServ API:

vs_client.h Includes the VolServ API header files needed by the client.

vs_defs.h Includes the VolServ API definitions needed for the parameter lists.

vs_types.h Includes the VolServ API types and enumerations.

vs_globals.h Includes the VolServ API global variables that are accessible to the client.

vs_proto.h Includes the prototypes for all VolServ API functions.

Before any command can be sent by the client program, the VolServ API must by initialized with a call to VS_Initialize. The routine VS_Initialize creates and initializes the APIs required variables and creates a communication link with VolServ. Before the client program terminates, it calls the VS_Terminate routine to allow the VolServ API to clean up its processing.

For example:

1-10 Getting Started 601355 Rev A

Header Files Description

Page 29 of the ADIC 601355 Rev A user manual — Getting Started
Page 29 · click to enlarge
Page 29

#include #include main() {

/* get volserv host name from the user */ printf ( “Enter the name of the VolServ host

Getting Started

computer ==> “ ); scanf ( “%s”, vshost );

/* initialize the VolServ API. */ /* returns TRUE if successful, */ /* FALSE if fails. */ if ( VS_Initialize ( vshost, 0, 30 ) ) {

/* send and create commands */

/* allow VolServ API to */ /* terminate properly */ VS_Terminate(); } else {

printf ( “Error initializing VolServ API” ); } }

601355 Rev A Getting Started 1-11

VST_HOSTNAME vshost;

Page 30 of the ADIC 601355 Rev A user manual — Note
Page 30 · click to enlarge
Page 30

API Types API objects and handles are described below.

Objects The VolServ API uses an object-oriented metaphor for tracking VolServ items. Each object contains several fields that describe the object, routines that create and destroy the object, and routines that access the data contained within the object.

The following objects mirror items found in VolServ: archive, archive media class, archive type capacity, component, drive, drive pool, enterprise group, enterprise connection, media, MediaClass group, media type, mount selection expression, mount selection criteria, mount selection criteria group, and request. These objects usually store information relating only to their VolServ counterparts.

Note

The following objects are specific to the VolServ API: command, error, notify, status, and table. These objects contain information about the associated command and its statuses.

Handles A handle is a pointer to a VolServ API object. An object is created by an initialization routine that returns a handle that points to the newly allocated object. After a handle is created, it is passed as a parameter to the routines that access the handle’s data.

1-12 Getting Started 601355 Rev A

Page 31 of the ADIC 601355 Rev A user manual — Getting Started
Page 31 · click to enlarge
Page 31

Each handle has the four base routines descried in the table below:

initializer The initializer creates and initializes the data held by the handle and returns a pointer to the client that is used as a parameter to the destructor, assignment, and accessor functions.

Getting Started

destructer The destructor frees the space held by the handle.

assignment The assignment function allows the client to assign values to fields within the handle. A call to the assignment function takes a variable argument list that includes a handle and a list of identifier-value pairs. The handle identifies the handle for which field values are being assigned. An identifier-value pair identifies the field for which a value is being assigned and the value being assigned to that field.

accessor The accessor function allows the client to retrieve values from fields within the handle. A call to the accessor function takes a variable argument list that includes a handle and a list of identifier-pointer pairs. The handle identifies the handle for which field values are to be retrieved. An identifier-pointer pair identifies the field for which the value is to be retrieved and a pointer to the location where the field value is to be stored.

The following example creates a command handle and uses the assignment function to set the priority field within the command object to a value of 10.

601355 Rev A Getting Started 1-13

Routine Description

Page 32 of the ADIC 601355 Rev A user manual — VSID_PRIORITY, 10,
Page 32 · click to enlarge
Page 32

VST_COMMAND_HANDLE cmdh; if ( (cmdh = VS_Command_Create()) != NULL ) {

VSID_PRIORITY, 10,

VSID_ENDFIELD ); }

1-14 Getting Started 601355 Rev A

VS_Command_SetFields (cmdh,

Page 33 of the ADIC 601355 Rev A user manual — VSE_DRIVETYPE_NONE = 0,
Page 33 · click to enlarge
Page 33

Naming Conventions

The table below describes the API naming conventions:

Getting Started

Handles Handle names start with the VST prefix, followed by the specific object name, and end with the HANDLE suffix. The name should be in all capitals. For example: VST_DRIVE_HANDLE

Types Types are defined in a client-accessed header file begin with the VST prefix. For example: VST_DRIVE_ID

Definitions Definitions that are defined in the client definition header file should begin with the VSD prefix. For example:

VSD_DRIVE_NAME_LEN

Enumerations Enumerations have two conventions to follow. The type begins with the VST prefix. The values inside the enumeration structure begin with the VSE prefix.

For example:

VSE_DRIVETYPE_NONE = 0,

VSE_DRIVETYPE_MAGTAPE =1 } VST_DRIVE_TYPE

Global Variables Global variables begin with the VSG prefix. For example: VSG_ERROR_CODE

Identifiers Identifiers that are used in the “assignment” and “accessor” functions to identify the field being accessed within each handle begin with the VSID prefix. The following identifier is for a drive identifier, for example: VSID_DRIVE_ID

601355 Rev A Getting Started 1-15

Item Description · typedef enum {

Page 34 of the ADIC 601355 Rev A user manual — Naming Conventions
Page 34 · click to enlarge
Page 34

Functions Function names used in the VolServ API also follow a specific set of rules. All function names exist in the format of the VS prefix, followed by the object name, and ending with a condensed description of the function. The following example shows the overall form of function names:

The function descriptions also follow a naming convention, with the description coming from the following list: “GetFields”, “SetFields”, “Create”, and “Destroy.” Refer to the following example:

VS_Drive_Create(); VS_Drive_Destroy(VS_DRIVE_HANDLE); VS_Drive_GetFields(VS_DRIVE_HANDLE, ... ) VS_Drive_SetFields(VS_DRIVE_HANDLE, ... )

The “GetFields” and “SetFields” functions each take a variable argument list beginning with a handle. After the handle, the client specifies identifier-parameter pairs (or triples in some cases). These identifiers tell the function what field is to be accessed. The parameter tells the function either the value to be assigned to the field or the location where the filed value is to be retrieved. The identifier VSID_ENDFIELD must appear at the end of the variable argument list. Refer to the following example:

VST_STATUS_HANDLE statush; VST_ERROR_HANDLE errorh VST_STATUS_CODE satcode; VST_MEDIA_ID media; VST_DRIVE_ID drive;

1-16 Getting Started 601355 Rev A

Show 4 more labels / short text on this page
Item Description · VS_objectname_functiondescription() · mount_status ( VST_COMMAND_HANDLE · cmdh ) {
Page 35 of the ADIC 601355 Rev A user manual — ( VS_COMMAND_HANDLE, …);
Page 35 · click to enlarge
Page 35

Getting Started

VSID_ENDFIELD );

if ( statcode == VSE_STATUS_OK ) {

VSID_MEDIA_ID, media, VSID_DRIVE_ID, &drive, VSID_ENDFIELD );

printf ( “media [%s] mounted on [%d]”, media, drive ); } else {

print_error_code ( errorh ); } }

Function names that map directly to a VolServ Command begin with the VSCMD prefix, followed by the command name. Refer to the following example:

The following is an actual command:

( VS_COMMAND_HANDLE, …);

601355 Rev A Getting Started 1-17

Show 8 more labels / short text on this page
Item Description · VS_Command_GetFields ( cmdh, · VSID_STATUS_HANDLE, &statush, · VSID_ERROR_HANDLE &errorh, · VSID_STATUS_CODE, &statcode, · VS_Status_GetFields ( status, · VSCMD_command_option · VSCMD_DriveQuery
Page 36 of the ADIC 601355 Rev A user manual — Naming Conventions
Page 36 · click to enlarge
Page 36

Parameter Defaults Two levels of default settings used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using the VS_Global_SetFields() and VS_Global_GetFields() calls.
  • Command-specific defaults are set using the VSCMD_ commandname _SetDefaults() calls.

If command-specific defaults are set for a specific command (e.g., mount), they override the global defaults for all requests for execution of that command. To override a default parameter value for a specific instance of a command request, the parameter identifier and the value to be used for the parameter can be submitted on the command request (e.g., VSCMD_Mount()) itself.

1-18 Getting Started 601355 Rev A

Item Description

Page 37 of the ADIC 601355 Rev A user manual — Getting Started
Page 37 · click to enlarge
Page 37

Dispatch Routines

Dispatch routines are functions within the client software that the API automatically calls when status messages or MediaClass callbacks are received from VolServ. The dispatch routine for MediaClass callbacks (also referred to as notifications) is described on the man page for VS_Notify_SetFields(l).

Getting Started

Dispatch routines for status messages are set for all requests with the VS_Global_SetFields() call, for all requests of a given type with the VSCMD_request_SetDefaults() call, or as part of the call that sends the VolServ request.

Dispatch routines are prototyped as follows:

  • void dispatchroutine( VST_COMMAND_HANDLE handle)

The dispatch routine takes one argument. This is the command handle for the request that received status.

601355 Rev A Getting Started 1-19

Page 38 of the ADIC 601355 Rev A user manual — VSID_PRIORITY
Page 38 · click to enlarge
Page 38

Global Parameters

Global parameters are a group of parameters that are used by the API for all VolServ requests. Most of these are sent to VolServ, but some serve as control information for the API. The following table describe these parameters.

VSID_CLIENT_DISPATCH Pointer to the dispatch function for all commands.

VSID_ENTERPRISE_ID Identifier of the enterprise, if any, to receive intermediate and final status on every command request.

VSID_NOTIFY_DISPATCH Pointer to the dispatch function used for notification (MediaClass callback) processing.

VSID_PRIORITY

Execution priority assigned to every command request.

Values range from 1 (highest) to 32 (lowest).

VSID_RETRY_LIMIT Number of times the API software is to retry for command status from VolServ before returning a time-out to the client software.

Total length of time the API software waits for a command status from VolServ is (VSID_RETRY_LIMIT plus1) multiplied by the VSID_TIMEOUT_VALUE.

VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG Status wait flag for all commands. This flag controls whether the API operates in synchronous or asynchronous mode. If its value TRUE, the API waits for status (operate in synchronous mode.) If its value is FALSE, the API operates in asynchronous mode.

VSID_TIMEOUT_VALUE Amount of time, in seconds, VolServ waits for status before timing-out to the client software for this request.

VSID_USER_FIELD A 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for each command. Neither the API software nor VolServ uses USER_FIELD.

1-20 Getting Started 601355 Rev A

Global Parameter Description · (defaults to 15)

Page 39 of the ADIC 601355 Rev A user manual — Getting Started
Page 39 · click to enlarge
Page 39

Global Variables

The following global variables are available to any software using the VolServ API.

VSG_Error Global error handle. It is set if an error condition occurs in a function that does not use a command handle. This includes the utility functions, handle functions, and the functions that set request- specific defaults.

Getting Started

See the man page for VS_Error_GetFields to learn how to access error codes.

VSG_Command_Received Pointer to the command handle whose status was just received from VolServ. The VSG_Command_Received can only be used in asynchronous processing.

601355 Rev A Getting Started 1-21

Global Variable Description

Page 40 of the ADIC 601355 Rev A user manual — API Error Handling
Page 40 · click to enlarge
Page 40

API Error Handling

The API differentiates between:

  • Errors that occur during API processing.
  • Errors that occur within VolServ.

To accomplish this, there are two identifying parts for each error—the first part identifies where the error occurred—the second part identifies the specific error.

The API tracks errors by using error handles. There is an error handle associated with each command, as well as a global error handle. The global error handle is used to track errors that cannot be associated directly with a command (e.g., bad handle type and null handle).

The error code returned by the API is of the form: AAANNN, where AAA is a three-letter string designating where the error originates, and NNN is a numeric code designating the specific error. The three-letter string maps either to an API object or to VolServ. The numeric code represents either an API internal error or the VolServ error code returned in the command’s status.

The following example shows how to access an error code:

int numcode, objcode; VST_ERROR_CODE errcode; VST_ERROR_HANDLE errorhandle;

VS_Error_GetFields (errorhandle, VSID_ERROR_OBJECT, &objcode,

1-22 Getting Started 601355 Rev A

VSID_ERROR_NUMBER, &numcode, · VSID_ERROR_CODE, errcode

Page 41 of the ADIC 601355 Rev A user manual — Getting Started
Page 41 · click to enlarge
Page 41

VSID_ENDFIELD);

printf ( “error code %s\n”, errcode ); printf ( “object code for error: %d\n”,

objcode ); printf ( “numeric code for error: %d\n”,

Getting Started

601355 Rev A Getting Started 1-23

numcode );

Page 42 of the ADIC 601355 Rev A user manual — Command Handle
Page 42 · click to enlarge
Page 42

Using the API

Command Handle

To send a command to VolServ, the client has to create a command handle in which the request and its status is kept. The command handle holds the information needed for the VolServ API to process the command. The information in the command handle is general for all commands (e.g., priority, time-out values). Most fields are defaulted to values that can be overridden by the client.

Command Calls Each command has one entry point - a call of the form: VSCMD_commandname

Each command accepts the command handle and a variable length argument list with parameter name and value pairs. Each parameter name and value pair specifies a command option and its corresponding value.

The options are divided into two parts: the general command options and the command-specific options. The general command options are fields contained in all requests (e.g., priority). The specific command options are fields particular to that type of request (e.g., archive name for the archive vary command). A specific command option may not be unique to one command, it can be used in several different commands. Each command call returns a boolean value that indicates its success or failure.

1-24 Getting Started 601355 Rev A

Page 43 of the ADIC 601355 Rev A user manual — VSID_ENDFIELD );
Page 43 · click to enlarge
Page 43

See the following example:

if ( VSCMD_Mount ( cmd_handle,

Getting Started

VSID_PRIORITY,1, VSID_ENDFIELD ) ) { printf ( “mount successful\n” ); }

Command Defaults

Options that are not passed in the argument list are defaulted to command-specific defaults. These defaults are kept on a command basis and can be set to client-desired values. The function to set command-specific defaults is of the form:

The defaults are specified in a variable length argument list with parameter name value pairs. The values in the command parameter list supersede global default values. See the following example:

VSID_PRIORITY, 1, VSID_MEDIACLASS_NAME,”scratch” VSID_DRIVEPOOL_NAME, ”defaultpool”, VSID_ENDFIELD);

VSID_ENDFIELD );

601355 Rev A Getting Started 1-25

Show 6 more labels / short text on this page
VSID_MEDIACLASS_NAME,”scratch” · VSID_DRIVEPOOL_NAME, ”stagepool”, · VSCMD_commandname_SetDefaults · VSCMD_Mount_SetDefaults ( · VSCMD_Mount (cmd_handle, · VSID_DRIVEPOOL_NAME,”stagepool”,
Page 44 of the ADIC 601355 Rev A user manual — (VST_COMMAND_HANDLE) NULL ) {
Page 44 · click to enlarge
Page 44

These two commands perform the same function as the previous example. The VSCMD_Mount_SetDefaults function sets command-specific defaults for all future Mount commands within this process. When the Mount command is issued, the parameters that are not specified are defaulted to the current command-specific defaults. The defaults specified by VSCMD_Mount_SetDefaults are valid only for Mount commands.

Command Status

After each status received from VolServ, the pertinent status fields are stored in a status handle within the command handle. The client can get the status handle from the command handle with the VS_Command_GetFields function. After the status handle is obtained, any command-specific field associated with the status can be obtained through the VS_Status_GetFields function. See to the following example:

VST_MEDIA_ID mediaid; VST_DRIVE_ID driveid; VST_STATUS status; VST_COMMAND_HANDLE cmd_handle; VST_STATUS_HANDLE status_handle;

if ( (cmd_handle = VS_Command_Create ())

(VST_COMMAND_HANDLE) NULL ) {

return ( -1 ); }

1-26 Getting Started 601355 Rev A

==

Page 45 of the ADIC 601355 Rev A user manual — VSID_ENDFIELD );
Page 45 · click to enlarge
Page 45

if ( VSCMD_Mount (cmd_handle,

VSID_ENDFIELD ) ) {

Getting Started

VSID_ENDFIELD );

if ( status == VSE_STATUS_OK )

VSID_ENDFIELD );

printf ( “Media [%s] mounted on drive,

[%d]\n”,mediaid, driveid ); } }

601355 Rev A Getting Started 1-27

Show 8 more labels / short text on this page
VSID_MEDIACLASS_NAME, ”scratch”, · VSID_DRIVEPOOL_NAME, ”stagepool” · VS_Command_GetFields ( cmd_handle, · VSID_STATUS, &status, VSID_STATUS_HANDLE,&status_handle, · { · VS_Status_GetFields ( status_handle, · VSID_MEDIA_ID, mediaid, · VSID_DRIVE_ID, &driveid,
Page 46 of the ADIC 601355 Rev A user manual — Processing
Page 46 · click to enlarge
Page 46

Processing The VolServ API allows for both asynchronous and synchronous processing of VolServ commands.

Asynchronous For asynchronous processing, the VolServ API returns control to the client after initial status is received.

1. Client Program calls the command function (VSCMD_ cmd ).
2. The VSCMD_ cmd calls the Volume Server.
3. VolServ returns initial status to VSCMD_ cmd.
4. VSCMD_ cmd returns control to the Client Program.
5. The Client Program calls the VS_Select loop to wait for status.
6. VS_Select calls the command specific VS_CallBack.
7. VS_CallBack returns status to the VS_Select.
8. VS_Select returns status to the Client Program.

To receive subsequent status from VolServ API, the client invokes the VolServ APIs VS_Select function. It is the responsibility of the client to place the VolServ API into its select loop so all subsequent statuses can be received. In asynchronous processing, the client can issue multiple VolServ commands and immediately receive their statuses.

1-28 Getting Started 601355 Rev A

Show 5 more labels / short text on this page
VSCMD_cmd · VS_Select Volume · Server · Client Program · VS_CallBack
Page 47 of the ADIC 601355 Rev A user manual — Getting Started
Page 47 · click to enlarge
Page 47

Asynchronous processing also gives the client more control over the processing environment. The VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. If the VSID_STATUS_WAIT_FLAG value is FALSE, the API operates in asynchronous mode.

Getting Started

Synchronous For synchronous processing, the VolServ API returns control to the client only after final status (or time-out) is received.

1. Client Program calls the command function (VSCMD_ cmd ).
2. The VSCMD_ cmd calls the Volume Server.
3. VolServ returns initial status to VSCMD_ cmd.
4. VSCMD_ cmd calls the VS_Select loop to wait for status.
5. VS_Select calls the command specific VS_Callback.
6. VS_Callback returns status to VS_Select.
7. VS_Select returns control to VSCMD_ cmd.
8. VSCMD_ cmd returns control to the Client Program.

Synchronous processing allows processing of only one command at a time. If the VSID_STATUS_WAIT_FLAG value is TRUE, the API operates in synchronous mode.

601355 Rev A Getting Started 1-29

Show 5 more labels / short text on this page
VSCMD_cmd · 7 8 Server · VS_Select Volume · Client Program · VS_CallBack
Page 48 of the ADIC 601355 Rev A user manual — API Functions
Page 48 · click to enlarge
Page 48

API Functions The API function descriptions in this book are presented as follows:

vsapi Provides a general introduction to VolServ API processing.

VS_cmdname Describes functions used to create, destroy, assign, and access handles. These functions are listed in alphabetical within the subgroup.

VSCMD_cmdname Describes how a user accesses VS commands through the API. These functions are listed in alphabetical order within the subgroup. The VolServ API allows for both asynchronous and synchronous processing of VolServ commands.

1-30 Getting Started 601355 Rev A

Function Description

Page 49 of the ADIC 601355 Rev A user manual — Getting Started
Page 49 · click to enlarge
Page 49

NOTES

Getting Started

601355 Rev A Getting Started 1-31

Page 50 of the ADIC 601355 Rev A user manual — NOTES
Page 50 · click to enlarge
Page 50

NOTES

1-32 Getting Started 601355 Rev A

Page 51 of the ADIC 601355 Rev A user manual — API Functions
Page 51 · click to enlarge
Page 51

VS_Archive_Destroy 2-11 VS_Archive_GetFields 2-15 VS_Archive_SetFields 2-25 VS_ArchiveMediaClass_Create 2-32 VS_ArchiveMediaClass_Destroy 2-36 VS_ArchiveMediaClass_GetFields 2-41 VS_ArchiveMediaClass_SetFields 2-49 VS_Command_Create 2-58 VS_Command_Destroy 2-61 VS_Command_GetErrorFields 2-65 VS_Command_GetFields 2-68 VS_Command_GetStatusFields 2-72 VS_Command_SetFields 2-82 VS_Component_Create 2-87 VS_Component_Destroy 2-93 VS_Component_GetFields 2-96 VS_Component_SetFields 2-100 VS_Connect_Create 2-107 VS_Connect_Destroy 2-110 VS_Connect_GetFields 2-114 VS_Connect_SetFields 2-118 VS_Criteria_Create 2-123 VS_Criteria_Destroy 2-129 VS_Criteria_GetFields 2-136 VS_Criteria_SetFields 2-142 VS_CriteriaGroup_Create 2-149 VS_CriteriaGroup_Destroy 2-155

API Functions

Page 52 of the ADIC 601355 Rev A user manual — API Functions
Page 52 · click to enlarge
Page 52

VS_CriteriaGroup_GetFields 2-161 VS_CriteriaGroup_SetFields 2-166 VS_Drive_Create 2-173 VS_Drive_Destroy 2-177 VS_Drive_GetFields 2-181 VS_Drive_SetFields 2-187 VS_DrivePool_Create 2-193 VS_DrivePool_Destroy 2-196 VS_DrivePool_GetFields 2-199 VS_DrivePool_SetFields 2-204 VS_Error_GetFields 2-208 VS_Expression_Create 2-212 VS_Expression_Destroy 2-218 VS_Expression_GetFields 2-225 VS_Expression_SetFields 2-231 VS_Global_GetFields 2-238 VS_Global_SetFields 2-243 VS_Initialize 2-249 VS_Media_Create 2-253 VS_Media_Destroy 2-257 VS_Media_GetFields 2-261 VS_Media_SetFields 2-267 VS_MediaClass_Create 2-273 VS_MediaClass_Destroy 2-278 VS_MediaClass_GetFields 2-283 VS_MediaClass_SetFields 2-291 VS_MediaType_Create 2-299 VS_MediaType_Destroy 2-302

Page 53 of the ADIC 601355 Rev A user manual — API Functions
Page 53 · click to enlarge
Page 53

VS_MediaType_GetFields 2-305 VS_MediaType_SetFields 2-309 VS_Mount_Create 2-313 VS_Mount_Destroy 2-318 VS_MediaClass_GetFields 2-322 VS_Mount_SetFields 2-331 VS_Notify_Create 2-339 VS_Notify_Destroy 2-344 VS_Notify_GetFields 2-349 VS_Notify_Listen 2-357 VS_Notify_SetFields 2-363 VS_Request_Create 2-370 VS_Request_Destroy 2-373 VS_Request_GetFields 2-376 VS_Request_SetFields 2-380 VS_Select 2-384 VS_Status_GetFields 2-387 VS_Table_AddEntry 2-401 VS_Table_Create 2-408 VS_Table_CreateAddEntry 2-415 VS_Table_Destroy 2-419 VS_Table_GetFields 2-423 VS_Table_RemoveEntry 2-427 VS_Table_SetFields 2-431 VS_Terminate 2-436 VS_TypeCapacity_Create 2-438 VS_TypeCapacity_Destroy 2-442 VS_TypeCapacity_GetFields 2-447

Page 54 of the ADIC 601355 Rev A user manual — API Functions
Page 54 · click to enlarge
Page 54

VS_TypeCapacity_SetFields 2-455 VSCMD_ArchiveQuery 2-462 VSCMD_ArchiveQuery_SetDefaults 2-472 VSCMD_ArchiveVary 2-478 VSCMD_ArchiveVary_SetDefaults 2-486 VSCMD_Audit 2-492 VSCMD_Audit_SetDefaults 2-501 VSCMD_Cancel 2-506 VSCMD_Cancel_SetDefaults 2-515 VSCMD_Checkin 2-521 VSCMD_Checkin_SetDefaults 2-530 VSCMD_Checkout 2-535 VSCMD_Checkout_SetDefaults 2-544 VSCMD_ClearEject 2-549 VSCMD_ClearEject_SetDefaults 2-558 VSCMD_Connect 2-564 VSCMD_Connect_SetDefaults 2-576 VSCMD_ConnectQuery 2-582 VSCMD_ConnectQuery_Set-Defaults 2-591 VSCMD_CreateArchiveMediaClass 2-596 VSCMD_CreateArchiveMediaClass_ SetDefaults 2-610 VSCMD_CreateMediaClass 2-620 VSCMD_CreateMediaClass_SetDefaults 2-633 VSCMD_DriveVary 2-641 VSCMD_DriveVary_SetDefaults 2-652 VSCMD_Export 2-660 VSCMD_Export_SetDefaults 2-669

Page 55 of the ADIC 601355 Rev A user manual — API Functions
Page 55 · click to enlarge
Page 55

VSCMD_Import 2-674 VSCMD_Import_SetDefaults 2-684 VSCMD_IntransitQuery 2-689 VSCMD_IntransitQuery_SetDefaults 2-697 VSCMD_Lock 2-702 VSCMD_Lock_SetDefaults 2-712 VSCMD_MediaClass-Query 2-718 VSCMD_MediaClassQuery_SetDefaults 2-727 VSCMD_MediaQuery 2-732 VSCMD_MediaQuery_SetDefaults 2-740 VSCMD_MediaTypeQuery 2-745 VSCMD_MediaTypeQuery_SetDefaults 2-754 VSCMD_ModifyMedia 2-760 VSCMD_ModifyMedia_SetDefaults 2-770 VSCMD_CreatePool 2-777 VSCMD_CreatePool_SetDefaults 2-786 VSCMD_DeleteArchiveMediaClass 2-792 VSCMD_DeleteArchiveMediaClass_ SetDefaults 2-801 VSCMD_DeleteMediaClass 2-807 VSCMD_DeleteMediaClass_SetDefaults 2-815

VSCMD_DeletePool 2-820 VSCMD_DeletePool_SetDefaults 2-828 VSCMD_Disconnect 2-833 VSCMD_Disconnect_SetDefaults 2-843 VSCMD_Dismount 2-850 VSCMD_Dismount_SetDefaults 2-859 VSCMD_DrivePoolQuery 2-865

Page 56 of the ADIC 601355 Rev A user manual — API Functions
Page 56 · click to enlarge
Page 56

VSCMD_DrivePoolQuery_SetDefaults 2-874 VSCMD_DriveQuery 2-880 VSCMD_DriveQuery_SetDefaults 2-889 VSCMD_ModifyArchiveMediaClass 2-895 VSCMD_ModifyArchiveMediaClass_ SetDefaults 2-909 VSCMD_ModifyMediaClass 2-915 VSCMD_ModifyMediaClass_SetDefaults 2-928 VSCMD_ModifyPool 2-936 VSCMD_ModifyPool_SetDefaults 2-946 VSCMD_Mount 2-952 VSCMD_Mount_SetDefaults 2-968 VSCMD_Move 2-976 VSCMD_Move_SetDefaults 2-987 VSCMD_MultiMount 2-993 VSCMD_MultiMount_SetDefaults 2-1004 VSCMD_Ping 2-1010 VSCMD_QueryMount 2-1014 VSCMD_QueryMount_SetDefaults 2-1023 VSCMD_Reclassify 2-1028 VSCMD_Reclassify_SetDefaults 2-1040 VSCMD_Reprioritize 2-1046 VSCMD_Reprioritize_SetDefaults 2-1055 VSCMD_RequestQuery 2-1061 VSCMD_RequestQuery_SetDefaults 2-1070 VSCMD_Unlock 2-1075 VSCMD_Unlock_SetDefaults 2-1083

Page 57 of the ADIC 601355 Rev A user manual — Roadmap
Page 57 · click to enlarge
Page 57

Roadmap

Naming conventions.

Global parameters.

Error handling.

API functions. 2

Valid staus fields. A

Error codes. B

Mount example. C

Topic Refer To · Chapter

Page 58 of the ADIC 601355 Rev A user manual — Synopsis VST_ARCHIVE_HANDLE VS_Archive_Create ( void )
Page 58 · click to enlarge
Page 58

VS_Archive_ Create

VS_Archive_Create allocates a VolServ API archive handle. An archive handle is used to pass archive information to and from VolServ.

Synopsis VST_ARCHIVE_HANDLE VS_Archive_Create ( void )

Return Values VS_Archive_Create returns:

  • An archive handle, if one can be allocated.
  • NULL, if an archive handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_archive_handle 4 * 5 * PURPOSE: 6 * This function tests an archive handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_archive_handle(void) 14 #else 15 VST_BOOLEAN vst_archive_handle(void) 16 #endif 17 {

Arguments None · Example 1 /****************************************

Page 59 of the ADIC 601355 Rev A user manual — VS_Archive_Create
Page 59 · click to enlarge
Page 59

18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_ARCHIVE_HANDLE h; 20 VST_ARCHIVE_TYPE

ArchiveMode; 25 VST_ARCHIVE_FILL_MODE FillMode; 26 VST_ARCHIVE_CONFIG_STATE

ConfigState; 27 28 /* create the handle */ 29 h = VS_Archive_Create(); 30 if (h != (VST_ARCHIVE_HANDLE) NULL) 31 { 32 /* get values from user */ 33 printf(“*** Archive Handle ***\n”); 34 printf(“Enter Archive Type ==> “); 35 ArchiveType = atoi(gets(input));; 36 printf(“Enter Archive Name ==> “); 37 gets(ArchiveName); 38 printf(“Enter Console Display Location ==> “); 39 gets(ConsoleLoc); 40 printf(“Enter archive state ==> “); 41 ComponentState = atoi(gets(input)); 42 printf(“Enter Archive Mode ==> “); 43 ArchiveMode = atoi(gets(input)); 44 printf(“Enter Fill Mode ==> “); 45 FillMode = atoi(gets(input));; 46 printf(“Enter Config State ==> “); 47 ConfigState = atoi(gets(input));; 48 /* set the fields in the handle */

Show 4 more labels / short text on this page
ArchiveType; 21 VST_ARCHIVE_NAME · ArchiveName; 22 VST_HOSTNAME · ConsoleLoc; 23 VST_COMP_STATE · ComponentState; 24 VST_ARCHIVE_MODE
Page 60 of the ADIC 601355 Rev A user manual — See Also
Page 60 · click to enlarge
Page 60

49 rc = VS_Archive_SetFields(h, 50 VSID_ARCHIVE_NAME, ArchiveName, 51 VSID_ARCHIVE_TYPE, ArchiveType, 52 VSID_ARCHIVE_CONSOLE_LOCATION,Con soleLoc, 53 VSID_COMP_STATE, ComponentState, 54 VSID_ARCHIVE_MODE, ArchiveMode, 55 VSID_ARCHIVE_FILL_MODE, FillMode, 56 VSID_ARCHIVE_CONFIG_STATE, ConfigState, 57 VSID_ENDFIELD); 58 if (rc) 59 { 60 vst_print_archive(h); 61 } 62 VS_Archive_Destroy(h); 63 } 64 return(rc); 65 }

See Also • vsapi(l),

  • VS_Archive_Destroy(l),
  • VS_Archive_GetFields(l),
  • VS_Archive_SetFields(l),
  • VS_Error_GetFields(l)
Page 61 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Archive_Destroy (VST _ ARCHIVE _ HANDLE handle)
Page 61 · click to enlarge
Page 61

VS_Archive_ Destroy

VS_Archive_Destroy deallocates an archive handle that was allocated with VS_Archive_Create. An archive handle is used to pass archive information to and from VolServ.

Synopsis VST_BOOLEAN VS_Archive_Destroy (VST _ ARCHIVE _ HANDLE handle)

Arguments • handle = Archive handle to destroy.

Return Values • VS_Archive_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not an archive handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Example 66 /*************************************** ********** 67 * FUNCTION: vst_archive_handle 68 * 69 * PURPOSE: 70 * This function tests an archive handle. 71 * PARAMETERS: 72 * none 73 * 74 **************************************** *********/ 75 #ifdef ANSI_C 76 VST_BOOLEAN vst_archive_handle(void) 77 #else

Page 62 of the ADIC 601355 Rev A user manual — VS_Archive_ Destroy
Page 62 · click to enlarge
Page 62

78 VST_BOOLEAN vst_archive_handle(void) 79 #endif 80 { 81 VST_BOOLEAN rc = VSE_FALSE; 82 VST_ARCHIVE_HANDLE h; 83 VST_ARCHIVE_TYPE

ArchiveMode; 88 VST_ARCHIVE_FILL_MODE FillMode; 89 VST_ARCHIVE_CONFIG_STATE

ConfigState; 90 91 /* create the handle */ 92 h = VS_Archive_Create(); 93 if (h != (VST_ARCHIVE_HANDLE) NULL) 94 { 95 /* get values from user */ 96 printf(“*** Archive Handle ***\n”); 97 printf(“Enter Archive Type ==> “); 98 ArchiveType = atoi(gets(input));; 99 printf(“Enter Archive Name ==> “); 100 gets(ArchiveName); 101 printf(“Enter Console Display Location ==> “); 102 gets(ConsoleLoc); 103 printf(“Enter archive state ==> “); 104 ComponentState = atoi(gets(input)); 105 printf(“Enter Archive Mode ==> “); 106 ArchiveMode = atoi(gets(input)); 107 printf(“Enter Fill Mode ==> “); 108 FillMode = atoi(gets(input));;

Show 4 more labels / short text on this page
ArchiveType; 84 VST_ARCHIVE_NAME · ArchiveName; 85 VST_HOSTNAME · ConsoleLoc; 86 VST_COMP_STATE · ComponentState; 87 VST_ARCHIVE_MODE
Page 63 of the ADIC 601355 Rev A user manual — Notes
Page 63 · click to enlarge
Page 63

109 printf(“Enter Config State ==> “); 110 ConfigState = atoi(gets(input));; 111 /* set the fields in the handle */ 112 rc = VS_Archive_SetFields(h, 113 VSID_ARCHIVE_NAME, ArchiveName, 114 VSID_ARCHIVE_TYPE, ArchiveType, 115 VSID_ARCHIVE_CONSOLE_LOCATION,Con soleLoc, 116 VSID_COMP_STATE, ComponentState, 117 VSID_ARCHIVE_MODE, ArchiveMode, 118 VSID_ARCHIVE_FILL_MODE, FillMode, 119 VSID_ARCHIVE_CONFIG_STATE, ConfigState, 120 VSID_ENDFIELD); 121 if (rc) 122 { 123 vst_print_archive(h); 124 } 125 VS_Archive_Destroy(h); 126 } 127return(rc); 128}

Page 64 of the ADIC 601355 Rev A user manual — See Also
Page 64 · click to enlarge
Page 64

See Also • vsapi(l),

  • VS_Archive_Create(l),
  • VS_Archive_GetFields(l),
  • VS_Archive_SetFields(l),
  • VS_Error_GetFields(l)
Page 65 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_CONSOLE_LOCATION (VST_HOSTNAME)
Page 65 · click to enlarge
Page 65

VS_Archive_ GetFields

VS_Archive_GetFields retrieves information associated with an archive handle. An archive handle is used to pass archive information to and from VolServ.

Synopsis VST_BOOLEAN VS_Archive_GetFields (VST_ARCHIVE_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Archive handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_CONFIG_STATE (VST_ARCHIVE_CONFIG_STATE*)

Pointer to a boolean flag that indicates whether the archive is currently being configured or reconfigured.

Valid VSID_ARCHIVE_CONFG_STATE values are enumerated in the vs_types.h file.

VSID_ARCHIVE_CONSOLE_LOCATION (VST_HOSTNAME)

Pointer to the location of the archive’s console display.

Parameters · Parameter Type Description

Page 66 of the ADIC 601355 Rev A user manual — VSID_ARCHIVEMEDIACLASS_HANDLE_TA BLE (VST_TABLE_HANDLE *)
Page 66 · click to enlarge
Page 66

VSID_ARCHIVE_FILL_MODE (VST_ARCHIVE_FILL_MODE*)

Pointer to the method of allocating bins to new media as they are entered into an archive. VSID_ARCHIVE_FILL_MODE is applicable only to the DataShelf and DataLibrary archives. Valid VSID_ARCHIVE_FILL_MODE values are enumerated in the vs_types.h file.

VSID_ARCHIVE_MODE (VST_ARCHIVE_MODE *)

Pointer that specifies whether this archive is attended by an operator to handle media movement commands that require human intervention. Valid VSID_ARCHIVE_MODE values are enumerated in the vs_types.h file.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of this archive. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ARCHIVE_TYPE (VST_ARCHIVE_TYPE *)

Pointer to the type of this archive. Valid VSID_ARCHIVE_TYPE values are enumerated in the vs_types.h file.

VSID_ARCHIVEMEDIACLASS_HANDLE (int) Index of the archive media class handle in the MediaClass capacity table.

(VST_ARCHIVEMEDIACLASS_HANDLE *) Pointer to the first archive media class handle in the MediaClass capacity table.

Index of the archive media class handle in the MediaClass capacity table.

Pointer to the location to store the archive media class handle.

VSID_ARCHIVEMEDIACLASS_HANDLE_TA BLE (VST_TABLE_HANDLE *)

Pointer to the MediaClass capacity (in table format) for this archive.

VSID_COMP_STATE (VST_COMP_STATE *) Pointer to the operational state of this archive.

Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_DRIVE_ID (int) Index of the drive in the drive identifier table.

Parameter Type Description · VSID_ARCHIVEMEDIACLASS_HANDLE_EN TRY (int,VST_ARCHIVEMEDIACLASS_HANDLE)

Page 67 of the ADIC 601355 Rev A user manual — VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE *)
Page 67 · click to enlarge
Page 67

(VST_DRIVE_ID *) Pointer to the first drive id in the drive identifier table.

VSID_DRIVE_ID_ENTRY (int, VST_Drive_ID *)

Index of the drive in the drive identifier table.

Pointer to the location to store the drive identifier

VSID_DRIVE_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the drives (in table format) associated with this archive.

VSID_MEDIA_ID (int) Index of the medium in the media identifier table.

(VST_MEDIA_ID ) Pointer to the first media id in the media identifier table.

VSID_MEDIA_ID_ENTRY (int, VST_ MEDIA_ID)

Index of the medium in the media identifier table.

Pointer to the location to store the media identifier.

VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the media identifiers (in table format) that are currently in this archive.

VSID_NUMBER_ARCHIVEMEDIACLASS_H ANDLES (int *)

Pointer to the number of archive media class handles present in the archive media class handle table.

VSID_NUMBER_DRIVE_ID (int *) Pointer to the number of drive ids present in the drive id table.

VSID_NUMBER_MEDIA_IDS (int *) Pointer to the number of media ids present in the media id table.

VSID_NUMBER_TYPECAPACITY_HANDLE S (int *)

Pointer to the number of type capacity handles present in the type capacity handle table.

VSID_TYPECAPACITY_HANDLE (int) Index of the type capacity handle in the table.

(VST_TYPECAPACITY_HANDLE *) Pointer to the first archive type capacity handle in the MediaType capacity table.

Parameter Type Description

Page 68 of the ADIC 601355 Rev A user manual — VSID_TYPECAPACITY_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 68 · click to enlarge
Page 68

VSID_TYPECAPACITY_HANDLE_ENTRY (int, VSID_TYPECAPACITY_HANDLE *)

Index of the type capacity handle in the MediaType capacity table.

Pointer to the location to store the type capacity handle.

VSID_TYPECAPACITY_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the type capacity (in table format) for this archive.

Return Values VS_Archive_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an archive handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_OUTOFRANGE - An index value was out of range.

Parameter Type Description

Page 69 of the ADIC 601355 Rev A user manual — Example
Page 69 · click to enlarge
Page 69

Example 129/************************************** *********** 130* 131* FUNCTION: vst_print_archive 132* 133* PURPOSE: 134* This function prints out the information stored in 135* an archive handle. 136* 137* PARAMETERS: 138* h : the archive handle to print 139* 140*************************************** **********/ 141#ifdef ANSI_C 142 void

vst_print_archive(VST_ARCHIVE_HAN DLE h) 143#else 144 void vst_print_archive(h) 145 VST_ARCHIVE_HANDLE h; 146#endif 147{ 148 VST_ARCHIVE_TYPE

ArchiveMode; 153 VST_ARCHIVE_FILL_MODE FillMode; 154 VST_ARCHIVE_CONFIG_STATE

Show 7 more labels / short text on this page
ArchiveType; 149 VST_ARCHIVE_NAME · ArchiveName; 150 VST_HOSTNAME · ConsoleLoc; 151 VST_COMP_STATE · ComponentState; 152 VST_ARCHIVE_MODE · ConfigState; 155 VST_TABLE_HANDLE · DriveIDTable; 156 VST_TABLE_HANDLE · MediaIDTable;
Page 70 of the ADIC 601355 Rev A user manual — 157 VST_TABLE_HANDLE
Page 70 · click to enlarge
Page 70

157 VST_TABLE_HANDLE

TypeCapacityHandleTable; 159 int n; 160 int i; 161 VST_DRIVE_ID *

DriveID; 162 char *

typecap_handle; 165 166 VS_Archive_GetFields(h, 167 VSID_ARCHIVE_NAME, ArchiveName, 168 VSID_ARCHIVE_TYPE, &ArchiveType, 169 VSID_ARCHIVE_CONSOLE_LOCATION, ConsoleLoc, 170 VSID_COMP_STATE, &ComponentState, 171 VSID_ARCHIVE_MODE, &ArchiveMode, 172 VSID_ARCHIVE_FILL_MODE, &FillMode, 173 VSID_ARCHIVE_CONFIG_STATE, &ConfigState, 174 VSID_DRIVE_ID_TABLE, &DriveIDTable, 175 VSID_MEDIA_ID_TABLE, &MediaIDTable, 176 VSID_ARCHIVEMEDIACLASS_HANDLE_TAB LE, &ClassCapacityTable, 177 VSID_TYPECAPACITY_HANDLE_TABLE, &TypeCapacityHandleTable, 178 VSID_ENDFIELD); 179

ClassCapacityTable; 158 VST_TABLE_HANDLE · MediaID; 163 VST_ARCHIVEMEDIACLASS_HANDLE · arcmc_handle; 164 VST_TYPECAPACITY_HANDLE

Page 71 of the ADIC 601355 Rev A user manual — Example
Page 71 · click to enlarge
Page 71

180 printf(“*** Archive Handle

Information ***\n”); 181 printf(“Archive Type = %d\n”,

ArchiveType); 182 printf(“Archive Name = %s\n”,

ArchiveName); 183 printf(“Console Display Location =

%s\n”, ConsoleLoc); 184 printf(“Component State = %d\n”,

ComponentState); 185 printf(“Archive Mode = %d\n”,

ArchiveMode); 186 printf(“Archive Fill Mode = %d\n”,

FillMode); 187 printf(“Config State = %d\n”,

ConfigState); 188 189 if (DriveIDTable !=

(VST_TABLE_HANDLE) NULL) 190 { 191 /* Get # of entries */ 192 VS_Table_GetFields(DriveIDTable, 193 VSID_NUMBER_ENTRIES, &n, 194 VSID_ENDFIELD); 195 for ( i = 0; i < n; i++) 196 { 197 VS_Table_GetFields(DriveIDTable, 198 VSID_TABLE_ENTRY, i, &DriveID, 199 VSID_ENDFIELD); 200 printf(“DriveID Entry #%d = %d\n”,i,*DriveID); 201 } 202 } 203 204 if (MediaIDTable !=

(VST_TABLE_HANDLE) NULL) 205 { 206 /* Get # of entries */ 207 VS_Table_GetFields(MediaIDTable,

Page 72 of the ADIC 601355 Rev A user manual — (VST_TABLE_HANDLE) NULL) 235 {
Page 72 · click to enlarge
Page 72

208 VSID_NUMBER_ENTRIES, &n, 209 VSID_ENDFIELD); 210 for ( i = 0; i < n; i++) 211 { 212 VS_Table_GetFields(MediaIDTable, 213 VSID_TABLE_ENTRY, i, &MediaID, 214 VSID_ENDFIELD); 215 printf(“Media ID Entry #%d = %s\n”,i,MediaID); 216 } 217 } 218 219 if (ClassCapacityTable !=

(VST_TABLE_HANDLE) NULL) 220 { 221 /* Get # of entries */ 222 VS_Table_GetFields(ClassCapacityT able, 223 VSID_NUMBER_ENTRIES, &n, 224 VSID_ENDFIELD); 225 for ( i = 0; i < n; i++) 226 { 227 VS_Table_GetFields(ClassCapacityT able, 228 VSID_TABLE_ENTRY, i, &arcmc_handle, 229 VSID_ENDFIELD); 230 vst_print_archivemediaclass(arcmc _handle); 231 } 232 } 233 234 if (TypeCapacityHandleTable !=

(VST_TABLE_HANDLE) NULL) 235 {

Page 73 of the ADIC 601355 Rev A user manual — Note
Page 73 · click to enlarge
Page 73

236 /* Get # of entries */ 237 VS_Table_GetFields(TypeCapacityHa ndleTable, 238 VSID_NUMBER_ENTRIES, &n, 239 VSID_ENDFIELD); 240 for ( i = 0; i < n; i++) 241 { 242 VS_Table_GetFields(TypeCapacityHa ndleTable, 243 VSID_TABLE_ENTRY, i, &typecap_handle, 244 VSID_ENDFIELD); 245 vst_print_typecapacity(typecap_ha ndle); 246 } 247 } 248}

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

VolServ assigns additional bins according to one of two user-specified algorithms: “wrap” or “first fill.” Using the wrap algorithm, VolServ assigns additional bins in order until the last bin in the archive has been assigned. VolServ then wraps to the first physical bin, goes through the bins in order, and assigns empty bins as they are encountered. Using the first fill algorithm, VolServ starts looking for an available bin at the first physical bin location. The first empty, on-line bin encountered is assigned.

Page 74 of the ADIC 601355 Rev A user manual — See Also
Page 74 · click to enlarge
Page 74

The VST_ARCHIVEMEDIACLASS_HANDLE, VST_DRIVE_ID, VST_MEDIA_ID, and VST_TYPECAPACITY_HANDLE parameters require that two arguments be passed instead of one.

  • The first argument passed is the entry number in the appropriate table.
  • The second argument is Pointer to the location where the value is stored.

See Also • vsapi(l),

  • VS_Archive_Create(l),
  • VS_Archive_Destroy(l),
  • VS_Archive_SetFields(l),
  • VS_ArchiveMediaClass_GetFields(l),
  • VS_ArchiveMediaClass_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Table_GetFields(l),
  • VS_TypeCapacity_GetFields(l),
  • VS_TypeCapacity_SetFields(l),
  • VSCMD_Archive_Query(l
Page 75 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_CONSOLE_LOCATION (VST_HOSTNAME)
Page 75 · click to enlarge
Page 75

VS_Archive_ SetFields

VS_Archive_SetFields sets the value of one or more field in an archive handle. An archive handle is used to pass archive information to and from VolServ.

Synopsis VST_BOOLEAN VS_Archive_SetFields (VST_ARCHIVE_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Archive handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_CONFIG_STATE (VST_ARCHIVE_CONFIG_STATE)

A boolean flag that indicates whether the archive is currently being configured or reconfigured. Valid VSID_ARCHIVE_CONFIG_STATE values are enumerated in the vs_types.h file.

VSID_ARCHIVE_CONSOLE_LOCATION (VST_HOSTNAME)

The location of the archive’s console display.

Parameters · Parameter Type Description

Page 76 of the ADIC 601355 Rev A user manual — VSID_TYPECAPACITY_HANDLE_TABLE (VST_TABLE_HANDLE)
Page 76 · click to enlarge
Page 76

VSID_ARCHIVE_FILL_MODE (VST_ARCHIVE_FILL_MODE)

The method of allocating bins to new media as they are entered into an archive. VSID_ARCHIVE_FILL_MODE is applicable only to the DataShelf and DataLibrary archives.

Valid VSID_ARCHIVE_FILL_MODE values are enumerated in the vs_types.h file.

VSID_ARCHIVEMEDIACLASS_HANDLE_TA BLE (VST_TABLE_HANDLE)

The MediaClass capacity (in table format) for this archive.

VSID_ARCHIVE_MODE (VST_ARCHIVE_MODE)

Specifies whether this archive is attended by an operator to handle media movement commands that require human intervention. Valid VSID_ARCHIVE_MODE values are enumerated in the vs_types.h file.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The name of this archive. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ARCHIVE_TYPE (VST_ARCHIVE_TYPE)

Type of this archive. Valid VSID_ARCHIVE_TYPE values are enumerated in the vs_types.h file.

VSID_COMP_STATE (VST_COMP_STATE) The operational state of this archive. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_DRIVE_ID_TABLE (VST_TABLE_HANDLE)

The drive identifiers (in table format) associated with this archive.

VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE)

The media identifiers (in table format) that are currently in this archive.

VSID_TYPECAPACITY_HANDLE_TABLE (VST_TABLE_HANDLE)

The type capacity (in table format) for this archive.

Parameter Type Description

Page 77 of the ADIC 601355 Rev A user manual — Return Values
Page 77 · click to enlarge
Page 77

Return Values VS_Archive_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a criteria handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Example 249/************************************** *********** 250* 251* FUNCTION: vst_archive_handle 252* 253* PURPOSE: 254* This function tests an archive handle. 255* 256* PARAMETERS: 257* none 258* 259*************************************** **********/ 260#ifdef ANSI_C 261 VST_BOOLEAN vst_archive_handle(void) 262#else 263 VST_BOOLEAN vst_archive_handle(void) 264#endif 265{ 266 VST_BOOLEAN rc = VSE_FALSE;

Page 78 of the ADIC 601355 Rev A user manual — Return Values
Page 78 · click to enlarge
Page 78

267 VST_ARCHIVE_HANDLE h; 268 VST_ARCHIVE_TYPE

ArchiveMode; 273 VST_ARCHIVE_FILL_MODE FillMode; 274 VST_ARCHIVE_CONFIG_STATE

ConfigState; 275 276 /* create the handle */ 277 h = VS_Archive_Create(); 278 if (h != (VST_ARCHIVE_HANDLE) NULL) 279 { 280 /* get values from user */ 281 printf(“*** Archive Handle ***\n”); 282 printf(“Enter Archive Type ==> “); 283 ArchiveType = atoi(gets(input));; 284 printf(“Enter Archive Name ==> “); 285 gets(ArchiveName); 286 printf(“Enter Console Display Location ==> “); 287 gets(ConsoleLoc); 288 printf(“Enter archive state ==> “); 289 ComponentState = atoi(gets(input)); 290 printf(“Enter Archive Mode ==> “); 291 ArchiveMode = atoi(gets(input)); 292 printf(“Enter Fill Mode ==> “); 293 FillMode = atoi(gets(input));; 294 printf(“Enter Config State ==> “); 295 ConfigState = atoi(gets(input));; 296 /* set the fields in the handle */ 297 rc = VS_Archive_SetFields(h,

Show 4 more labels / short text on this page
ArchiveType; 269 VST_ARCHIVE_NAME · ArchiveName; 270 VST_HOSTNAME · ConsoleLoc; 271 VST_COMP_STATE · ComponentState; 272 VST_ARCHIVE_MODE
Page 79 of the ADIC 601355 Rev A user manual — Note
Page 79 · click to enlarge
Page 79

298 VSID_ARCHIVE_NAME, ArchiveName, 299 VSID_ARCHIVE_TYPE, ArchiveType, 300 VSID_ARCHIVE_CONSOLE_LOCATION, ConsoleLoc, 301 VSID_COMP_STATE, ComponentState, 302 VSID_ARCHIVE_MODE, ArchiveMode, 303 VSID_ARCHIVE_FILL_MODE, FillMode, 304 VSID_ARCHIVE_CONFIG_STATE, ConfigState, 305 VSID_ENDFIELD); 306 if (rc) 307 { 308 vst_print_archive(h); 309 } 310 VS_Archive_Destroy(h); 311 } 312return(rc); 313}

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 80 of the ADIC 601355 Rev A user manual — Notes
Page 80 · click to enlarge
Page 80

VolServ assigns additional bins according to one of two user-specified algorithms: “wrap” or “first fill.” Using the wrap algorithm, VolServ assigns additional bins in order until the last bin in the archive has been assigned. VolServ then wraps to the first physical bin, goes through the bins in order, and assigns empty bins as they are encountered. Using the first fill algorithm, VolServ starts looking for an available bin at the first physical bin location. The first empty, on-line bin encountered is assigned.

Page 81 of the ADIC 601355 Rev A user manual — See Also
Page 81 · click to enlarge
Page 81

See Also • vsapi(l),

  • VS_Archive_Create(l),
  • VS_Archive_Destroy(l),
  • VS_Archive_SetFields(l),
  • VS_ArchiveMediaClass_GetFields(l),
  • VS_ArchiveMediaClass_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Table_Create(l),
  • VS_Table_Destroy(l),
  • VS_Table_GeFields(l),
  • VS_Table_SetFields(l),
  • VS_TypeCapacity_GetFields(l),
  • VS_TypeCapacity_SetFields(l)
Page 82 of the ADIC 601355 Rev A user manual — Synopsis VST_ARCHIVEMEDIACLASS_HANDLE VS_ArchiveMediaClass_Create ( void )
Page 82 · click to enlarge
Page 82

VS_Archive MediaClass_ Create

VS_ArchiveMediaClass_Create allocates a VolServ API archive media class handle. An archive media class handle is used to pass archive media class information to and from VolServ.

Synopsis VST_ARCHIVEMEDIACLASS_HANDLE VS_ArchiveMediaClass_Create ( void )

Return Values VS_ArchiveMediaClass_Create returns:

  • An archive media class handle, if one can be allocated.
  • NULL, if an archive media class handle cannot be allocated. An appropriate error code is set in VSG_Error.
  • VSE_ERR_OUTOFMEM - Memory allocation error.

Example 314/************************************** *********** 315* 316* FUNCTION: vst_archivemediaclass_handle 317* 318* PURPOSE: 319* This function tests an archivemediaclass handle. 320* 321* PARAMETERS: 322* none 323* 324*************************************** **********/

Arguments None

Page 83 of the ADIC 601355 Rev A user manual — VS_Archive MediaClass_ Create
Page 83 · click to enlarge
Page 83

325#ifdef ANSI_C 326 VST_BOOLEAN

vst_archivemediaclass_handle(void ) 327#else 328 VST_BOOLEAN

vst_archivemediaclass_handle() 329#endif 330{ 331 VST_BOOLEAN rc; 332 VST_ARCHIVEMEDIACLASS_HANDLE h; 333 VST_ARCHIVE_NAME

TargetArchive; 344 345 /* create the handle */ 346 h = VS_ArchiveMediaClass_Create(); 347 if (h !=

(VST_ARCHIVEMEDIACLASS_HANDLE) NULL) 348 { 349 /* get the values from the user */

Show 10 more labels / short text on this page
Archive; 334 VST_MEDIA_CLASS_NAME · MediaClass; 335 VST_MEDIA_TYPE_NAME · MediaType; 336 VST_CAPACITY · Capacity; 337 VST_PERCENT · MediaClassPercent; 338 VST_ARCHIVE_ACTION_OPTION · ActionMode; 339 VST_HIGH_MARK · HighMark; 340 VST_LOW_MARK · LowMark; 341 VST_FILL_LEVEL · FillLevel; 342 VST_PRIORITY · MigrationPriority; 343 VST_ARCHIVE_NAME
Page 84 of the ADIC 601355 Rev A user manual — VS_Archive MediaClass_ Create
Page 84 · click to enlarge
Page 84

350 printf(“** Archive Media Class handle **\n”); 351 printf(“Enter Archive Name ==> “); 352 gets(Archive); 353 printf(“Enter Media Class Name ==> “); 354 gets(MediaClass); 355 printf(“Enter Media Type Name ==> “); 356 gets(MediaType); 357 printf(“Enter Capacity ==> “); 358 Capacity = atoi(gets(input)); 359 printf(“Enter MediaClass Percent ==> “); 360 MediaClassPercent = atoi(gets(input)); 361 printf(“Enter Archive Action Mode ==> “); 362 ActionMode = atoi(gets(input)); 363 printf(“Enter High Mark Mode ==> “); 364 HighMark = atoi(gets(input)); 365 printf(“Enter Fill Level Mode ==> “); 366 FillLevel = atoi(gets(input)); 367 printf(“Enter Migration Priority ==> “); 368 MigrationPriority = atoi(gets(input)); 369 printf(“Enter Target Archive ==> “); 370 gets(TargetArchive); 371 rc = VS_ArchiveMediaClass_SetFields(h, 372 VSID_ARCHIVE_NAME, Archive, 373 VSID_MEDIA_CLASS_NAME, MediaClass, 374 VSID_MEDIA_TYPE_NAME, MediaType, 375 VSID_CAPACITY, Capacity,

Page 85 of the ADIC 601355 Rev A user manual — Notes
Page 85 · click to enlarge
Page 85

376 VSID_PERCENT, MediaClassPercent, 377 VSID_ARCHIVE_ACTION, ActionMode, 378 VSID_HIGH_MARK, HighMark, 379 VSID_LOW_MARK, LowMark, 380 VSID_FILL_LEVEL, FillLevel, 381 VSID_MIGRATION_PRIORITY,Migration Priority, 382 VSID_TARGET_ARCHIVE_NAME,TargetAr chive, 383 VSID_ENDFIELD); 384 if (rc) 385 { 386 vst_print_archivemediaclass(h); 387 } 388 VS_ArchiveMediaClass_Destroy(h); 389 } 390 return(rc); 391}

See Also • vsapi(l),

  • VS_ArchiveMediaClass_Destroy(l)
  • VS_ArchiveMediaClass_GetFields(l),
  • VS_ArchiveMediaClass_SetFields(l),
  • VS_Error_GetFields(l)
Page 86 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_ArchiveMediaClass_Destroy (VST_ARCHIVEMEDIACLASS _HANDLE handle)
Page 86 · click to enlarge
Page 86

VS_Archive MediaClass_ Destroy

VS_ArchiveMediaClass_Destroy deallocates an archive media class handle that was allocated with VS_ArchiveMediaClass_Create.

Synopsis VST_BOOLEAN VS_ArchiveMediaClass_Destroy (VST_ARCHIVEMEDIACLASS _HANDLE handle)

Arguments • handle = Archive media class handle to be destroyed.

Return Values VS_ArchiveMediaClass_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not an archive media class handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_archivemediaclass_handle 4 * 5 * PURPOSE: 6 * This function tests an archivemediaclass handle. 7 *

Example 1 /****************************************

Page 87 of the ADIC 601355 Rev A user manual — VS_Archive MediaClass_ Destroy
Page 87 · click to enlarge
Page 87
8 * PARAMETERS9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_archivemediaclass_handle(void ) 14 #else 15 VST_BOOLEAN

vst_archivemediaclass_handle() 16 #endif 17 { 18 VST_BOOLEAN rc; 19 VST_ARCHIVEMEDIACLASS_HANDLE h; 20 VST_ARCHIVE_NAME

TargetArchive; 31 32 /* create the handle */ 33 h = VS_ArchiveMediaClass_Create();

Show 10 more labels / short text on this page
Archive; 21 VST_MEDIA_CLASS_NAME · MediaClass; 22 VST_MEDIA_TYPE_NAME · MediaType; 23 VST_CAPACITY · Capacity; 24 VST_PERCENT · MediaClassPercent; 25 VST_ARCHIVE_ACTION_OPTION · ActionMode; 26 VST_HIGH_MARK · HighMark; 27 VST_LOW_MARK · LowMark; 28 VST_FILL_LEVEL · FillLevel; 29 VST_PRIORITY · MigrationPriority; 30 VST_ARCHIVE_NAME
Page 88 of the ADIC 601355 Rev A user manual — VS_Archive MediaClass_ Destroy
Page 88 · click to enlarge
Page 88

34 if (h !=

(VST_ARCHIVEMEDIACLASS_HANDLE) NULL) 35 { 36 /* get the values from the user */ 37 printf(“** Archive Media Class handle **\n”); 38 printf(“Enter Archive Name ==> “); 39 gets(Archive); 40 printf(“Enter Media Class Name ==> “); 41 gets(MediaClass); 42 printf(“Enter Media Type Name ==> “); 43 gets(MediaType); 44 printf(“Enter Capacity ==> “); 45 Capacity = atoi(gets(input)); 46 printf(“Enter MediaClass Percent ==> “); 47 MediaClassPercent = atoi(gets(input)); 48 printf(“Enter Archive Action Mode ==> “); 49 ActionMode = atoi(gets(input)); 50 printf(“Enter High Mark Mode ==> “); 51 HighMark = atoi(gets(input)); 52 printf(“Enter Fill Level Mode ==> “); 53 FillLevel = atoi(gets(input)); 54 printf(“Enter Migration Priority ==> “); 55 MigrationPriority = atoi(gets(input)); 56 printf(“Enter Target Archive ==> “); 57 gets(TargetArchive); 58 rc = VS_ArchiveMediaClass_SetFields(h, 59 VSID_ARCHIVE_NAME, Archive,

Page 89 of the ADIC 601355 Rev A user manual — Notes
Page 89 · click to enlarge
Page 89

60 VSID_MEDIA_CLASS_NAME, MediaClass, 61 VSID_MEDIA_TYPE_NAME, MediaType, 62 VSID_CAPACITY, Capacity, 63 VSID_PERCENT, MediaClassPercent, 64 VSID_ARCHIVE_ACTION, ActionMode, 65 VSID_HIGH_MARK, HighMark, 66 VSID_LOW_MARK, LowMark, 67 VSID_FILL_LEVEL, FillLevel, 68 VSID_MIGRATION_PRIORITY, MigrationPriority, 69 VSID_TARGET_ARCHIVE_NAME, TargetArchive, 70 VSID_ENDFIELD); 71 if (rc) 72 { 73 vst_print_archivemediaclass(h); 74 } 75 VS_ArchiveMediaClass_Destroy(h); 76 } 77 return(rc); 78 }

Page 90 of the ADIC 601355 Rev A user manual — See Also
Page 90 · click to enlarge
Page 90

See Also • vsapi(l),

  • VS_ArchiveMediaClass_Create(l),
  • VS_ArchiveMediaClass_GetFields(l),
  • VS_ArchiveMediaClass_SetFields(l),
  • VS_Error_GetFields(l)
Page 91 of the ADIC 601355 Rev A user manual — (VST_ARCHIVE_ACTION_OPTION*)
Page 91 · click to enlarge
Page 91

VS_Archive MediaClass_ GetFields

VS_ArchiveMediaClass_GetFields retrieves information associated with an archive media class handle. An archive media class handle is used to pass archive media class information to and from VolServ.

Synopsis VST_BOOLEAN VS_ArchiveMediaClass_GetFields ( VST_ARCHIVEMEDIACLASS _HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle =Archive media class handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_ACTION

Pointer to the archive action VolServ is to take when the number of media in the archive media class exceeds the specified high mark threshold. Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

(VST_ARCHIVE_ACTION_OPTION*)

Parameters · Parameter Type Description

Page 92 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 92 · click to enlarge
Page 92

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of the archive associated with the archive media class relationship. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY *) Pointer to the percentage of the total MediaClass capacity that can be stored in this archive.

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the preferred locations for media assigned to this archive media class.

VSID_FILL_LEVEL (VST_FILL_LEVEL *) Pointer to the number of media currently in this archive media class.

VSID_HIGH_MARK (VST_HIGH_MARK *) The percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_LOW_MARK (VST_LOW_MARK *) Pointer to the percentage of the archive media class capacity below which automatic migration of media out of the archive media class stops. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass name associated with the archive media class relationship.

Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Parameter Type Description

Page 93 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 93 · click to enlarge
Page 93

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Pointer to the media type associated with the archive media class. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MIGRATION_PRIORITY (VST_PRIORITY *)

Pointer to the migration priority to be applied to this archive media class.

Pointer to the number of component handles present in the component handle table.

VSID_PERCENT (VST_PERCENT *) Pointer to the percentage of the media assigned to the related MediaClass group allowed in the archive associated with the archive media class relationship.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the destination archive for media automatically migrated out of this archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Return Values VS_ArchiveMediaClass_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an archive media class handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description · VSID_NUMBER_COMPONENT_HANDLES (int *)

Page 94 of the ADIC 601355 Rev A user manual — Example
Page 94 · click to enlarge
Page 94

********* 2 * 3 * FUNCTION: vst_print_archivemediaclass 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * an Archive Media Class handle. 8 * 9 * PARAMETERS: 10 * h : the Archive Media Class handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_archivemediaclass (VST_ARCHIVEMEDIACLASS_HANDLE h) 15 #else 16 void vst_print_archivemediaclass(h) 17 VST_ARCHIVEMEDIACLASS_HANDLE h; 18 #endif 19 { 20 VST_ARCHIVE_NAME Archive; 21 VST_MEDIA_CLASS_NAME

MediaType; 23 VST_CAPACITY Capacity; 24 VST_PERCENT

ActionMode; 26 VST_HIGH_MARK HighMark; 27 VST_LOW_MARK LowMark; 28 VST_FILL_LEVEL

Show 5 more labels / short text on this page
Example 1 /**************************************** · MediaClass; 22 VST_MEDIA_TYPE_NAME · MediaClassPercent; 25 VST_ARCHIVE_ACTION_OPTION · FillLevel; 29 VST_PRIORITY · MigrationPriority;
Page 95 of the ADIC 601355 Rev A user manual — 30 VST_ARCHIVE_NAME
Page 95 · click to enlarge
Page 95

30 VST_ARCHIVE_NAME

RestrictedComps; 32 int i; 33 int n; 34 VST_COMPONENT_HANDLE

Component; 35 36 VS_ArchiveMediaClass_GetFields(h, 37 VSID_ARCHIVE_NAME, Archive, 38 VSID_MEDIA_CLASS_NAME, MediaClass, 39 VSID_MEDIA_TYPE_NAME, MediaType, 40 VSID_CAPACITY, &Capacity, 41 VSID_PERCENT, &MediaClassPercent, 42 VSID_ARCHIVE_ACTION, &ActionMode, 43 VSID_HIGH_MARK, &HighMark, 44 VSID_LOW_MARK, &LowMark, 45 VSID_FILL_LEVEL, &FillLevel, 46 VSID_MIGRATION_PRIORITY, &MigrationPriority, 47 VSID_TARGET_ARCHIVE_NAME, TargetArchive, 48 VSID_COMPONENT_HANDLE_TABLE,&Rest rictedComps, 49 VSID_ENDFIELD); 50 printf(“*** Archive Media Class

Handle ***\n”); 51 printf(“Archive Name = %s\n”,

Archive); 52 printf(“Media Class Name = %s\n”,

TargetArchive; 31 VST_TABLE_HANDLE · MediaClass);

Page 96 of the ADIC 601355 Rev A user manual — Example
Page 96 · click to enlarge
Page 96

53 printf(“Media Type Name = %s\n”,

MediaType); 54 printf(“Capacity = %d\n”, Capacity); 55 printf(“Media Class percent = %d\n”,

MediaClassPercent); 56 printf(“Archive Action Mode = %d\n”,

ActionMode); 57 printf(“High Mark = %d\n”, HighMark); 58 printf(“Low Mark = %d\n”, LowMark); 59 printf(“Fill Level = %d\n”,

FillLevel); 60 printf(“Migration Priority = %d\n”,

MigrationPriority); 61 printf(“Target Archive = %s\n”,

TargetArchive); 62 if (RestrictedComps !=

(VST_TABLE_HANDLE) NULL) 63 { 64 /* get number of entries */ 65 VS_Table_GetFields(RestrictedComp s, 66 VSID_NUMBER_ENTRIES, &n, 67 VSID_ENDFIELD); 68 for (i = 0; i < n; i++) 69 { 70 VS_Table_GetFields(RestrictedComp s, 71 VSID_TABLE_ENTRY, i, &Component, 72 VSID_ENDFIELD); 73 vst_print_component(Component); 74 } 75 } 76 }

Page 97 of the ADIC 601355 Rev A user manual — Note
Page 97 · click to enlarge
Page 97

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

The migration policy options for are no action, operator notification, and automatic migration.

When the number of media in an archive media class reaches the high mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy option is set to notify.
  • Initiates automatic migration of media if the migration policy is set to migrate.

When the number of media in an archive media class drops to the low mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy is set to notify.
  • Terminates automatic migration of media if the migration policy is set to migrate.
Page 98 of the ADIC 601355 Rev A user manual — See Also
Page 98 · click to enlarge
Page 98

See Also • vsapi(l),

  • VS_Archive_GetFields(l),
  • VS_ArchiveMediaClass_Create(l),
  • VS_ArchiveMediaClass_Destroy(l),
  • VS_ArchiveMediaClass_SetFields(l),
  • VS_Error_GetFields(l),
  • VSCMD_ArchiveQuery(l)
Page 99 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_ArchiveMediaClass_SetFields (VST_ARCHIVEMEDIACLASS _HANDLE handle, “…”, VSID_ENDFIELD )
Page 99 · click to enlarge
Page 99

VS_Archive MediaClass_ SetFields

VS_ArchiveMediaClass_SetFields sets the value of one or more fields in an archive media class handle. An archive media class handle is used to pass archive media class information to and from VolServ.

Synopsis VST_BOOLEAN VS_ArchiveMediaClass_SetFields (VST_ARCHIVEMEDIACLASS _HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle =Archive media class handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 100 of the ADIC 601355 Rev A user manual — VSID_HIGH_MARK (VST_HIGH_MARK)
Page 100 · click to enlarge
Page 100

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_OPTION)

The archive action VolServ is to take when the number of media in the archive media class exceeds the specified high mark threshold.

Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The name of the archive to be associated with the archive media class relationship. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY) The percentage of the total MediaClass

capacity that can be stored in this archive.

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE)

The preferred locations (in table format) for media assigned to this archive media class.

VSID_FILL_LEVEL (VST_FILL_LEVEL)

The number of media currently in this archive media class.

VSID_HIGH_MARK (VST_HIGH_MARK)

The percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

Parameters · Parameter Type Description

Page 101 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 101 · click to enlarge
Page 101

VSID_LOW_MARK (VST_LOW_MARK) The percentage of the archive media class

capacity below which automatic migration of media out of the archive media class stops. A message is generated to the operator whenever the number of media in the archive media class drops below this threshold. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The name of the MediaClass group to be associated with the archive media class relationship. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

The media type associated with the archive media class. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Parameter Type Description

Page 102 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 102 · click to enlarge
Page 102

VSID_MIGRATION_PRIORITY(VST_ PRIORITY)

The migration priority to be applied to this archive media class.

Increasing the archive media class migration priority results in media being selected from this archive media class archive media class before media from archive media classes with lower migration priorities.

Likewise, decreasing the archive media class migration priority results in media being selected from this archive media class after media from archive media classes with higher migration priorities.

VSID_PERCENT (VST_PERCENT) The percentage of the media assigned to the related MediaClass group allowed in the archive associated with the archive media class relationship.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive for media automatically migrated out of this archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Return Values VS_ArchiveMediaClass_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .

Parameter Type Description

Page 103 of the ADIC 601355 Rev A user manual — Example
Page 103 · click to enlarge
Page 103
  • VSE_ERR_BADHANDLE - Specified handle was not an archive media class handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_archivemediaclass_handle 4 * 5 * PURPOSE: 6 * This function tests an archivemediaclass handle. 7 * 8 * PARAMETERS: 9 * none 10 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_archivemediaclass_handle(void ) 14 #else 15 VST_BOOLEAN

vst_archivemediaclass_handle() 16 #endif 17 { 18 VST_BOOLEAN rc; 19 VST_ARCHIVEMEDIACLASS_HANDLE h;

Example 1 /****************************************

Page 104 of the ADIC 601355 Rev A user manual — 20 VST_ARCHIVE_NAME
Page 104 · click to enlarge
Page 104

20 VST_ARCHIVE_NAME

TargetArchive; 31 32 /* create the handle */ 33 h = VS_ArchiveMediaClass_Create(); 34 if (h !=

(VST_ARCHIVEMEDIACLASS_HANDLE) NULL) 35 { 36 /* get the values from the user */ 37 printf(“** Archive Media Class handle **\n”); 38 printf(“Enter Archive Name ==> “); 39 gets(Archive); 40 printf(“Enter Media Class Name ==> “); 41 gets(MediaClass); 42 printf(“Enter Media Type Name ==> “); 43 gets(MediaType); 44 printf(“Enter Capacity ==> “); 45 Capacity = atoi(gets(input));

Show 10 more labels / short text on this page
Archive; 21 VST_MEDIA_CLASS_NAME · MediaClass; 22 VST_MEDIA_TYPE_NAME · MediaType; 23 VST_CAPACITY · Capacity; 24 VST_PERCENT · MediaClassPercent; 25 VST_ARCHIVE_ACTION_OPTION · ActionMode; 26 VST_HIGH_MARK · HighMark; 27 VST_LOW_MARK · LowMark; 28 VST_FILL_LEVEL · FillLevel; 29 VST_PRIORITY · MigrationPriority; 30 VST_ARCHIVE_NAME
Page 105 of the ADIC 601355 Rev A user manual — Example
Page 105 · click to enlarge
Page 105

46 printf(“Enter MediaClass Percent ==> “); 47 MediaClassPercent = atoi(gets(input)); 48 printf(“Enter Archive Action Mode ==> “); 49 ActionMode = atoi(gets(input)); 50 printf(“Enter High Mark Mode ==> “); 51 HighMark = atoi(gets(input)); 52 printf(“Enter Fill Level Mode ==> “); 53 FillLevel = atoi(gets(input)); 54 printf(“Enter Migration Priority ==> “); 55 MigrationPriority = atoi(gets(input)); 56 printf(“Enter Target Archive ==> “); 57 gets(TargetArchive); 58 rc = VS_ArchiveMediaClass_SetFields(h, 59 VSID_ARCHIVE_NAME, Archive, 60 VSID_MEDIA_CLASS_NAME, MediaClass, 61 VSID_MEDIA_TYPE_NAME, MediaType, 62 VSID_CAPACITY, Capacity, 63 VSID_PERCENT, MediaClassPercent, 64 VSID_ARCHIVE_ACTION, ActionMode, 65 VSID_HIGH_MARK, HighMark, 66 VSID_LOW_MARK, LowMark, 67 VSID_FILL_LEVEL, FillLevel, 68 VSID_MIGRATION_PRIORITY, MigrationPriority,

Page 106 of the ADIC 601355 Rev A user manual — Notes
Page 106 · click to enlarge
Page 106

69 VSID_TARGET_ARCHIVE_NAME, TargetArchive, 70 VSID_ENDFIELD); 71 if (rc) 72 { 73 vst_print_archivemediaclass(h); 74 } 75 VS_ArchiveMediaClass_Destroy(h); 76 } 77 return(rc); 78 }

When the number of media in an archive media class reaches the high mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy option is set to notify.
  • Initiates automatic migration of media if the migration policy is set to migrate.

When the number of media in an archive media class drops to the low mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy is set to notify.
Page 107 of the ADIC 601355 Rev A user manual — Note
Page 107 · click to enlarge
Page 107
  • Terminates automatic migration of media if the migration policy is set to migrate.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_ArchiveMediaClass_Create(l),
  • VS_ArchiveMediaClass_Destroy(l),
  • VS_ArchiveMediaClass_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Table_Create(l),
  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_SetFields(l)
Page 108 of the ADIC 601355 Rev A user manual — Synopsis VST_COMMAND_HANDLE VS_Command_Create ( void )
Page 108 · click to enlarge
Page 108

VS_ Command_ Create

VS_Command_Create allocates a VolServ API command handle. A command handle is used to pass command information to and from VolServ.

Synopsis VST_COMMAND_HANDLE VS_Command_Create ( void )

Return Values VS_Command_Create returns:

  • A command handle, if one can be allocated.
  • NULL, if a command handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_command_handle 4 * 5 * PURPOSE: 6 * This function tests a command handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_command_handle(void) 14 #else 15 VST_BOOLEAN vst_command_handle(void) 16 #endif

Arguments None · Example 1 /****************************************

Page 109 of the ADIC 601355 Rev A user manual — VS_ Command_ Create
Page 109 · click to enlarge
Page 109

17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_COMMAND_HANDLE h; 20 VST_REQUEST_ID requestid; 21 VST_REQUEST_TYPE reqtype; 22 VST_RETRY_LIMIT retrylimit; 23 VST_TIME_OUT timeout; 24 VST_STATUS_WAIT_FLAG waitflag; 25 26 /* create the handle */ 27 h = VS_Command_Create(); 28 if (h != (VST_COMMAND_HANDLE) NULL) 29 { 30 /* get values from user */ 31 printf(“*** Command Handle ***\n”); 32 printf(“Enter Request ID ==> “); 33 requestid = atol(gets(input)); 34 printf(“Enter Request type ==> “); 35 reqtype = atol(gets(input)); 36 printf(“Enter Retry Limit ==> “); 37 retrylimit = atol(gets(input)); 38 printf(“Enter Timeout Value ==> “); 39 timeout = atol(gets(input)); 40 41 /* set fields in handle */ 42 rc = VS_Command_SetFields(h, 43 VSID_REQUEST_ID, requestid, 44 VSID_REQUEST_TYPE, reqtype, 45 VSID_RETRY_LIMIT, retrylimit, 46 VSID_TIMEOUT_VALUE, timeout, 47 VSID_STATUS_WAIT_FLAG, waitflag, 48 VSID_ENDFIELD); 49 if (rc) 50 {

Page 110 of the ADIC 601355 Rev A user manual — Notes
Page 110 · click to enlarge
Page 110

51 /* print the handle and destroy it */ 52 vst_print_command(h); 53 } 54 VS_Command_Destroy(h); 55 } 56 return(rc); 57 }

See Also • vsapi(l),

  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Command_SetFields(l),
  • VS_Error_GetFields(l)
Page 111 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Command_Destroy (VST_COMMAND_HANDLE cmdhandle)
Page 111 · click to enlarge
Page 111

VS_ Command_ Destroy

VS_Command_Destroy deallocates a command handle that was allocated with VS_Command_Create. A command handle is used to pass command information to and from VolServ.

Synopsis VST_BOOLEAN VS_Command_Destroy (VST_COMMAND_HANDLE cmdhandle)

Arguments • cmdhandle = Command handle to be destroyed.

Return Values VS_Command_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_EXECUTING - Final status has not been returned for the command associated with the specified command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
Page 112 of the ADIC 601355 Rev A user manual — Example
Page 112 · click to enlarge
Page 112

********* 2 * 3 * FUNCTION: vst_command_handle 4 * 5 * PURPOSE: 6 * This function tests a command handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_command_handle(void) 14 #else 15 VST_BOOLEAN vst_command_handle(void) 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_COMMAND_HANDLE h; 20 VST_REQUEST_ID requestid; 21 VST_REQUEST_TYPE reqtype; 22 VST_RETRY_LIMIT retrylimit; 23 VST_TIME_OUT timeout; 24 VST_STATUS_WAIT_FLAG waitflag; 25 26 /* create the handle */ 27 h = VS_Command_Create(); 28 if (h != (VST_COMMAND_HANDLE) NULL) 29 { 30 /* get values from user */ 31 printf(“*** Command Handle ***\n”); 32 printf(“Enter Request ID ==> “); 33 requestid = atol(gets(input)); 34 printf(“Enter Request type ==> “); 35 reqtype = atol(gets(input)); 36 printf(“Enter Retry Limit ==> “); 37 retrylimit = atol(gets(input)); 38 printf(“Enter Timeout Value ==> “);

Example 1 /****************************************

Page 113 of the ADIC 601355 Rev A user manual — Notes
Page 113 · click to enlarge
Page 113

39 timeout = atol(gets(input)); 40 41 /* set fields in handle */ 42 rc = VS_Command_SetFields(h, 43 VSID_REQUEST_ID, requestid, 44 VSID_REQUEST_TYPE, reqtype, 45 VSID_RETRY_LIMIT, retrylimit, 46 VSID_TIMEOUT_VALUE, timeout, 47 VSID_STATUS_WAIT_FLAG, waitflag, 48 VSID_ENDFIELD); 49 if (rc) 50 { 51 /* print the handle and destroy it */ 52 vst_print_command(h); 53 } 54 VS_Command_Destroy(h); 55 } 56 return(rc); 57 }

After VS_Command_Destroy has been called for a command handle, that handle is no longer valid and should not be used.

If final status has not been received for a command, the API software fails a VS_Command_Destroy request for the associated command handle.

Page 114 of the ADIC 601355 Rev A user manual — See Also
Page 114 · click to enlarge
Page 114

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_GetFields(l),
  • VS_Command_SetFields(l),
  • VS_Error_GetFields(l)
Page 115 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Command_GetErrorFields (VST_COMMAND_HANDLE cmdhandle,
Page 115 · click to enlarge
Page 115

VS_ Command_ GetErrorFields

VS_Command_GetErrorFields retrieves information associated with the command’s error handle. It can be used in place of the VS_Error_GetFields routine when the user does not want to retrieve the error handle explicitly from the command handle.

Synopsis VST_BOOLEAN VS_Command_GetErrorFields (VST_COMMAND_HANDLE cmdhandle,

Arguments • cmdhandle = Command handle where the status information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by Pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following Parameters section.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_ERROR_CODE (VST_ERROR_CODE) Pointer to the error code for the given error.

VSID_ERROR_FILE (VST_ERROR_FILE) The name of the source file where the error occurred (API internal errors only).

VSID_ERROR_LINE (int *) Pointer to the source line number where the error occurred (API internal errors only).

Parameters · Parameter Type Description

Page 116 of the ADIC 601355 Rev A user manual — VSID_ERROR_OBJECT (VST_ERROR_OBJCODE *)
Page 116 · click to enlarge
Page 116

VSID_ERROR_NUMBER (VST_ERROR_NUMCODE *)

Pointer to the field that indicates which error occurred.

VSID_ERROR_OBJECT (VST_ERROR_OBJCODE *)

Pointer to the field that indicates the location of the error.

Return Values VS_Command_GetErrorFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an error handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 117 of the ADIC 601355 Rev A user manual — See Also
Page 117 · click to enlarge
Page 117

See Also • VS_Command_Create,

  • VS_Command_Destroy,
  • VS_Command_GetFields,
  • VS_Command_SetFields,
  • VS_Error_GetFields
Page 118 of the ADIC 601355 Rev A user manual — VSID_ERROR_HANDLE (VST_ERROR_HANDLE *)
Page 118 · click to enlarge
Page 118

VS_ Command_ GetFields

VS_Command_GetFields retrieves information associated with a command handle. A command handle is used to pass command information to and from VolServ.

Synopsis VST_BOOLEAN VS_Command_GetFields (VST_COMMAND_HANDLE cmdhandle, "…", VSID_ENDFIELD)

Arguments • cmdhandle = Command handle where information is retrieved.

  • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ERROR_HANDLE (VST_ERROR_HANDLE *)

Pointer to the error handle associated with this command.

VSID_REQUEST_ID (VST_REQUEST_ID *) Pointer to the request identifier associated with this command.

Parameters · Parameter Type Description

Page 119 of the ADIC 601355 Rev A user manual — VSID_STATUS_HANDLE (VST_STATUS_HANDLE *)
Page 119 · click to enlarge
Page 119

VSID_REQUEST_TYPE (VST_REQUEST_TYPE *)

Pointer to the type of command. Valid VSID_REQUEST_TYPE values are enumerated in the vs_type.h file.

VSID_STATUS_HANDLE (VST_STATUS_HANDLE *)

Pointer to the status handle associated with this command.

Return Values VS_Command_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_command 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a command handle. 8 * 9 * PARAMETERS: 10 * h : the command handle to print 11 *

Parameter Type Description · Example 1 /****************************************

Page 120 of the ADIC 601355 Rev A user manual — Return Values
Page 120 · click to enlarge
Page 120

12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_command(VST_COMMAND_HAN DLE h) 15 #else 16 void vst_print_command(h) 17 VST_COMMAND_HANDLE h; 18 #endif 19 { 20 VST_REQUEST_ID requestid; 21 VST_REQUEST_TYPE reqtype; 22 VST_RETRY_LIMIT retrylimit; 23 VST_TIME_OUT timeout; 24 VST_STATUS_WAIT_FLAG waitflag; 25 VST_ERROR_HANDLE eh; 26 VST_STATUS_HANDLE sh; 27 28 VS_Command_GetFields(h, 29 VSID_REQUEST_ID, &requestid, 30 VSID_REQUEST_TYPE, &reqtype, 31 VSID_RETRY_LIMIT, &retrylimit, 32 VSID_TIMEOUT_VALUE, &timeout, 33 VSID_STATUS_WAIT_FLAG, &waitflag, 34 VSID_ERROR_HANDLE, &eh, 35 VSID_STATUS_HANDLE, &sh, 36 VSID_ENDFIELD); 37 38 printf(“ ****Command Handle

Information****\n\n”); 39 printf(“RequestID = %luRequestType =

%d\n”,requestid,reqtype); 40 printf(“Retry Limit = %dTime Out =

%d\n”,retrylimit,timeout);

Page 121 of the ADIC 601355 Rev A user manual — Note
Page 121 · click to enlarge
Page 121

%d\n”,waitflag); 42 43 vst_print_status(sh); 44 vst_print_error(eh); 45 }

The command’s error is kept in its error handle.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_SetFields(l),
  • VS_Error_GetFields(l)

41 printf(“StatusWait =

Page 122 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Command_GetStatusFields ( VST_COMMAND_HANDLE cmdhandle, “…”, VSID_ENDFIELD )
Page 122 · click to enlarge
Page 122

VS_ Command_ GetStatusFields

VS_Command_GetStatusFields retrieves information associated with the command’s status handle. It can be used in place of the VS_Status_GetFields routine when the user does not want to retrieve the status handle explicitly from the command handle

Synopsis VST_BOOLEAN VS_Command_GetStatusFields ( VST_COMMAND_HANDLE cmdhandle, “…”, VSID_ENDFIELD )

Arguments • cmdhandle = Command handle from where the status information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by Pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following Parameters section.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 123 of the ADIC 601355 Rev A user manual — (VST_ARCHIVE_MEDIACLAS_HANDLE *)
Page 123 · click to enlarge
Page 123

VSID_ACTION_CODE (VST_ACTION_CODE *)

Pointer to the first entry in the action code table.

VSID_ACTION_CODE_ENTRY (int) Index of the appropriate entry in the action code table.

(VST_ACTION_CODE *) Pointer to the appropriate entry in the action code table.

VSID_ACTION_CODE_TABLE (VST_TABLE_HANDLE *)

Pointer to the action code table associated with this status.

VSID_ARCHIVE_HANDLE (VST_ARCHIVE_HANDLE *)

Pointer to the first archive handle in the archive handle table.

VSID_ARCHIVE_HANDLE_ENTRY (int) Index of the appropriate archive handle in the archive handle table.

(VST_ARCHIVE_HANDLE *) Pointer to the appropriate archive handle in the archive handle table.

VSID_ARCHIVE_HANDLE_TABLE

Pointer to the archive handle table associated with this status.

(VST_TABLE_HANDLE *)

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of the archive associated with this status. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ARCHIVEMEDIACLASS_HANDLE

Pointer to the first archive media class handle in the archive media class table.

(VST_ARCHIVE_MEDIACLAS_HANDLE *)

Index of the appropriate archive media class handle in the archive media class handle table.

(VST_ARCHIVEMEDIACLASS_HANDLE *) Pointer to the appropriate archive media class handle in the archive media class handle table.

Parameters · Parameter Type Description · VSID_ARCHIVEMEDIACLASS_HANDLE_ ENTRY (int)

Page 124 of the ADIC 601355 Rev A user manual — (VST_TABLE_HANDLE *)
Page 124 · click to enlarge
Page 124

VSID_ARCHIVEMEDIACLASS_HANDLE_TA BLE (VST_TABLE_HANDLE *)

Pointer to the archive media class handle table associated with this status.

VSID_COMPONENT_HANDLE

Pointer to the first component handle in the component handle table.

(VST_COMPONENT_HANDLE *)

Index of the appropriate component handle in the component handle table.

(VST_COMPONENT_HANDLE *)

Pointer to the appropriate component handle in the component handle table.

VSID_COMPONENT_HANDLE_TABLE

Pointer to the component handle table associated with this status.

(VST_TABLE_HANDLE *)

VSID_COMP_ID (VST_COMPONENT_ID *) Pointer to the first component identifier in the component identifier table.

Index of the appropriate component identifier in the component identifier table.

(VST_COMPONENT_ID *)

Pointer to the appropriate component identifier in the component identifier table.

VSID_COMP_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the component identifier table associated with this status.

VSID_COMP_STATE (VST_COMPONENT_STATE *)

Pointer to the component state for this status.

Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_CONNECT_HANDLE (VST_CONNECT_HANDLE *)

Pointer to the first entry in the connect handle table.

VSID_CONNECT_HANDLE_ENTRY (int) Index of the appropriate connect handle in the connect handle table.

(VST_CONNECT_HANDLE *) Pointer to the appropriate connect handle in the connect handle table.

VSID_CONNECT_HANDLE_TABLE

Pointer to the connect handle table associated with this status.

(VST_TABLE_HANDLE *)

Parameter Type Description · VSID_COMPONENT_HANDLE_ENTRY (int) · VSID_COMP_ID_ENTRY (int)

Page 125 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID *)
Page 125 · click to enlarge
Page 125

VSID_DRIVE_HANDLE (VST_DRIVE_HANDLE *)

Pointer to the first drive handle in the drive handle table.

VSID_DRIVE_HANDLE_ENTRY (int) Index the appropriate drive handle in the drive handle table.

(VST_DRIVE_HANDLE *) Pointer to the appropriate drive handle in the drive handle table.

VSID_DRIVE_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the drive handle table associated with this status.

VSID_DRIVE_ID (VST_DRIVE_ID *) Pointer to the first drive identifier in the drive identifier table.

VSID_DRIVE_ID_ENTRY (int) Index of the appropriate drive identifier in the drive identifier table.

(VST_DRIVE_ID *) Pointer to the appropriate drive identifier in the drive identifier table.

VSID_DRIVE_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the drive identifier table associated with this status.

VSID_DRIVEPOOL_HANDLE

Pointer to the first drive pool handle in the drive pool handle table.

(VST_DRIVE_POOL_HANDLE *)

VSID_DRIVEPOOL_HANDLE_ENTRY (int) Index of the appropriate drive pool handle in the drive pool handle table.

(VST_DRIVEPOOL_HANDLE *) Pointer to the appropriate drive pool handle in the drive pool handle table.

VSID_DRIVEPOOL_HANDLE_TABLE

Pointer to the drive pool handle table associated with this status.

(VST_TABLE_HANDLE *)

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Pointer to the name of the drive pool group.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the identifier of the enterprise, if any, to receive command status.

Parameter Type Description

Page 126 of the ADIC 601355 Rev A user manual — VSID_MEDIA_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 126 · click to enlarge
Page 126

VSID_ERROR_CODE (VST_VOLERR_CODE *)

Pointer to the first error code in the error code table.

VSID_ERROR_CODE_ENTRY (int) Index of the appropriate error code in the error code table.

(VST_VOLERR_CODE *) Pointer to the appropriate error code in the error code table.

VSID_ERROR_TABLE (VST_TABLE_HANDLE *)

Pointer to the error code table associated with this status.

VSID_FIELD (int *) Pointer to the first field in the user-defined media statistics field table.

VSID_FIELD_ENTRY (int) Index of the appropriate field in the user-defined media statistics field table.

(int *) Pointer to the appropriate field in the user-defined media statistics field table.

VSID_FIELD_TABLE (VST_TABLE_HANDLE *)

Pointer to the user-defined media statistics field table associated with this status.

VSID_LOCK_ID (VST_LOCK_ID *) Pointer to the lock identifier associated with this status.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass name associated with this status.

VSID_MEDIA_HANDLE (VST_MEDIA_HANDLE *)

Pointer to the first media handle in the media handle table.

VSID_MEDIA_HANDLE_ENTRY (int) Index of the appropriate media handle in the media handle table.

(VST_MEDIA_HANDLE *) Pointer to the appropriate media handle in the media handle table.

VSID_MEDIA_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the media handle table associated with this status.

VSID_MEDIA_ID (VST_MEDIA_ID) Pointer to the first media identifier in the media identifier table.

Parameter Type Description

Page 127 of the ADIC 601355 Rev A user manual — (VST_TABLE_HANDLE *)
Page 127 · click to enlarge
Page 127

VSID_MEDIA_ID_ENTRY (int) Index of the appropriate entry in the media identifier table.

(VST_MEDIA_ID *) Pointer to the appropriate media identifier in the media identifier table.

VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the media identifier table associated with this status.

VSID_MEDIACLASS_HANDLE

Pointer to the first MediaClass handle in the MediaClass handle table.

(VST_MEDIACLASS_HANDLE *)

VSID_MEDIACLASS_HANDLE_ENTRY (int) Index of the appropriate MediaClass handle in the MediaClass handle table

(VST_MEDIACLASS_HANDLE *) Pointer to the appropriate MediaClass handle in the MediaClass handle table.

VSID_MEDIACLASS_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the MediaClass handle table associated with this status.

VSID_MEDIATYPE_HANDLE

Pointer to the first media type handle in the media type handle table.

(VST_MEDIATYPE_HANDLE *)

VSID_MEDIATYPE_HANDLE_ENTRY (int) Index of the appropriate media type handle in the media type handle table.

(VST_MEDIATYPE_HANDLE *) Pointer to the appropriate media type handle in the media type handle table.

VSID_MEDIATYPE_HANDLE_TABLE

Pointer to the media type handle table associated with this status.

(VST_TABLE_HANDLE *)

VSID_NUMBER_ACTION_CODES (int *) Pointer to the number of action codes in the action code table.

VSID_NUMBER_ARCHIVE_HANDLES (int *) Pointer to the number of archive handles in the archive handle table.

VSID_NUMBER_COMP_IDS (int *) Pointer to the number of component ids in the component identifier table.

Parameter Type Description

Page 128 of the ADIC 601355 Rev A user manual — VSID_QRY_ENTERPRISE_ID (VST_ENTERPRISE_ID *)
Page 128 · click to enlarge
Page 128

Pointer to the number of component handles in the component handle table.

Pointer to the number of connect handles in the connect handle table.

VSID_NUMBER_DRIVE_HANDLES (int *) Pointer to the number of drive handles in the drive handle table.

VSID_NUMBER_DRIVE_IDS (int *) Pointer to the number of drive ids in the drive id table.

Pointer to the number of drive pool handles in the drive pool handle table.

VSID_NUMBER_ERROR_CODES (int *) Pointer to the number of error codes in the error code table.

VSID_NUMBER_FIELDS (int *) Pointer to the number of field ids in the field identifier table.

VSID_NUMBER_MEDIA_HANDLES (int *) Pointer to the number of media handles present in the media handle table.

VSID_NUMBER_MEDIA_IDS (int *) Pointer to the number of media ids in the media id table.

Pointer to the number of media class handles in the media class handle table.

Pointer to the number of media type handles in the media type handle table.

VSID_NUMBER_REQUEST_IDS (int *) Pointer to the number of request ids present in the request id table.

Pointer to the number of request handles in the request handle table.

VSID_PID (VST_PID *) Pointer to the VolServ identifier for the Ping status.

VSID_QRY_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the enterprise identifier, if any, for the Connect Query command.

Show 7 more labels / short text on this page
Parameter Type Description · VSID_NUMBER_COMPONENT_HANDLES (int *) · VSID_NUMBER_CONNECT_HANDLES (int *) · VSID_NUMBER_DRIVEPOOL_HANDLES (int *) · VSID_NUMBER_MEDIACLASS_HANDLES (int *) · VSID_NUMBER_MEDIATYPE_HANDLES (int *) · VSID_NUMBER_REQUEST_HANDLES (int *)
Page 129 of the ADIC 601355 Rev A user manual — VSID_STATUS_TYPE (VST_STATUS_TYPE *)
Page 129 · click to enlarge
Page 129

VSID_QRY_OPTION (VST_QRY_OPTION *) Pointer to the query option for this status.

VSID_REQUEST_HANDLE (VST_REQUEST_HANDLE *)

Pointer to the first request handle in the request handle table.

VSID_REQUEST_HANDLE_ENTRY (int) Index of the appropriate request handle in the request handle table.

(VST_REQUEST_HANDLE *) Pointer to the appropriate request handle in the request handle table.

VSID_REQUEST_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the request handle table associated with this status.

VSID_REQUEST_ID (VST_REQUEST_ID *) Pointer to the request identifier of the target command for a Cancel or Reprioritize request.

VSID_SEQUENCE_NUM (int *) Pointer to the sequence number of this status. Initial status for a command request is sequence number 0. Sequence numbers for subsequent statuses for the same command request are assigned as one-up numbers. For example, the first intermediate status (if there is an intermediate status) or the final status (if there is no intermediate status) is sequence number 1.

VSID_SEQUENCE_TABLE (VST_TABLE_HANDLE *)

Pointer to the sequence numbers (in table format) of the statuses received for this command.

VSID_STATUS_CODE (VST_STATUS_CODE *)

Pointer to the status code for this status. Indicates whether the command was successful or failed. Valid VSID_STATUS_CODE values are enumerated in the vs_types.h file.

VSID_STATUS_TYPE (VST_STATUS_TYPE *)

Pointer to the status type (intermediate or final) for this status. Valid VSID_STATUS_TYPE values are enumerated in the vs_types.h file.

Parameter Type Description

Page 130 of the ADIC 601355 Rev A user manual — VSID_WAIT_REASON (VST_WAIT_REASON *)
Page 130 · click to enlarge
Page 130

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the enterprise identifier for a ConnectQuery or Disconnect command.

VSID_USER_FIELD (VST_USER_FIELD) Pointer to the user field contents for the associated command. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for each command. Neither the API software nor VolServ uses USER_FIELD.

VSID_WAIT_REASON (VST_WAIT_REASON *)

Pointer to the wait reason for an intermediate status. Valid VSID_WAIT_REASON values are enumerated in the vs_types.h file.

Return Values VS_Command_GetStatusFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 131 of the ADIC 601355 Rev A user manual — Note
Page 131 · click to enlarge
Page 131

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • VS_Command_Create,

  • VS_Command_Destroy,
  • VS_Command_GetFields,
  • VS_Command_SetFields,
  • VS_Status_GetFields
Page 132 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Command_Setfields ( VST_COMMAND_HANDLE cmdhandle, "…", VSID_ENDFIELD )
Page 132 · click to enlarge
Page 132

VS_ Command_ SetFields

VS_Command_Setfields sets the value of one or more fields in a command handle. A command handle is used to pass command information to and from VolServ.

Synopsis VST_BOOLEAN VS_Command_Setfields ( VST_COMMAND_HANDLE cmdhandle, "…", VSID_ENDFIELD )

Arguments • cmdhandle = Command handle where information is stored.

  • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 133 of the ADIC 601355 Rev A user manual — VSID_STATUS_HANDLE (VST_STATUS_HANDLE)
Page 133 · click to enlarge
Page 133

VSID_ERROR_HANDLE (VST_ERROR_HANDLE)

Error handle associated with this command.

VSID_REQUEST_ID (VST_REQUEST_ID) Request identifier associated with this command.

VSID_REQUEST_TYPE (VST_REQUEST_TYPE)

Type of command. Valid VSID_REQUEST_TYPE values are enumerated in the vs_type.h file.

VSID_STATUS_HANDLE (VST_STATUS_HANDLE)

Status handle associated with this command.

Return Values VS_Command_Setfields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Parameters · Parameter Type Description

Page 134 of the ADIC 601355 Rev A user manual — Example
Page 134 · click to enlarge
Page 134

********* 2 * 3 * FUNCTION: vst_command_handle 4 * 5 * PURPOSE: 6 * This function tests a command handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_command_handle(void) 14 #else 15 VST_BOOLEAN vst_command_handle(void) 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_COMMAND_HANDLE h; 20 VST_REQUEST_ID requestid; 21 VST_REQUEST_TYPE reqtype; 22 VST_RETRY_LIMIT retrylimit; 23 VST_TIME_OUT timeout; 24 VST_STATUS_WAIT_FLAG waitflag; 25 26 /* create the handle */ 27 h = VS_Command_Create(); 28 if (h != (VST_COMMAND_HANDLE) NULL) 29 { 30 /* get values from user */ 31 printf(“*** Command Handle ***\n”); 32 printf(“Enter Request ID ==> “); 33 requestid = atol(gets(input)); 34 printf(“Enter Request type ==> “); 35 reqtype = atol(gets(input)); 36 printf(“Enter Retry Limit ==> “); 37 retrylimit = atol(gets(input)); 38 printf(“Enter Timeout Value ==> “);

Example 1 /****************************************

Page 135 of the ADIC 601355 Rev A user manual — Note
Page 135 · click to enlarge
Page 135

39 timeout = atol(gets(input)); 40 41 /* set fields in handle */ 42 rc = VS_Command_SetFields(h, 43 VSID_REQUEST_ID, requestid, 44 VSID_REQUEST_TYPE, reqtype, 45 VSID_RETRY_LIMIT, retrylimit, 46 VSID_TIMEOUT_VALUE, timeout, 47 VSID_STATUS_WAIT_FLAG, waitflag, 48 VSID_ENDFIELD); 49 if (rc) 50 { 51 /* print the handle and destroy it */ 52 vst_print_command(h); 53 } 54 VS_Command_Destroy(h); 55 } 56 return(rc); 57 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
Page 136 of the ADIC 601355 Rev A user manual — Notes
Page 136 · click to enlarge
Page 136
  • VS_Error_GetFields(l)
Page 137 of the ADIC 601355 Rev A user manual — Synopsis VST_COMPONENT_HANDLE VS_Component_Create ( void )
Page 137 · click to enlarge
Page 137

VS_ Component_ Create

VS_Component_Create allocates a VolServ API component handle. A component handle is used to pass component information to and from VolServ.

Synopsis VST_COMPONENT_HANDLE VS_Component_Create ( void )

Return Values VS_Component_Create returns:

  • A component handle, if one can be allocated.
  • NULL, if a component handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 *FUNCTION: vst_modarchivemediaclass_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ModifyArchiveMediaClass 7 * API all. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13

Arguments None · Example 1 /****************************************

Page 138 of the ADIC 601355 Rev A user manual — VS_ Component_ Create
Page 138 · click to enlarge
Page 138

14 #ifdef ANSI_C 15 VST_BOOLEAN

vst_modarchivemediaclass_execute( void) 16 #else 17 VST_BOOLEAN

vst_modarchivemediaclass_execute( ) 18 #endif 19 { 20 int i; 21 int count; 22 VST_BOOLEAN rc = VSE_FALSE; 23 VST_ARCHIVE_NAME archive; 24 VST_MEDIA_CLASS_NAME

mediaclass; 25 VST_CAPACITY capacity; 26 VST_ARCHIVE_ACTION_OPTION action; 27 VST_HIGH_MARK highmark; 28 VST_LOW_MARK lowmark; 29 VST_PRIORITY migpri; 30 VST_ARCHIVE_NAME

comphandle; 33 VST_COMP_TYPE CompType = VSE_COMPTYPE_COLUMN; 34 VST_COMPONENT_ID CompID; 35 VST_COMMAND_HANDLE cmd; 36 37 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 38 /* get parameters from user */ 39 printf(“Modify archive media class

parameters \n” ); 40 printf(“The archive media class must

exist. \n”); 41 printf(“Enter Archive Name ==> “ ); 42 gets( archive );

targetarchive; 31 VST_TABLE_HANDLE · comphandletable; 32 VST_COMPONENT_HANDLE

Page 139 of the ADIC 601355 Rev A user manual — VS_ Component_ Create
Page 139 · click to enlarge
Page 139

43 printf(“Enter Media Class Name ==> “

); 44 gets( mediaclass ); 45 printf(“Enter Capacity Percent ==> “

); 46 capacity = atoi(gets(input)); 47 printf(“Enter Archive action option

(0-none/1-mig/2-notify) ==>“ ); 48 action = atoi(gets(input)); 49 printf(“Enter High Mark Percentage

==> “ ); 50 highmark = atoi(gets(input)); 51 printf(“Enter Low Mark Percentage ==>

“ ); 52 lowmark = atoi(gets(input)); 53 54 if ( action == VSE_ARCHIVE_ACTION_MIG

) 55 { 56 printf(“Enter Target Archive ==> “ ); 57 gets( targetarchive ); 58 printf(“Enter Migration Priority == > “ ); 59 migpri = atoi(gets(input)); 60 /* These only need to be set when */ 61 /* migration is used. */ 62 VSCMD_ModifyArchiveMediaClass_Set Defaults ( 63 VSID_TARGET_ARCHIVE_NAME, targetarchive, 64 VSID_MIGRATION_PRIORITY, migpri, 65 VSID_ENDFIELD ); 66 } 67 68 printf(“How many prefered placements

(0 to skip)“); 69 count = atoi(gets(input)); 70 if (count > 0)
Page 140 of the ADIC 601355 Rev A user manual — VS_ Component_ Create
Page 140 · click to enlarge
Page 140

71 { 72 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count); 73 if (comphandletable == (VST_TABLE_HANDLE) NULL) 74 { 75 return (VSE_FALSE); 76 } 77 for (i = 0; i < count; i++) 78 { 79 printf(“Enter row #%d:”, i + 1); 80 CompID[0] = (short) atoi(gets(input)); 81 printf(“Enter column #%d:”, i + 1); 82 CompID[1] = (short) atoi(gets(input)); 83 CompID[2] = 0; 84 CompID[3] = 0; 85 comphandle = VS_Component_Create(); 86 VS_Component_SetFields(comphandle , 87 VSID_COMP_TYPE, CompType, 88 VSID_COMP_ID, CompID, 89 VSID_ENDFIELD); 90 VS_Table_AddEntry(comphandletable ,comphandle); 91 } 92 VSCMD_ModifyArchiveMediaClass_Set Defaults( 93 VSID_COMPONENT_HANDLE_TABLE, comphandletable, 94 VSID_ENDFIELD); 95 }

Page 141 of the ADIC 601355 Rev A user manual — Notes
Page 141 · click to enlarge
Page 141

96 /* create the command handle */ 97 /* Note that the command handle is

not */ 98 /* destroyed in this routine, */ 99 /* but in vst_dispatch */ 100 /* when final status is received. */ 101 cmd = VS_Command_Create(); 102 if (cmd != (VST_COMMAND_HANDLE )NULL) 103 { 104 /* Send the command to the VolServ software. */ 105 /* Note that status is not processed here. */ 106 /* Instead, it is processed in the vst_dispatch */ 107 /* routine. Also, note that default values such */ 108 /* as timeout, value retry limit and priority */ 109 /* are set as default parameters. */ 110 rc = VSCMD_ModifyArchiveMediaClass(cmd , 111 VSID_ARCHIVE_NAME, archive, 112 VSID_MEDIA_CLASS_NAME, mediaclass, 113 VSID_HIGH_MARK, highmark, 114 VSID_LOW_MARK, lowmark, 115 VSID_CAPACITY, capacity, 116 VSID_ENDFIELD); 117 } 118 return ( rc ); 119}

Page 142 of the ADIC 601355 Rev A user manual — See Also
Page 142 · click to enlarge
Page 142

See Also • vsapi(l),

  • VS_Component_Destroy(l),
  • VS_Component_GetFields(l),
  • VS_Component_SetFields(l),
  • VS_Error_GetFields(l)
Page 143 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Component_Destroy ( VST_COMPONENT_HANDLE handle )
Page 143 · click to enlarge
Page 143

VS_ Component_ Destroy

VS_Component_Destroy deallocates a component handle that was allocated with VS_Component_Create. A component handle is used to pass component information to and from VolServ.

Synopsis VST_BOOLEAN VS_Component_Destroy ( VST_COMPONENT_HANDLE handle )

Arguments • handle = Component handle to be destroyed.

Return Values VS_Component_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a component handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_component_handle 4 * 5 * PURPOSE: 6 * This function tests the component handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 144 of the ADIC 601355 Rev A user manual — VS_ Component_ Destroy
Page 144 · click to enlarge
Page 144

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_component_handle(void) 14 #else 15 VST_BOOLEAN vst_component_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_TRUE; 19 VST_COMPONENT_HANDLE comph; 20 VST_COMP_TYPE comptype; 21 VST_COMPONENT_ID id; 22 23 comph = VS_Component_Create(); 24 if (comph != (VST_COMPONENT_HANDLE)

NULL) 25 { 26 printf(“enter component type ==>”); 27 comptype = atoi(gets(input)); 28 printf(“enter 4 values for the component id (e.g. 3 2 4 1) ==>”); 29 scanf(“%hd”, &id[0], &id[1], &id[2], &id[3]); 30 gets(input); 31 VS_Component_SetFields(comph, 32 VSID_COMP_TYPE, comptype, 33 VSID_COMP_ID, id, 34 VSID_ENDFIELD); 35 vst_print_component(comph); 36 VS_Component_Destroy(comph); 37 } 38 else 39 { 40 rc = VSE_FALSE; 41 } 42 return(rc); 43 }

Page 145 of the ADIC 601355 Rev A user manual — Notes
Page 145 · click to enlarge
Page 145

See Also • vsapi(l),

  • VS_Component_Create(l),
  • VS_Component_GetFields(l),
  • VS_Component_SetFields(l),
  • VS_Error_GetFields(l)
Page 146 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Component_GetFields ( VST_COMPONENT_HANDLE handle, “…”, VSID_ENDFIELD )
Page 146 · click to enlarge
Page 146

VS_ Component_ GetFields

VS_Component_GetFields retrieves information from a component handle. The component handle is used to pass component information to and from VolServ.

Synopsis VST_BOOLEAN VS_Component_GetFields ( VST_COMPONENT_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Component handle for which information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_COMP_ID (VST_COMP_ID *) Pointer to the identifier of the component.

VSID_COMP_TYPE (VST_COMP_TYPE *) Pointer to the type of this component.

Parameters · Parameter Type Description

Page 147 of the ADIC 601355 Rev A user manual — Return Values
Page 147 · click to enlarge
Page 147

Return Values VS_Component_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a component handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_component 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a component handle. 8 * 9 * PARAMETERS: 10 * h : the component handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_component(VST_COMPONENT _HANDLE h) 15 #else 16 void vst_print_component(h) 17 VST_COMPONENT_HANDLE h; 18 #endif 19 { 20 VST_COMP_TYPE CompType;

Example 1 /****************************************

Page 148 of the ADIC 601355 Rev A user manual — Note
Page 148 · click to enlarge
Page 148

21 VST_COMPONENT_ID CompID; 22 int i; 23 24 VS_Component_GetFields(h, 25 VSID_COMP_TYPE, &CompType, 26 VSID_COMP_ID, CompID, 27 VSID_ENDFIELD); 28 printf(“******* Component Handle

*******\n”); 29 printf(“Component Type = %d\n”,

CompType); 30 printf(“Component ID = “); 31 for (i = 0; i < VSD_MAX_COMPONENT_ID;

i++) 32 { 33 printf(“%d”, CompID[i]); 34 if (i < VSD_MAX_COMPONENT_ID - 1) 35 { 36 printf(“, “); 37 } 38 } 39 printf(“\n”); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Component_Create(l),
  • VS_Component_Destroy(l),
  • VS_Component_SetFields(l),
Page 149 of the ADIC 601355 Rev A user manual — Notes
Page 149 · click to enlarge
Page 149
  • VS_Error_GetFields(l),
  • VS_Table_Create(l),
  • VS_Table_SetFields(l),
  • VS_TableAddEntry(l),
  • VSCMD_CreateArchiveMediaClass(l),
  • VSCMD_ModifyArchiveMediaClass(l)
Page 150 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Component_SetFields ( VST_COMPONENT_HANDLE handle, “…”, VSID_ENDFIELD )
Page 150 · click to enlarge
Page 150

VS_ Component_ SetFields

VS_Component_SetFields sets the value of one or more fields in a VolServ API component handle. A component handle is used to pass component information to and from VolServ.

Synopsis VST_BOOLEAN VS_Component_SetFields ( VST_COMPONENT_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Component handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_COMP_ID (VST_COMP_ID) Identifier of the component.

VSID_COMP_TYPE (VST_COMP_TYPE) Type of this component. Valid VSID_COMP_TYPE values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 151 of the ADIC 601355 Rev A user manual — Return Values
Page 151 · click to enlarge
Page 151

Return Values VS_Component_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a component handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 *FUNCTION: vst_modarchivemediaclass_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ModifyArchiveMediaClass 7 * API all. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modarchivemediaclass_execute( void) 15 #else

Example 1 /****************************************

Page 152 of the ADIC 601355 Rev A user manual — 16 VST_BOOLEAN
Page 152 · click to enlarge
Page 152

16 VST_BOOLEAN

vst_modarchivemediaclass_execute( ) 17 #endif 18 { 19 int i; 20 int count; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_ARCHIVE_NAME archive; 23 VST_MEDIA_CLASS_NAME

mediaclass; 24 VST_CAPACITY capacity; 25 VST_ARCHIVE_ACTION_OPTION action; 26 VST_HIGH_MARK highmark; 27 VST_LOW_MARK lowmark; 28 VST_PRIORITY migpri; 29 VST_ARCHIVE_NAME

comphandle; 32 VST_COMP_TYPE CompType = VSE_COMPTYPE_COLUMN; 33 VST_COMPONENT_ID CompID; 34 VST_COMMAND_HANDLE cmd; 35 36 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 37 /* get parameters from user */ 38 printf(“*** Modify Archive Media

Class parameters ***\n” ); 39 printf(“*** The archive media class

must exist. ***\n”); 40 printf(“Enter Archive Name ==> “ ); 41 gets( archive ); archive media class 42 printf(“Enter Media Class Name ==> “

); 43 gets( mediaclass ); 44 printf(“Enter Capacity Percent ==> “

targetarchive; 30 VST_TABLE_HANDLE · comphandletable; 31 VST_COMPONENT_HANDLE · );

Page 153 of the ADIC 601355 Rev A user manual — Return Values
Page 153 · click to enlarge
Page 153

45 capacity = atoi(gets(input)); 46 printf(“Enter Archive action option

(0-none/1-mig/2-notify) ==>“ ); 47 action = atoi(gets(input)); 48 printf(“Enter High Mark Percentage

==> “ ); 49 highmark = atoi(gets(input)); 50 printf(“Enter Low Mark Percentage ==>

“ ); 51 lowmark = atoi(gets(input)); 52 53 if ( action == VSE_ARCHIVE_ACTION_MIG

) 54 { 55 printf(“Enter Target Archive ==> “ ); 56 gets( targetarchive ); 57 printf(“Enter Migration Priority == > “ ); 58 migpri = atoi(gets(input)); 59 /* These only need to be set when migration */ 60 /* is used. */ 61 VSCMD_ModifyArchiveMediaClass_Set Defaults ( 62 VSID_TARGET_ARCHIVE_NAME, targetarchive, 63 VSID_MIGRATION_PRIORITY, migpri, 64 VSID_ENDFIELD ); 65 } 66 67 printf(“How many prefered placements

(0 to skip): “); 68 count = atoi(gets(input)); 69 if (count > 0) 70 { 71 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count);

Page 154 of the ADIC 601355 Rev A user manual — Return Values
Page 154 · click to enlarge
Page 154

72 if (comphandletable == (VST_TABLE_HANDLE) NULL) 73 { 74 return (VSE_FALSE); 75 } 76 for (i = 0; i < count; i++) 77 { 78 printf(“Enter row #%d:”, i + 1); 79 CompID[0] = (short) atoi(gets(input)); 80 printf(“Enter column #%d:”, i + 1); 81 CompID[1] = (short) atoi(gets(input)); 82 CompID[2] = 0; 83 CompID[3] = 0; 84 comphandle = VS_Component_Create(); 85 VS_Component_SetFields(comphandle , 86 VSID_COMP_TYPE, CompType, 87 VSID_COMP_ID, CompID, 88 VSID_ENDFIELD); 89 VS_Table_AddEntry(comphandletable ,comphandle); 90 } 91 VSCMD_ModifyArchiveMediaClass_Set Defaults( 92 VSID_COMPONENT_HANDLE_TABLE, comphandletable, 93 VSID_ENDFIELD); 94 } 95 /* create the command handle */ 96 /* Note that the command handle is

not */

Page 155 of the ADIC 601355 Rev A user manual — Return Values
Page 155 · click to enlarge
Page 155

97 /* destroyed in this routine, but in

*/ 98 /* vst_dispatch when final status is

received. */ 99 cmd = VS_Command_Create(); 100 if (cmd != (VST_COMMAND_HANDLE )NULL) 101 { 102 /* Send the command to the VolServ software. */ 103 /* Note that status is not processed here. */ 104 /* Instead, it is processed in the */ 105 /* vst_dispatch routine. Also, note that */ 106 /* default values such as timeout, value */ 107 /* retry limit and priority are set as */ 108 /* default parameters. */ 109 rc = VSCMD_ModifyArchiveMediaClass(cmd , 110 VSID_ARCHIVE_NAME, archive, 111 VSID_MEDIA_CLASS_NAME, mediaclass, 112 VSID_HIGH_MARK, highmark, 113 VSID_LOW_MARK, lowmark, 114 VSID_CAPACITY, capacity, 115 VSID_ENDFIELD); 116 } 117 return ( rc ); 118}

Page 156 of the ADIC 601355 Rev A user manual — Note
Page 156 · click to enlarge
Page 156

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Component_Create(l),
  • VS_Component_Destroy(l),
  • VS_Component_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Table_Create(l),
  • VS_Table_SetFields(l),
  • VS_TableAddEntry(l)
Page 157 of the ADIC 601355 Rev A user manual — Synopsis VST_CONNECT_HANDLE VS_Connect_Create ( void )
Page 157 · click to enlarge
Page 157

VS_Connect_ Create

VS_Connect_Create allocates a VolServ API connect handle. A connect handle is used to pass connect information to and from VolServ.

Synopsis VST_CONNECT_HANDLE VS_Connect_Create ( void )

Return Values VS_Connect_Create returns:

  • A connect handle, if one can be allocated.
  • NULL, if a connect handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_connect_handle 4 * 5 * PURPOSE: 6 * This function tests a connect handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_connect_handle(void) 14 #else 15 VST_BOOLEAN vst_connect_handle() 16 #endif 17 {

Arguments None · Example 1 /****************************************

Page 158 of the ADIC 601355 Rev A user manual — VS_Connect_ Create
Page 158 · click to enlarge
Page 158

18 VST_CONNECT_HANDLE h; 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_ENTERPRISE_ID EnterpriseID; 21 VST_SOCKADDR_IN SocketAddress; 22 VST_PROGRAM_NUMBER ProgramNumber; 23 VST_VERSION_NUMBER VersionNumber; 24 VST_PROCEDURE_NUMBER

ProcedureNumber; 25 VST_PROTOCOL Protocol; 26 27 /* create the handle */ 28 h = VS_Connect_Create(); 29 if (h != (VST_CONNECT_HANDLE) NULL) 30 { 31 /* get values from user */ 32 printf(“*** connect handle ***\n”); 33 printf(“Enter enterprise ID ==> “); 34 EnterpriseID = atol(gets(input)); 35 printf(“Enter Internet sin_port value ==> “); 36 SocketAddress.sin_port = (short) atoi(gets(input));; 37 printf(“Enter Internet sin_family value ==> “); 38 SocketAddress.sin_family = (short)

atoi(gets(input)); 39 printf(“Enter Internet sin_addr value ==> “); 40 SocketAddress.sin_addr = atol(gets(input)); 41 printf(“Enter program number ==> “); 42 ProgramNumber = atol(gets(input)); 43 printf(“Enter version number ==> “); 44 VersionNumber = atol(gets(input));

Page 159 of the ADIC 601355 Rev A user manual — Notes
Page 159 · click to enlarge
Page 159

45 printf(“Enter procedure number ==> “); 46 ProcedureNumber = atol(gets(input)); 47 printf(“Enter Protocol ==> “); 48 Protocol = atol(gets(input)); 49 /* set the fields */ 50 rc = VS_Connect_SetFields(h, 51 VSID_ENTERPRISE_ID, EnterpriseID, 52 VSID_SOCKADDR_IN, SocketAddress, 53 VSID_PROGRAM_NUMBER, ProgramNumber, 54 VSID_VERSION_NUMBER, VersionNumber, 55 VSID_PROCEDURE_NUMBER, ProcedureNumber, 56 VSID_PROTOCOL, Protocol, 57 VSID_ENDFIELD); 58 if (rc) 59 { 60 vst_print_connect(h); 61 } 62 VS_Connect_Destroy(h); 63 } 64 return(rc); 65 }

See Also • vsapi(l),

  • VS_Connect_Destroy(l),
  • VS_Connect_GetFields(l),
  • VS_Connect_SetFields(l),
  • VS_Error_GetFields(l)
Page 160 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Connect_Destroy (VST_CONNECT_HANDLE handle)
Page 160 · click to enlarge
Page 160

VS_Connect_ Destroy

VS_Connect_Destroy deallocates a connect handle that was allocated with VS_Connect_Create. A connect handle is used to pass connect information to and from VolServ.

Synopsis VST_BOOLEAN VS_Connect_Destroy (VST_CONNECT_HANDLE handle)

Arguments • handle = Connect handle to be destroyed.

Return Values VS_Connect_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_connect_handle 4 * 5 * PURPOSE: 6 * This function tests a connect handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/

Example 1 /****************************************

Page 161 of the ADIC 601355 Rev A user manual — VS_Connect_ Destroy
Page 161 · click to enlarge
Page 161

12 #ifdef ANSI_C 13 VST_BOOLEAN vst_connect_handle(void) 14 #else 15 VST_BOOLEAN vst_connect_handle() 16 #endif 17 { 18 VST_CONNECT_HANDLE h; 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_ENTERPRISE_ID EnterpriseID; 21 VST_SOCKADDR_IN SocketAddress; 22 VST_PROGRAM_NUMBER ProgramNumber; 23 VST_VERSION_NUMBER VersionNumber; 24 VST_PROCEDURE_NUMBER

ProcedureNumber; 25 VST_PROTOCOL Protocol; 26 27 /* create the handle */ 28 h = VS_Connect_Create(); 29 if (h != (VST_CONNECT_HANDLE) NULL) 30 { 31 /* get values from user */ 32 printf(“*** connect handle ***\n”); 33 printf(“Enter enterprise ID ==> “); 34 EnterpriseID = atol(gets(input)); 35 printf(“Enter Internet sin_port value ==> “); 36 SocketAddress.sin_port = (short) atoi(gets(input));; 37 printf(“Enter Internet sin_family value ==> “); 38 SocketAddress.sin_family = (short)

atoi(gets(input)); 39 printf(“Enter Internet sin_addr value ==> “); 40 SocketAddress.sin_addr = atol(gets(input)); 41 printf(“Enter program number ==> “);

Page 162 of the ADIC 601355 Rev A user manual — Notes
Page 162 · click to enlarge
Page 162

42 ProgramNumber = atol(gets(input)); 43 printf(“Enter version number ==> “); 44 VersionNumber = atol(gets(input)); 45 printf(“Enter procedure number ==> “); 46 ProcedureNumber = atol(gets(input)); 47 printf(“Enter Protocol ==> “); 48 Protocol = atol(gets(input)); 49 /* set the fields */ 50 rc = VS_Connect_SetFields(h, 51 VSID_ENTERPRISE_ID, EnterpriseID, 52 VSID_SOCKADDR_IN, SocketAddress, 53 VSID_PROGRAM_NUMBER, ProgramNumber, 54 VSID_VERSION_NUMBER, VersionNumber, 55 VSID_PROCEDURE_NUMBER, ProcedureNumber, 56 VSID_PROTOCOL, Protocol, 57 VSID_ENDFIELD); 58 if (rc) 59 { 60 vst_print_connect(h); 61 } 62 VS_Connect_Destroy(h); 63 } 64 return(rc); 65 }

See Also • vsapi(l),

Page 163 of the ADIC 601355 Rev A user manual — Notes
Page 163 · click to enlarge
Page 163
  • VS_Connect_Create(l),
  • VS_Connect_GetFields(l),
  • VS_Connect_SetFields(l),
  • VS_Error_GetFields(l)
Page 164 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)
Page 164 · click to enlarge
Page 164

VS_Connect_ GetFields

VS_Connect_GetFields retrieves information associated with a connect handle. A connect handle is used to pass connect information to and from VolServ.

Synopsis VST_BOOLEAN VS_Connect_GetFields (VST_CONNECT_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Connect handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the enterprise identifier associated with this client.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER *)

Pointer to the RPC procedure number of the client process to receive status messages from VolServ.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)

Pointer to the RPC program number of the client process to receive status messages.

Parameters · Parameter Type Description

Page 165 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER *)
Page 165 · click to enlarge
Page 165

VSID_PROTOCOL (VST_PROTOCOL *) Pointer to the Internet protocol to use to return status messages to the connected client process. Valid VSID_PROTOCOL values are enumerated in the vs_types.h file.

VSID_SOCKADDR_IN (VST_SOCKADDR_IN *)

Pointer to the Internet socket address for the client process.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER *)

Pointer to the RPC version number of the client process to receive status messages.

Return Values VS_Connect_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_connect 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a connect handle. 8 * 9 * PARAMETERS:

Parameter Type Description · Example 1 /****************************************

Page 166 of the ADIC 601355 Rev A user manual — Return Values
Page 166 · click to enlarge
Page 166

10 * h : the connect handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_connect(VST_CONNECT_HAN DLE h) 15 #else 16 void vst_print_connect(h) 17 VST_CONNECT_HANDLE h; 18 #endif 19 { 20 VST_ENTERPRISE_ID

ProcedureNumber; 25 VST_PROTOCOL Protocol; 26 27 VS_Connect_GetFields(h, 28 VSID_ENTERPRISE_ID, &EnterpriseID, 29 VSID_SOCKADDR_IN, &SocketAddress, 30 VSID_PROGRAM_NUMBER, &ProgramNumber, 31 VSID_VERSION_NUMBER, &VersionNumber, 32 VSID_PROCEDURE_NUMBER, &ProcedureNumber, 33 VSID_PROTOCOL, &Protocol, 34 VSID_ENDFIELD); 35 36 printf(“******* Connect Handle

Show 5 more labels / short text on this page
EnterpriseID; 21 VST_SOCKADDR_IN · SocketAddress; 22 VST_PROGRAM_NUMBER · ProgramNumber; 23 VST_VERSION_NUMBER · VersionNumber; 24 VST_PROCEDURE_NUMBER · *******\n”);
Page 167 of the ADIC 601355 Rev A user manual — Note
Page 167 · click to enlarge
Page 167

37 printf(“Enterprise ID = %d\n”,

EnterpriseID); 38 printf(“Socket Family = %d\n”,

SocketAddress.sin_family); 39 printf(“Socket Port = %d\n”,

SocketAddress.sin_port); 40 printf(“Socket Address = %lu\n”,

SocketAddress.sin_addr); 41 printf(“Program Number = %lu\n”,

ProgramNumber); 42 printf(“Version Number = %lu\n”,

VersionNumber); 43 printf(“Procedure Number = %lu\n”,

ProcedureNumber); 44 printf(“Protocol = %d\n”, Protocol); 45 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Connect_Create(l),
  • VS_Connect_Destroy(l),
  • VS_Connect_SetFields(l),
  • VS_Error_GetFields(l),
  • VSCMD_ConnectQuery(l),
  • VSCMD_Connect(l),
  • VSCMD_Disconnect(l)
Page 168 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 168 · click to enlarge
Page 168

VS_Connect_ SetFields

VS_Connect_SetFields sets the value of one or more fields in a connect handle. A connect handle is used to pass connect information to and from VolServ.

Synopsis VST_BOOLEAN VS_Connect_SetFields (VST_CONNECT_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Connect handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Enterprise identifier to associate with this client.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

RPC procedure number of the client process to receive status messages from VolServ.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number of the client process to receive status messages.

Parameters · Parameter Type Description

Page 169 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 169 · click to enlarge
Page 169

VSID_PROTOCOL (VST_PROTOCOL) Internet protocol to use to transmit status messages to this client. Valid VSID_PROTOCOL values are enumerated in the vs_types.h file.

VSID_SOCKADDR_IN (VST_SOCKADDR_IN)

Internet socket address for this client.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

RPC version number of the client process to receive status messages.

Return Values VS_Connect_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a connect handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_connect_handle 4 * 5 * PURPOSE: 6 * This function tests a connect handle.

Parameter Type Description · Example 1 /****************************************

Page 170 of the ADIC 601355 Rev A user manual — Return Values
Page 170 · click to enlarge
Page 170

7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_connect_handle(void) 14 #else 15 VST_BOOLEAN vst_connect_handle() 16 #endif 17 { 18 VST_CONNECT_HANDLE h; 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_ENTERPRISE_ID

ProcedureNumber; 25 VST_PROTOCOL Protocol; 26 27 /* create the handle */ 28 h = VS_Connect_Create(); 29 if (h != (VST_CONNECT_HANDLE) NULL) 30 { 31 /* get values from user */ 32 printf(“*** connect handle ***\n”); 33 printf(“Enter enterprise ID ==> “); 34 EnterpriseID = atol(gets(input)); 35 printf(“Enter Internet sin_port value ==> “); 36 SocketAddress.sin_port = (short) atoi(gets(input));;

Show 4 more labels / short text on this page
EnterpriseID; 21 VST_SOCKADDR_IN · SocketAddress; 22 VST_PROGRAM_NUMBER · ProgramNumber; 23 VST_VERSION_NUMBER · VersionNumber; 24 VST_PROCEDURE_NUMBER
Page 171 of the ADIC 601355 Rev A user manual — Return Values
Page 171 · click to enlarge
Page 171

37 printf(“Enter Internet sin_family value ==> “); 38 SocketAddress.sin_family = (short)

atoi(gets(input)); 39 printf(“Enter Internet sin_addr value ==> “); 40 SocketAddress.sin_addr = atol(gets(input)); 41 printf(“Enter program number ==> “); 42 ProgramNumber = atol(gets(input)); 43 printf(“Enter version number ==> “); 44 VersionNumber = atol(gets(input)); 45 printf(“Enter procedure number ==> “); 46 ProcedureNumber = atol(gets(input)); 47 printf(“Enter Protocol ==> “); 48 Protocol = atol(gets(input)); 49 /* set the fields */ 50 rc = VS_Connect_SetFields(h, 51 VSID_ENTERPRISE_ID, EnterpriseID, 52 VSID_SOCKADDR_IN, SocketAddress, 53 VSID_PROGRAM_NUMBER, ProgramNumber, 54 VSID_VERSION_NUMBER, VersionNumber, 55 VSID_PROCEDURE_NUMBER, ProcedureNumber, 56 VSID_PROTOCOL, Protocol, 57 VSID_ENDFIELD); 58 if (rc) 59 { 60 vst_print_connect(h); 61 }

Page 172 of the ADIC 601355 Rev A user manual — Note
Page 172 · click to enlarge
Page 172

62 VS_Connect_Destroy(h); 63 } 64 return(rc); 65 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Connect_Create(l),
  • VS_Connect_Destroy(l),
  • VS_Connect_GetFields(l),
  • VS_Error_GetFields(l),
  • VSCMD_Connect(l),
  • VSCMD_ConnectQuery(l),
  • VSCMD_Disconnect(l)
Page 173 of the ADIC 601355 Rev A user manual — Synopsis VST_CRITERIA_HANDLE VS_Criteria_Create ( void )
Page 173 · click to enlarge
Page 173

VS_Criteria_ Create

VS_Criteria_Create allocates a VolServ API criteria handle. A criteria handle is used to pass criteria information to and from VolServ.

A criteria has three parts: the field number corresponding to a media statistic, a sort order (ascending/descending), and a group of expression handles.

Together, the group of expression commands form a single criteria to test against media that have the given field number. The criteria group handle uses criteria handles to build a comparison function that uses more than one field numbers.

Synopsis VST_CRITERIA_HANDLE VS_Criteria_Create ( void )

Return Values VS_Criteria_Create returns:

  • A criteria handle, if one can be allocated
  • NULL, if a criteria handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

Arguments None

Page 174 of the ADIC 601355 Rev A user manual — Example
Page 174 · click to enlarge
Page 174

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to user 8 * input. 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 15 #else 16 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 17 #endif 18 { 19 int i; 20 int j; 21 int numcrit; 22 int numexpr; 23 VST_BOOLEAN rc = VSE_TRUE; 24 VST_EXPRESSION_HANDLE exprh; 25 VST_CRITERIA_HANDLE

criteriah; 26 VST_CRITERIAGROUP_HANDLE grouph; 27 VST_COUNT field; 28 VST_MOUNT_CRITERIA_ORDER sort; 29 VST_MEDIA_STAT_VALUE value; 30 VST_MOUNT_CRITERIA_OPT relopt; 31 VST_CONNECTIVE_OP conop; 32 33 /* create the criteria group */ 34 grouph = VS_CriteriaGroup_Create();

Example 1 /****************************************

Page 175 of the ADIC 601355 Rev A user manual — Example
Page 175 · click to enlarge
Page 175

35 36 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 37 { 38 /* out of memory -- return */ 39 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 40 } 41 42 /* populate the criteria group with

criteria (upto 5) */ 43 printf ( “Enter number of Criteria in

group ==> “ ); 44 numcrit = atoi(gets(input)); 45 46 for ( i = 0 ; i < numcrit ; i++ ) 47 { 48 /* create the criteria for a media */ 49 /* stat field */ 50 criteriah = VS_Criteria_Create(); 51 52 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 53 { 54 /* could not allocate handle */ 55 rc = VSE_FALSE; 56 break; 57 } 58 59 printf ( “Enter the media’s field number ==> “ ); 60 field = atoi(gets(input)); 61 62 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 63 sort = atoi(gets(input)); 64 65 /* set the criteria parameters */

Page 176 of the ADIC 601355 Rev A user manual — Example
Page 176 · click to enlarge
Page 176

66 VS_Criteria_SetFields ( criteriah, 67 VSID_FIELD, field, 68 VSID_MOUNT_CRITERIA_ORDER, sort 69 VSID_ENDFIELD ); 70 71 /* populate the critera with expressions */ 72 /* (up to 4) */ 73 printf ( “Enter the number of criteria expressions ==> “ ); 74 numexpr = atoi(gets(input)); 75 76 for ( j = 0 ; j < numexpr ; j++ ) 77 { 78 /* create an expression for this criteria */ 79 exprh = VS_Expression_Create(); 80 81 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 82 { 83 /* could not allocate memory for this handle */ 84 rc = VSE_FALSE; 85 break; 86 } 87 88 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 89 relopt = atoi(gets(input)); 90 91 printf ( “Enter the media field value ==> “ ); 92 gets( value); 93 94 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ );

Page 177 of the ADIC 601355 Rev A user manual — Example
Page 177 · click to enlarge
Page 177

95 conop = atoi(gets(input)); 96 97 /* set the expression’s parameters */ 98 VS_Expression_SetFields ( exprh, 99 VSID_MOUNT_CRITERIA_OPT, relopt, 100 VSID_CONNECTIVE_OP, conop, 101 VSID_MEDIA_STAT_VALUE, value, 102 VSID_ENDFIELD ); 103 104 /* add the expression to the criteria */ 105 VS_Criteria_SetFields ( criteriah, 106 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 107 VSID_ENDFIELD ); 108 } 109 110 /* add the criteria to the criteria group */ 111 VS_CriteriaGroup_SetFields ( grouph, 112 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 113 VSID_ENDFIELD ); 114 } 115 116 /* if it failed, destroy the criteria

group handle */ 117 if ( rc == VSE_FALSE ) 118 { 119 /* criteria group will destroy any */ 120 /* criteria and their expressions */ 121 /* for us */

Page 178 of the ADIC 601355 Rev A user manual — Notes
Page 178 · click to enlarge
Page 178

122 VS_CriteriaGroup_Destroy ( grouph ); 123 124 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 125 } 126 127 return ( grouph ); 128}

See Also • vsapi(l),

  • VS_Criteria_Delete(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Delete(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 179 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Criteria_Destroy ( VST _ CRITERIA _ HANDLE handle )
Page 179 · click to enlarge
Page 179

VS_Criteria_ Destroy

VS_Criteria_Destroy deallocates a criteria handle that was allocated with VS_Criteria_Create. A criteria handle is used to pass criteria information to and from VolServ.

Synopsis VST_BOOLEAN VS_Criteria_Destroy ( VST _ CRITERIA _ HANDLE handle )

Arguments • handle = Criteria handle to be destroyed.

Return Values VS_Criteria_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to user 8 *input. 9 * 10 * PARAMETERS: 11 * none

Example 1 /****************************************

Page 180 of the ADIC 601355 Rev A user manual — VS_Criteria_ Destroy
Page 180 · click to enlarge
Page 180

12 * 13 **************************************** *********/ 14 #ifdef ANSI_C 15 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 16 #else 17 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 18 #endif 19 { 20 int i; 21 int j; 22 int numcrit; 23 int numexpr; 24 VST_BOOLEAN rc = VSE_TRUE; 25 VST_EXPRESSION_HANDLE exprh; 26 VST_CRITERIA_HANDLE

criteriah; 27 VST_CRITERIAGROUP_HANDLE grouph; 28 VST_COUNT field; 29 VST_MOUNT_CRITERIA_ORDER sort; 30 VST_MEDIA_STAT_VALUE value; 31 VST_MOUNT_CRITERIA_OPT relopt; 32 VST_CONNECTIVE_OP conop; 33 34 /* create the criteria group */ 35 grouph = VS_CriteriaGroup_Create(); 36 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 37 { 38 /* out of memory -- return */ 39 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 40 } 41 /* populate the criteria group with

criteria */ 42 /* (upto 5) */ 43 printf ( “Enter number of Criteria in

group ==> “ );

Page 181 of the ADIC 601355 Rev A user manual — VS_Criteria_ Destroy
Page 181 · click to enlarge
Page 181

44 numcrit = atoi(gets(input)); 45 for ( i = 0 ; i < numcrit ; i++ ) 46 { 47 /* create the criteria for a media stat field */ 48 criteriah = VS_Criteria_Create(); 49 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 50 { 51 /* could not allocate handle */ 52 rc = VSE_FALSE; 53 break; 54 } 55 printf ( “Enter the media’s field number ==> “ ); 56 field = atoi(gets(input)); 57 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==>“ ); 58 sort = atoi(gets(input)); 59 /* set the criteria parameters */ 60 VS_Criteria_SetFields ( criteriah, 61 VSID_FIELD, field, 62 VSID_MOUNT_CRITERIA_ORDER, sort, 63 VSID_ENDFIELD ); 64 /* populate the critera with expressions */ 65 /* (upto 4) */ 66 printf ( “Enter the number of criteria expressions ==> “ ); 67 numexpr = atoi(gets(input)); 68 for ( j = 0 ; j < numexpr ; j++ ) 69 { 70 /* create an expression for this criteria */ 71 exprh = VS_Expression_Create(); 72 if ( exprh == (VST_EXPRESSION_HANDLE) NULL )

Page 182 of the ADIC 601355 Rev A user manual — VS_Criteria_ Destroy
Page 182 · click to enlarge
Page 182

73 { 74 /* could not allocate memory for this */ 75 /* handle */ 76 rc = VSE_FALSE; 77 break; 78 } 79 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 80 relopt = atoi(gets(input)); 81 printf ( “Enter the media field value ==> “ ); 82 gets( value); 83 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 84 conop = atoi(gets(input)); 85 /* set the expression’s parameters */ 86 VS_Expression_SetFields ( exprh, 87 VSID_MOUNT_CRITERIA_OPT, relopt, 88 VSID_CONNECTIVE_OP, conop, 89 VSID_MEDIA_STAT_VALUE, value, 90 VSID_ENDFIELD ); 91 /* add the expression to the criteria */ 92 VS_Criteria_SetFields ( criteriah, 93 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 94 VSID_ENDFIELD ); 95 } 96 /* add the criteria to the criteria group */ 97 VS_CriteriaGroup_SetFields ( grouph,

Page 183 of the ADIC 601355 Rev A user manual — VS_Criteria_ Destroy
Page 183 · click to enlarge
Page 183

98 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 99 VSID_ENDFIELD ); 100 } 101 /* if it failed, destroy the criteria

group handle */ 102 if ( rc == VSE_FALSE ) 103 { 104 /* criteria group will destroy any */ 105 /* criteria and their expressions */ 106 /* for us, so the only thing that is really */ 107 /* needed here is a call to*/ 108 /* VS_CriteriaGroup_Destroy. This is written*/ 109 /* out the ’long way’ for documentation*/ 110 /* purposes. First, get the number of criteria */ 111 VS_CriteriaGroup_GetFields(grouph , 112 VSID_NUMBER_ENTRIES, &numcrit, 113 VSID_ENDFIELD); 114 for (i = 0; i < numcrit; i++) 115 { 116 /* get a criteria handle */ 117 VS_CriteriaGroup_GetFields(grouph , 118 VSID_CRITERIA_HANDLE_ENTRY, i, &criteriah, 119 VSID_ENDFIELD); 120 /* get the number of expressions */ 121 VS_Criteria_GetFields(criteriah, 122 VSID_NUMBER_ENTRIES, &numexpr,

Page 184 of the ADIC 601355 Rev A user manual — VS_Criteria_ Destroy
Page 184 · click to enlarge
Page 184

123 VSID_ENDFIELD); 124 for (j = 0; j < numexpr; j++) 125 { 126 /* get the expressions from the criteria */ 127 VS_Criteria_GetFields(criteriah, 128 VSID_EXPRESSION_HANDLE_ENTRY, j, &exprh, 129 VSID_ENDFIELD); 130 /* destroy the expression handle */ 131 /* VS_Expression_Destroy(exprh);*/ 132 /* let criteria handle know that the */ 133 /* expression handle has been destroyed */ 134 VS_Criteria_SetFields(criteriah, 135 VSID_EXPRESSION_HANDLE_ENTRY, j, NULL, 136 VSID_ENDFIELD); 137 } 138 /* now, destroy Criteria handle. */ 139 VS_Criteria_Destroy(criteriah); 140 /* let the criteria group handle know */ 141 /* that Criteria handle has been */ 142 /* destroyed. */ 143 VS_CriteriaGroup_SetFields(grouph , 144 VSID_CRITERIA_HANDLE_ENTRY, i, NULL, 145 VSID_ENDFIELD);

Page 185 of the ADIC 601355 Rev A user manual — Notes
Page 185 · click to enlarge
Page 185

146 } 147 /* finally, destroy the criteria group handle. */ 148 VS_CriteriaGroup_Destroy ( grouph ); 149 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 150 } 151 return ( grouph ); 152}

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create,(l)
  • VS_Expression_Delete(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 186 of the ADIC 601355 Rev A user manual — VSID_MOUNT_CRITERIA_ORDER (VST_MOUNT_CRITERIA_ORDER*)
Page 186 · click to enlarge
Page 186

VS_Criteria_ GetFields

VS_Criteria_GetFields retrieves information associated with a criteria handle. A criteria group handle is used to pass criteria information to and from VolServ.

Synopsis VST_BOOLEAN VS_Criteria_GetFields ( VST_CRITERIA_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Criteria handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_NUMBER_ENTRIES (VST_COUNT *) Pointer to the number of expression handles within this criteria handle.

VSID_FIELD (VST_COUNT *) Pointer to the field number of the media statistic for this criteria.

VSID_MOUNT_CRITERIA_ORDER (VST_MOUNT_CRITERIA_ORDER*)

Pointer to the sort ordering for the media that pass the given criteria expressions.

VSID_EXPRESSION_HANDLE_ENTRY (int) Expression handle and its place in the criteria.

Parameters · Parameter Type Description

Page 187 of the ADIC 601355 Rev A user manual — Return Values
Page 187 · click to enlarge
Page 187

(VST_EXPRESSION_HANDLE *) Pointer to the expression handle and its place in the criteria.

Return Values VS_Criteria_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a criteria handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_criteria_group 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a criteria group handle. 8 * 9 * PARAMETERS: 10 * grouph : the mount handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C

Parameter Type Description · Example 1 /****************************************

Page 188 of the ADIC 601355 Rev A user manual — Return Values
Page 188 · click to enlarge
Page 188

vst_print_criteria_group (VST_CRITERIAGROUP_HANDLE grouph) 15 #else 16 void

vst_print_criteria_group(grouph) 17 VST_CRITERIAGROUP_HANDLE grouph; 18 #endif 19 { 20 int i, j; 21 int numcrit = 0; 22 int numexpr = 0; 23 24 VST_EXPRESSION_HANDLE

exprh = (VST_EXPRESSION_HANDLE) NULL; 25 VST_CRITERIA_HANDLE

criteriah = (VST_CRITERIA_HANDLE) NULL; 26 27 VST_COUNT field; 28 VST_MOUNT_CRITERIA_ORDER sort; 29 VST_MEDIA_STAT_VALUE value; 30 VST_MOUNT_CRITERIA_OPT relopt; 31 VST_CONNECTIVE_OP conop; 32 33 /* get the number of criteria within

this group */ 34 VS_CriteriaGroup_GetFields ( grouph, 35 VSID_NUMBER_ENTRIES, &numcrit, VSID_ENDFIELD ); 36 37 for ( i = 0 ; i < numcrit ; i++ ) 38 { 39 /* get the criteria to print */ 40 VS_CriteriaGroup_GetFields ( grouph, 41 VSID_CRITERIA_HANDLE_ENTRY, i, &criteriah, 42 VSID_ENDFIELD );

14 void

Page 189 of the ADIC 601355 Rev A user manual — Return Values
Page 189 · click to enlarge
Page 189

43 44 /* get the criteria parameters */ 45 VS_Criteria_GetFields ( criteriah, 46 VSID_FIELD, &field, 47 VSID_MOUNT_CRITERIA_ORDER, &sort, 48 VSID_NUMBER_ENTRIES, &numexpr, 49 VSID_ENDFIELD ); 50 51 printf ( “*** Criteria # %d ***\n”, i ); 52 printf ( “ Field Index ==> %d\n”, field ); 53 printf ( “ Mount Criteria Order ==> %d\n”, sort ); 54 printf ( “Number of Expressions ==> %d\n”, numexpr ); 55 56 for ( j = 0 ; j < numexpr ; j++ ) 57 { 58 /* get the expression to print */ 59 VS_Criteria_GetFields ( criteriah, 60 VSID_EXPRESSION_HANDLE_ENTRY, j, &exprh, 61 VSID_ENDFIELD ); 62 63 /* get the expression’s parameters */ 64 VS_Expression_GetFields ( exprh, 65 VSID_MOUNT_CRITERIA_OPT, &relopt, 66 VSID_CONNECTIVE_OP, &conop, 67 VSID_MEDIA_STAT_VALUE, value,

Page 190 of the ADIC 601355 Rev A user manual — Note
Page 190 · click to enlarge
Page 190

68 VSID_ENDFIELD ); 69 70 printf ( “*** Expression # %d ***\n”, j ); 71 printf ( “Mount Criteria Option ==> %d\n”, relopt); 72 printf ( “ Media Stat Value ==> %s\n”, value ); 73 printf ( “ Connective Operation ==> %d\n”, conop ); 74 } 75 } 76 77 return; 78 }

  • The first argument is the entry number in the criteria.
  • The second argument is Pointer to the location where the value is stored.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_SetFields(l),
  • VS_Error_Getfields(l),
  • VS_Expression_Create(l),
Page 191 of the ADIC 601355 Rev A user manual — Notes
Page 191 · click to enlarge
Page 191
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields (l),
  • VS_Expression_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VSCMD_Mount(l)
Page 192 of the ADIC 601355 Rev A user manual — VSID_MOUNT_CRITERIA_ORDER (VST_MOUNT_CRITERIA_ORDER)
Page 192 · click to enlarge
Page 192

VS_Criteria_ SetFields

VS_Criteria_SetFields sets the value of one or more field in a criteria handle. A criteria handle is used to pass criteria information to and from VolServ.

Synopsis VST_BOOLEAN VS_Criteria_SetFields ( VST_CRITERIA_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Criteria handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_FIELD (VST_COUNT) Field number of the media statistic for this criteria.

VSID_MOUNT_CRITERIA_ORDER (VST_MOUNT_CRITERIA_ORDER)

Sort ordering for the media that pass the given criteria expressions.

VSID_EXPRESSION_HANDLE_ENTRY (int) Expression handle and its place in the criteria.

(VST_EXPRESSION_HANDLE) Expression handle for the criteria.

Parameters · Parameter Type Description

Page 193 of the ADIC 601355 Rev A user manual — Return Values
Page 193 · click to enlarge
Page 193

Return Values VS_Criteria_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a criteria handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to 8 * user input. 9 * 10 * PARAMETERS: 11 * none 12 * 13 **************************************** *********/ 14 #ifdef ANSI_C

Example 1 /****************************************

Page 194 of the ADIC 601355 Rev A user manual — 15 VST_CRITERIAGROUP_HANDLE
Page 194 · click to enlarge
Page 194

15 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 16 #else 17 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 18 #endif 19 { 20 int i; 21 int j; 22 int numcrit; 23 int numexpr; 24 VST_BOOLEAN rc = VSE_TRUE; 25 VST_EXPRESSION_HANDLE exprh; 26 VST_CRITERIA_HANDLE

criteriah; 27 VST_CRITERIAGROUP_HANDLE grouph; 28 VST_COUNT field; 29 VST_MOUNT_CRITERIA_ORDER sort; 30 VST_MEDIA_STAT_VALUE value; 31 VST_MOUNT_CRITERIA_OPT relopt; 32 VST_CONNECTIVE_OP conop; 33 34 /* create the criteria group */ 35 grouph = VS_CriteriaGroup_Create(); 36 37 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 38 { 39 /* out of memory -- return */ 40 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 41 } 42 43 /* populate the criteria group with

criteria */ 44 /* (upto 5) */ 45 printf ( “Enter number of Criteria in

group ==> “ ); 46 numcrit = atoi(gets(input)); 47

Page 195 of the ADIC 601355 Rev A user manual — Return Values
Page 195 · click to enlarge
Page 195

48 for ( i = 0 ; i < numcrit ; i++ ) 49 { 50 /* create the criteria for a media stat field */ 51 criteriah = VS_Criteria_Create(); 52 53 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 54 { 55 /* could not allocate handle */ 56 rc = VSE_FALSE; 57 break; 58 } 59 60 printf ( “Enter the media’s field number ==> “ ); 61 field = atoi(gets(input)); 62 63 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 64 sort = atoi(gets(input)); 65 66 /* set the criteria parameters */ 67 VS_Criteria_SetFields ( criteriah, 68 VSID_FIELD, field, 69 VSID_MOUNT_CRITERIA_ORDER, sort, 70 VSID_ENDFIELD ); 71 /* populate the critera with expressions */ 72 /* (upto 4) */ 73 printf ( “Enter the number of criteria expressions ==> “ ); 74 numexpr = atoi(gets(input)); 75 76 for ( j = 0 ; j < numexpr ; j++ ) 77 { 78 /* create an expression for this criteria */

Page 196 of the ADIC 601355 Rev A user manual — Return Values
Page 196 · click to enlarge
Page 196

79 exprh = VS_Expression_Create(); 80 81 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 82 { 83 /* could not allocate memory for this */ 84 /* handle */ 85 rc = VSE_FALSE; 86 break; 87 } 88 89 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 90 relopt = atoi(gets(input)); 91 92 printf ( “Enter the media field value ==> “ ); 93 gets( value); 94 95 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 96 conop = atoi(gets(input)); 97 98 /* set the expression’s parameters */ 99 VS_Expression_SetFields ( exprh, 100 VSID_MOUNT_CRITERIA_OPT, relopt, 101 VSID_CONNECTIVE_OP, conop, 102 VSID_MEDIA_STAT_VALUE, value, 103 VSID_ENDFIELD ); 104 105 /* add the expression to the criteria */

Page 197 of the ADIC 601355 Rev A user manual — Return Values
Page 197 · click to enlarge
Page 197

106 VS_Criteria_SetFields ( criteriah, 107 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 108 VSID_ENDFIELD ); 109 } 110 111 /* add the criteria to the criteria group */ 112 VS_CriteriaGroup_SetFields ( grouph, 113 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 114 VSID_ENDFIELD ); 115 } 116 117 /* if it failed, destroy the criteria

group handle */ 118 if ( rc == VSE_FALSE ) 119 { 120 /* criteria group will destroy any */ 121 /* criteria and their expressions */ 122 /* for us */ 123 VS_CriteriaGroup_Destroy ( grouph ); 124 125 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 126 } 127 128 return ( grouph ); 129}

Page 198 of the ADIC 601355 Rev A user manual — Note
Page 198 · click to enlarge
Page 198
  • The first argument is the entry number in the criteria.
  • The second argument is Pointer to the location where the value is stored.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 199 of the ADIC 601355 Rev A user manual — Synopsis VST_CRITERIAGROUP_HANDLE VS_CriteriaGroup_Create ( void )
Page 199 · click to enlarge
Page 199

VS_ CriteriaGroup _Create

VS_CriteriaGroup_Create allocates a VolServ API criteria group handle. A criteria group handle is used to pass criteria group information to and from VolServ.

Synopsis VST_CRITERIAGROUP_HANDLE VS_CriteriaGroup_Create ( void )

Return Values VS_CriteriaGroup_Create returns:

  • A criteria group handle, if one can be allocated.
  • NULL, if a criteria group handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to user 8 * input. 9 * 10 * PARAMETERS: 11 * none 12 *

Arguments None · Example 1 /****************************************

Page 200 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Create
Page 200 · click to enlarge
Page 200

13 **************************************** *********/ 14 #ifdef ANSI_C 15 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 16 #else 17 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 18 #endif 19 { 20 int i; 21 int j; 22 int numcrit; 23 int numexpr; 24 VST_BOOLEAN rc = VSE_TRUE; 25 VST_EXPRESSION_HANDLE exprh; 26 VST_CRITERIA_HANDLE

criteriah; 27 VST_CRITERIAGROUP_HANDLE grouph; 28 VST_COUNT field; 29 VST_MOUNT_CRITERIA_ORDER sort; 30 VST_MEDIA_STAT_VALUE value; 31 VST_MOUNT_CRITERIA_OPT relopt; 32 VST_CONNECTIVE_OP conop; 33 34 /* create the criteria group */ 35 grouph = VS_CriteriaGroup_Create(); 36 37 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 38 { 39 /* out of memory -- return */ 40 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 41 } 42 43 /* populate the criteria group with

criteria */ 44 /* (upto 5) */

Page 201 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Create
Page 201 · click to enlarge
Page 201

45 printf ( “Enter number of Criteria in

group ==> “ ); 46 numcrit = atoi(gets(input)); 47 48 for ( i = 0 ; i < numcrit ; i++ ) 49 { 50 /* create the criteria for a media stat field */ 51 criteriah = VS_Criteria_Create(); 52 53 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 54 { 55 /* could not allocate handle */ 56 rc = VSE_FALSE; 57 break; 58 } 59 60 printf ( “Enter the media’s field number ==> “ ); 61 field = atoi(gets(input)); 62 63 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 64 sort = atoi(gets(input)); 65 66 /* set the criteria parameters */ 67 /VS_Criteria_SetFields ( criteriah, 68 VSID_FIELD, field, 69 VSID_MOUNT_CRITERIA_ORDER, sort, 70 VSID_ENDFIELD ); 71 72 /* populate the critera with expressions */ 73 /* (upto 4) */ 74 printf ( “Enter the number of criteria expressions ==> “ ); 75 numexpr = atoi(gets(input));

Page 202 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Create
Page 202 · click to enlarge
Page 202

76 77 for ( j = 0 ; j < numexpr ; j++ ) 78 { 79 /* create an expression for this criteria */ 80 exprh = VS_Expression_Create(); 81 82 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 83 { 84 /* could not allocate memory for this */ 85 /* handle */ 86 rc = VSE_FALSE; 87 break; 88 } 89 90 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 91 relopt = atoi(gets(input)); 92 93 printf ( “Enter the media field value ==> “ ); 94 gets( value); 95 96 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 97 conop = atoi(gets(input)); 98 99 /* set the expression’s parameters */ 100 VS_Expression_SetFields ( exprh, 101 VSID_MOUNT_CRITERIA_OPT, relopt, 102 VSID_CONNECTIVE_OP, conop, 103 VSID_MEDIA_STAT_VALUE, value,

Page 203 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Create
Page 203 · click to enlarge
Page 203

104 VSID_ENDFIELD ); 105 106 /* add the expression to the criteria */ 107 VS_Criteria_SetFields ( criteriah, 108 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 109 VSID_ENDFIELD ); 110 111 } 112 /* add the criteria to the criteria group */ 113 VS_CriteriaGroup_SetFields ( grouph, 114 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 115 VSID_ENDFIELD ); 116 } 117 118 /* if it failed, destroy the criteria

group handle */ 119 if ( rc == VSE_FALSE ) 120 { 121 /* criteria group will destroy any */ 122 /* criteria and their expressions */ 123 /* for us */ 124 VS_CriteriaGroup_Destroy ( grouph ); 125 126 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 127 } 128 129 return ( grouph ); 130}

Page 204 of the ADIC 601355 Rev A user manual — Notes
Page 204 · click to enlarge
Page 204

A criteria group is used by the Mount and MultiMount commands when a client specifies criteria to be used by VolServ when selecting the medium or media to honor the Mount/MultiMount request. Criteria groups applicable to a Mount/MultiMount request can be specified either on the command itself or in a Mount handle.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l), V
  • S_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VS_Mount_SetFields(l),
  • VSCMD_Mount(l)
Page 205 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_CriteriaGroup_Destroy ( VST_CRITERIAGROUP_HANDLE handle )
Page 205 · click to enlarge
Page 205

VS_ CriteriaGroup _Destroy

VS_CriteriaGroup_Destroy deallocates a criteria group handle that was allocated with VS_CriteriaGroup_Create. A criteria group handle is used to pass criteria group information to and from VolServ.

Synopsis VST_BOOLEAN VS_CriteriaGroup_Destroy ( VST_CRITERIAGROUP_HANDLE handle )

Arguments • handle = Criteria group handle to be destroyed.

Return Values VS_CriteriaGroup_Destroy returns a criteria group handle if one can be allocated.

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADHANDLE - Specified handle was not a criteria group handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to 8 * user input.

Example 1 /****************************************

Page 206 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Destroy
Page 206 · click to enlarge
Page 206

9 * 10 * PARAMETERS: 11 * none 12 * 13 **************************************** *********/ 14 #ifdef ANSI_C 15 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 16 #else 17 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 18 #endif 19 { 20 int i; 21 int j; 22 int numcrit; 23 int numexpr; 24 VST_BOOLEAN rc = VSE_TRUE; 25 VST_EXPRESSION_HANDLE exprh; 26 VST_CRITERIA_HANDLE

criteriah; 27 VST_CRITERIAGROUP_HANDLE grouph; 28 VST_COUNT field; 29 VST_MOUNT_CRITERIA_ORDER sort; 30 VST_MEDIA_STAT_VALUE value; 31 VST_MOUNT_CRITERIA_OPT relopt; 32 VST_CONNECTIVE_OP conop; 33 34 /* create the criteria group */ 35 grouph = VS_CriteriaGroup_Create(); 36 37 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 38 { 39 /* out of memory -- return */ 40 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 41 } 42

Page 207 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Destroy
Page 207 · click to enlarge
Page 207

43 /* populate the criteria group with

criteria */ 44 /* (upto 5) */ 45 printf ( “Enter number of Criteria in

group ==> “ ); 46 numcrit = atoi(gets(input)); 47 48 for ( i = 0 ; i < numcrit ; i++ ) 49 { 50 /* create the criteria for a media stat field */ 51 criteriah = VS_Criteria_Create(); 52 53 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 54 { 55 /* could not allocate handle */ 56 rc = VSE_FALSE; 57 break; 58 } 59 60 printf ( “Enter the media’s field number ==> “ ); 61 field = atoi(gets(input)); 62 63 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 64 sort = atoi(gets(input)); 65 66 /* set the criteria parameters */ 67 /VS_Criteria_SetFields ( criteriah, 68 VSID_FIELD, field, 69 VSID_MOUNT_CRITERIA_ORDER, sort, 70 VSID_ENDFIELD ); 71 72 /* populate the critera with expressions */ 73 /* (upto 4) */

Page 208 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Destroy
Page 208 · click to enlarge
Page 208

74 printf ( “Enter the number of criteria expressions ==> “ ); 75 numexpr = atoi(gets(input)); 76 77 for ( j = 0 ; j < numexpr ; j++ ) 78 { 79 /* create an expression for this criteria */ 80 exprh = VS_Expression_Create(); 81 82 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 83 { 84 /* could not allocate memory for this */ 85 /* handle */ 86 rc = VSE_FALSE; 87 break; 88 } 89 90 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 91 relopt = atoi(gets(input)); 92 93 printf ( “Enter the media field value ==> “ ); 94 gets( value); 95 96 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 97 conop = atoi(gets(input)); 98 99 /* set the expression’s parameters */ 100 VS_Expression_SetFields ( exprh, 101 VSID_MOUNT_CRITERIA_OPT, relopt,

Page 209 of the ADIC 601355 Rev A user manual — VS_ CriteriaGroup _Destroy
Page 209 · click to enlarge
Page 209

102 VSID_CONNECTIVE_OP, conop, 103 VSID_MEDIA_STAT_VALUE, value, 104 VSID_ENDFIELD ); 105 106 /* add the expression to the criteria */ 107 VS_Criteria_SetFields ( criteriah, 108 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 109 VSID_ENDFIELD ); 110 111 } 112 /* add the criteria to the criteria group */ 113 VS_CriteriaGroup_SetFields ( grouph, 114 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 115 VSID_ENDFIELD ); 116 } 117 118 /* if it failed, destroy the criteria

group handle */ 119 if ( rc == VSE_FALSE ) 120 { 121 /* criteria group will destroy any */ 122 /* criteria and their expressions */ 123 /* for us */ 124 VS_CriteriaGroup_Destroy ( grouph ); 125 126 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 127 } 128 129 return ( grouph );

Page 210 of the ADIC 601355 Rev A user manual — Notes
Page 210 · click to enlarge
Page 210

Destroying the CriteriaGroup handle automatically destroys the underlying criteria and expressions.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)

130}

Page 211 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_CriteriaGroup_GetFields (VST_CRITERIAGROUP_HANDLE handle, “…”, VSID_ENDFIELD)
Page 211 · click to enlarge
Page 211

VS_ CriteriaGroup _GetFields

VS_CriteriaGroup_GetFields retrieves information associated with a criteria group handle. A criteria group handle is used to pass criteria group information to and from VolServ.

Synopsis VST_BOOLEAN VS_CriteriaGroup_GetFields (VST_CRITERIAGROUP_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = Media handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_NUMBER_ENTRIES (VST_COUNT *) Pointer to the number of criteria handles within this criteria group handle.

VSID_CRITERIA_HANDLE_ENTRY (int) Criteria handle and its place in the criteria group.

(VST_CRITERIA_HANDLE *) Pointer to Criteria handle for this group.

Return Values VS_CriteriaGroup_GetFields returns:

Parameters · Parameter Type Description

Page 212 of the ADIC 601355 Rev A user manual — Example
Page 212 · click to enlarge
Page 212
  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a criteria group handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_criteria_group 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a criteria group handle. 8 * 9 * PARAMETERS: 10 * grouph : the mount handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_criteria_group (VST_CRITERIAGROUP_HANDLE grouph) 15 #else 16 void

vst_print_criteria_group(grouph) 17 VST_CRITERIAGROUP_HANDLE grouph; 18 #endif 19 { 20 int i, j;

Example 1 /****************************************

Page 213 of the ADIC 601355 Rev A user manual — Example
Page 213 · click to enlarge
Page 213

21 int numcrit = 0; 22 int numexpr = 0; 23 24 VST_EXPRESSION_HANDLE exprh =

(VST_EXPRESSION_HANDLE) NULL; 25 VST_CRITERIA_HANDLE criteriah =

(VST_CRITERIA_HANDLE) NULL; 26 27 VST_COUNT field; 28 VST_MOUNT_CRITERIA_ORDER sort; 29 VST_MEDIA_STAT_VALUE value; 30 VST_MOUNT_CRITERIA_OPT relopt; 31 VST_CONNECTIVE_OP conop; 32 33 /* get the number of criteria within

this group */ 34 VS_CriteriaGroup_GetFields ( grouph, 35 VSID_NUMBER_ENTRIES, &numcrit, 36 VSID_ENDFIELD ); 37 38 for ( i = 0 ; i < numcrit ; i++ ) 39 { 40 /* get the criteria to print */ 41 VS_CriteriaGroup_GetFields ( grouph, 42 VSID_CRITERIA_HANDLE_ENTRY, i, &criteriah, 43 VSID_ENDFIELD ); 44 45 /* get the criteria parameters */ 46 VS_Criteria_GetFields ( criteriah, 47 VSID_FIELD, &field, 48 VSID_MOUNT_CRITERIA_ORDER, &sort, 49 VSID_NUMBER_ENTRIES, &numexpr, 50 VSID_ENDFIELD ); 51

Page 214 of the ADIC 601355 Rev A user manual — Example
Page 214 · click to enlarge
Page 214

52 printf ( “*** Criteria # %d ***\n”, i ); 53 printf ( “ Field Index ==> %d\n”, field ); 54 printf ( “ Mount Criteria Order ==> %d\n”, sort ); 55 printf ( “Number of Expressions ==> %d\n”, numexpr ); 56 57 for ( j = 0 ; j < numexpr ; j++ ) 58 { 59 /* get the expression to print */ 60 VS_Criteria_GetFields ( criteriah, 61 VSID_EXPRESSION_HANDLE_ENTRY, j, &exprh, 62 VSID_ENDFIELD ); 63 64 /* get the expression’s parameters */ 65 VS_Expression_GetFields ( exprh, 66 VSID_MOUNT_CRITERIA_OPT, &relopt, 67 VSID_CONNECTIVE_OP, &conop, 68 VSID_MEDIA_STAT_VALUE, value, 69 VSID_ENDFIELD ); 70 71 printf ( “*** Expression # %d ***\n”, j ); 72 printf ( “Mount Criteria Option ==> %d\n”, relopt); 73 printf ( “ Media Stat Value ==> %s\n”, value); 74 printf ( “ Connective Operation ==> %d\n”, conop); 75 } 76 }

Page 215 of the ADIC 601355 Rev A user manual — Note
Page 215 · click to enlarge
Page 215

77 78 return; 79 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 216 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_CriteriaGroup_SetFields ( VST_CRITERIAGROUP_HANDLE handle, “…”, VSID_ENDFIELD )
Page 216 · click to enlarge
Page 216

VS_ CriteriaGroup _SetFields

VS_CriteriaGroup_SetFields sets the value of one or more fields in a criteria group handle. A criteria group handle is used to pass information to and from VolServ.

Synopsis VST_BOOLEAN VS_CriteriaGroup_SetFields ( VST_CRITERIAGROUP_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Criteria group handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CRITERIA_HANDLE_ENTRY(int) Criteria handle and its place in the criteria group.

(VST_CRITERIA_HANDLE) Criteria handle for this group.

Parameters · Parameter Type Description

Page 217 of the ADIC 601355 Rev A user manual — Return Values
Page 217 · click to enlarge
Page 217

Return Values VS_CriteriaGroup_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a criteria group handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to user 8 * input. 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C

Example 1 /****************************************

Page 218 of the ADIC 601355 Rev A user manual — 14 VST_CRITERIAGROUP_HANDLE
Page 218 · click to enlarge
Page 218

14 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 15 #else 16 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 17 #endif 18 { 19 int i; 20 int j; 21 int numcrit; 22 int numexpr; 23 VST_BOOLEAN rc = VSE_TRUE; 24 VST_EXPRESSION_HANDLE exprh; 25 VST_CRITERIA_HANDLE

criteriah; 26 VST_CRITERIAGROUP_HANDLE grouph; 27 VST_COUNT field; 28 VST_MOUNT_CRITERIA_ORDER sort; 29 VST_MEDIA_STAT_VALUE value; 30 VST_MOUNT_CRITERIA_OPT relopt; 31 VST_CONNECTIVE_OP conop; 32 33 /* create the criteria group */ 34 grouph = VS_CriteriaGroup_Create(); 35 36 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 37 { 38 /* out of memory -- return */ 39 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 40 } 41 42 /* populate the criteria group with

criteria */ 43 /* (upto 5) */ 44 printf ( “Enter number of Criteria in

group ==> “ ); 45 numcrit = atoi(gets(input)); 46

Page 219 of the ADIC 601355 Rev A user manual — Return Values
Page 219 · click to enlarge
Page 219

47 for ( i = 0 ; i < numcrit ; i++ ) 48 { 49 /* create the criteria for a media stat field */ 50 criteriah = VS_Criteria_Create(); 51 52 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 53 { 54 /* could not allocate handle */ 55 rc = VSE_FALSE; 56 break; 57 } 58 59 printf ( “Enter the media’s field number ==> “ ); 60 field = atoi(gets(input)); 61 62 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 63 sort = atoi(gets(input)); 64 65 /* set the criteria parameters */ 66 /VS_Criteria_SetFields ( criteriah, 67 VSID_FIELD, field, 68 VSID_MOUNT_CRITERIA_ORDER, sort, 69 VSID_ENDFIELD ); 70 71 /* populate the criteria with expressions */ 72 /* (upto 4) */ 73 printf ( “Enter the number of criteria expressions ==> “ ); 74 numexpr = atoi(gets(input)); 75 76 for ( j = 0 ; j < numexpr ; j++ ) 77 {

Page 220 of the ADIC 601355 Rev A user manual — Return Values
Page 220 · click to enlarge
Page 220

78 /* create an expression for this criteria */ 79 exprh = VS_Expression_Create(); 80 81 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 82 { 83 /* could not allocate memory for this */ 84 /* handle */ 85 rc = VSE_FALSE; 86 break; 87 } 88 89 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 90 relopt = atoi(gets(input)); 91 92 printf ( “Enter the media field value ==> “ ); 93 gets( value); 94 95 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 96 conop = atoi(gets(input)); 97 98 /* set the expression’s parameters */ 99 VS_Expression_SetFields ( exprh, 100 VSID_MOUNT_CRITERIA_OPT,

relopt, 101 VSID_CONNECTIVE_OP, conop, 102 VSID_MEDIA_STAT_VALUE, value, 103 VSID_ENDFIELD ); 104

Page 221 of the ADIC 601355 Rev A user manual — Return Values
Page 221 · click to enlarge
Page 221

105 /* add the expression to the criteria */ 106 VS_Criteria_SetFields ( criteriah, 107 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 108 VSID_ENDFIELD ); 109 110 } 111 /* add the criteria to the criteria group */ 112 VS_CriteriaGroup_SetFields ( grouph, 113 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 114 VSID_ENDFIELD ); 115 } 116 117 /* if it failed, destroy the criteria

group handle */ 118 if ( rc == VSE_FALSE ) 119 { 120 /* criteria group will destroy any */ 121 /* criteria and their expressions */ 122 /* for us */ 123 VS_CriteriaGroup_Destroy ( grouph ); 124 125 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 126 } 127 128 return ( grouph ); 129}

Page 222 of the ADIC 601355 Rev A user manual — Note
Page 222 · click to enlarge
Page 222

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 223 of the ADIC 601355 Rev A user manual — Synopsis VST_DRIVE_HANDLE VS_Drive_Create ( void )
Page 223 · click to enlarge
Page 223

VS_Drive_ Create

The VS_Drive_Create function allocates a VolServ API drive handle. A drive handle is used to pass drive information to and from VolServ.

Synopsis VST_DRIVE_HANDLE VS_Drive_Create ( void )

Return Values VS_Drive_Create returns:

  • A drive handle, if one can be allocated.
  • NULL, if a drive handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_drive_handle 4 * 5 * PURPOSE: 6 * This function tests a drive handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_drive_handle(void) 14 #else 15 VST_BOOLEAN vst_drive_handle() 16 #endif 17 {

Arguments None · Example 1 /****************************************

Page 224 of the ADIC 601355 Rev A user manual — VS_Drive_ Create
Page 224 · click to enlarge
Page 224

18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVE_HANDLE h; 20 VST_DRIVE_ID DriveID; 21 VST_DRIVE_TYPE DriveType; 22 VST_ARCHIVE_NAME ArchiveName; 23 VST_COMP_STATE ComponentState; 24 VST_ASSIGNMENT Assignment; 25 VST_MOUNT_STATE MountState; 26 VST_USAGE_COUNT UsageCount; 27 VST_USAGE CurrentTime; 28 VST_USAGE TotalTime; 29 VST_COUNT ErrorCount; 30 VST_MEDIA_ID MountedMediaID; 31 32 /* create the handle */ 33 h = VS_Drive_Create(); 34 if (h != (VST_DRIVE_HANDLE) NULL) 35 { 36 /* get values from user */ 37 printf(“Enter Drive ID ==> “); 38 DriveID = atoi(gets(input)); 39 printf(“Enter Drive Type ==> “); 40 DriveType = atoi(gets(input)); 41 printf(“Enter Associated Archive ==> “); 42 gets(ArchiveName); 43 printf(“Enter Component State ==> “); 44 ComponentState = atoi(gets(input)); 45 printf(“Enter Assignment ==> “); 46 Assignment = atoi(gets(input)); 47 printf(“Enter Mount State ==> “); 48 MountState = atoi(gets(input)); 49 printf(“Enter Usage Count ==> “); 50 UsageCount = atoi(gets(input)); 51 printf(“Enter Current Usage Time ==> “); 52 CurrentTime = atoi(gets(input)); 53 printf(“Enter Total Usage Time ==> “); 54 TotalTime = atoi(gets(input));

Page 225 of the ADIC 601355 Rev A user manual — Notes
Page 225 · click to enlarge
Page 225

55 printf(“Enter Error Count ==> “); 56 ErrorCount = atoi(gets(input)); 57 printf(“Enter Mounted Media ID ==> “); 58 gets(MountedMediaID); 59 /* set the fields */ 60 rc = VS_Drive_SetFields(h, 61 VSID_DRIVE_ID, DriveID, 62 VSID_DRIVE_TYPE, DriveType, 63 VSID_ARCHIVE_NAME, ArchiveName, 64 VSID_COMP_STATE, ComponentState, 65 VSID_ASSIGNMENT, Assignment, 66 VSID_MOUNT_STATE, MountState, 67 VSID_USAGE_COUNT, UsageCount, 68 VSID_USAGE_TIME, CurrentTime, 69 VSID_TOTAL_USAGE_TIME, TotalTime, 70 VSID_ERROR_COUNT, ErrorCount, 71 VSID_MEDIA_ID, MountedMediaID, 72 VSID_ENDFIELD); 73 if (rc) 74 { 75 vst_print_drive(h); 76 } 77 VS_Drive_Destroy(h); 78 } 79 return(rc); 80 }

Page 226 of the ADIC 601355 Rev A user manual — See Also
Page 226 · click to enlarge
Page 226

See Also • vsapi(l),

  • VS_Drive_Destroy(l),
  • VS_Drive_GetFields(l),
  • VS_Drive_SetFields(l),
  • VS_Error_GetFields(l)
Page 227 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Drive_Destroy ( VST_DRIVE_HANDLE handle )
Page 227 · click to enlarge
Page 227

VS_Drive_ Destroy

The VS_Drive_Destroy deallocates a drive handle that was allocated with VS_Drive_Create. A drive handle is used to pass drive information to and from VolServ.

Synopsis VST_BOOLEAN VS_Drive_Destroy ( VST_DRIVE_HANDLE handle )

Arguments • handle = Drive handle to be destroyed.

Return Values VS_Drive_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADHANDLE - Specified handle was not a drive handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_drive_handle 4 * 5 * PURPOSE: 6 * This function tests a drive handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C

Example 1 /****************************************

Page 228 of the ADIC 601355 Rev A user manual — VS_Drive_ Destroy
Page 228 · click to enlarge
Page 228

13 VST_BOOLEAN vst_drive_handle(void) 14 #else 15 VST_BOOLEAN vst_drive_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVE_HANDLE h; 20 VST_DRIVE_ID DriveID; 21 VST_DRIVE_TYPE DriveType; 22 VST_ARCHIVE_NAME ArchiveName; 23 VST_COMP_STATE ComponentState; 24 VST_ASSIGNMENT Assignment; 25 VST_MOUNT_STATE MountState; 26 VST_USAGE_COUNT UsageCount; 27 VST_USAGE CurrentTime; 28 VST_USAGE TotalTime; 29 VST_COUNT ErrorCount; 30 VST_MEDIA_ID MountedMediaID; 31 32 /* create the handle */ 33 h = VS_Drive_Create(); 34 if (h != (VST_DRIVE_HANDLE) NULL) 35 { 36 /* get values from user */ 37 printf(“Enter Drive ID ==> “); 38 DriveID = atoi(gets(input)); 39 printf(“Enter Drive Type ==> “); 40 DriveType = atoi(gets(input)); 41 printf(“Enter Associated Archive ==> “); 42 gets(ArchiveName); 43 printf(“Enter Component State ==> “); 44 ComponentState = atoi(gets(input)); 45 printf(“Enter Assignment ==> “); 46 Assignment = atoi(gets(input)); 47 printf(“Enter Mount State ==> “); 48 MountState = atoi(gets(input)); 49 printf(“Enter Usage Count ==> “); 50 UsageCount = atoi(gets(input));

Page 229 of the ADIC 601355 Rev A user manual — VS_Drive_ Destroy
Page 229 · click to enlarge
Page 229

51 printf(“Enter Current Usage Time ==> “); 52 CurrentTime = atoi(gets(input)); 53 printf(“Enter Total Usage Time ==> “); 54 TotalTime = atoi(gets(input)); 55 printf(“Enter Error Count ==> “); 56 ErrorCount = atoi(gets(input)); 57 printf(“Enter Mounted Media ID ==> “); 58 gets(MountedMediaID); 59 /* set the fields */ 60 rc = VS_Drive_SetFields(h, 61 VSID_DRIVE_ID, DriveID, 62 VSID_DRIVE_TYPE, DriveType, 63 VSID_ARCHIVE_NAME, ArchiveName, 64 VSID_COMP_STATE, ComponentState, 65 VSID_ASSIGNMENT, Assignment, 66 VSID_MOUNT_STATE, MountState, 67 VSID_USAGE_COUNT, UsageCount, 68 VSID_USAGE_TIME, CurrentTime, 69 VSID_TOTAL_USAGE_TIME, TotalTime, 70 VSID_ERROR_COUNT, ErrorCount, 71 VSID_MEDIA_ID, MountedMediaID, 72 VSID_ENDFIELD); 73 if (rc) 74 { 75 vst_print_drive(h); 76 } 77 VS_Drive_Destroy(h); 78 }

Page 230 of the ADIC 601355 Rev A user manual — Notes
Page 230 · click to enlarge
Page 230

79 return(rc); 80 }

See Also • vsapi(l),

  • VS_Drive_Create(l),
  • VS_Drive_GetFields(l),
  • VS_Drive_SetFields(l),
  • VS_Error_GetFields(l)
Page 231 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 231 · click to enlarge
Page 231

VS_Drive_Get Fields

VS_Drive_GetFields retrieves information associated with a drive handle. A drive handle is used to pass drive information to and from VolServ.

Synopsis VST_BOOLEAN VS_Drive_GetFields ( VST_DRIVE_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Drive handle for which information is being requested.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of the archive with which this drive is associated. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ASSIGNMENT (VST_ASSIGNMENT *) Pointer to the current assignment of this drive. Valid VSID_ASSIGNMENT values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 232 of the ADIC 601355 Rev A user manual — VSID_TOTAL_USAGE_TIME (VST_USAGE *)
Page 232 · click to enlarge
Page 232

VSID_COMP_STATE (VST_COMP_STATE *) Pointer to the operational state of this drive. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_DRIVE_ID (VST_DRIVE_ID *) Pointer to the identifier of this drive.

VSID_DRIVE_TYPE (VST_DRIVE_TYPE *) Pointer to the type of this drive. Valid VSID_DRIVE_TYPE values are enumerated in the vs_types.h file.

VSID_ERROR_COUNT (VST_COUNT *) Pointer to the error count of the drive.

VSID_MEDIA_ID (VST_MEDIA_ID) If the VSID_MOUNT_STATE of this drive is VSE_MOUNT_MOUNTED, identifier of the medium mounted on this drive.

VSID_MEDIA_TYPE_ENTRY (int) Index of a specific media type handle in the media type handle table.

(VST_MEDIATYPE_HANDLE *) Pointer to the location where the media type handle should be stored.

VSID_MEDIA_TYPE_TABLE (VST_TABLE_HANDLE *)

Pointer to the media types (in table format) supported by this drive.

VSID_MOUNT_STATE (VST_MOUNT_STATE *)

Pointer to the mount state of this drive. Valid VSID_MOUNT_STATE values are enumerated in the vs_types.h file.

VSID_NUMBER_MEDIA TYPES (int *) Pointer to the number of media types present in the media type name table.

VSID_USAGE_COUNT (VST_USAGE_COUNT *)

Pointer to the number of times this drive has been mounted.

VSID_USAGE_TIME (VST_USAGE *) Pointer to the current usage time of the drive.

VSID_TOTAL_USAGE_TIME (VST_USAGE *)

Pointer to the total usage time of the drive.

Return Values VS_Drive_GetFields returns:

Parameter Type Description

Page 233 of the ADIC 601355 Rev A user manual — Example
Page 233 · click to enlarge
Page 233
  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a drive handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_OUTOFRANGE - An index value was out of range.

********* 2 * 3 * FUNCTION: vst_print_drive 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a drive handle. 8 * 9 * PARAMETERS: 10 * h : the drive handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_drive(VST_DRIVE_HANDLE h) 15 #else 16 void vst_print_drive(h) 17 VST_DRIVE_HANDLE h; 18 #endif 19 {

Example 1 /****************************************

Page 234 of the ADIC 601355 Rev A user manual — Example
Page 234 · click to enlarge
Page 234

20 VST_DRIVE_ID DriveID; 21 VST_DRIVE_TYPE DriveType; 22 VST_ARCHIVE_NAME ArchiveName; 23 VST_COMP_STATE ComponentState; 24 VST_ASSIGNMENT Assignment; 25 VST_MOUNT_STATE MountState; 26 VST_USAGE_COUNT UsageCount; 27 VST_USAGE CurrentTime; 28 VST_USAGE TotalTime; 29 VST_COUNT ErrorCount; 30 VST_MEDIA_ID MountedMediaID; 31 char * MediaType; 32 VST_TABLE_HANDLE MediaTypeTable; 33 int i; 34 int n; 35 36 VS_Drive_GetFields(h, 37 VSID_DRIVE_ID, &DriveID, 38 VSID_DRIVE_TYPE, &DriveType, 39 VSID_ARCHIVE_NAME, ArchiveName, 40 VSID_COMP_STATE, &ComponentState, 41 VSID_ASSIGNMENT, &Assignment, 42 VSID_MOUNT_STATE, &MountState, 43 VSID_USAGE_COUNT, &UsageCount, 44 VSID_USAGE_TIME, &CurrentTime, 45 VSID_TOTAL_USAGE_TIME, &TotalTime, 46 VSID_ERROR_COUNT, &ErrorCount, 47 VSID_MEDIA_ID, MountedMediaID, 48 VSID_MEDIA_TYPE_TABLE, &MediaTypeTable, 49 VSID_ENDFIELD);

Page 235 of the ADIC 601355 Rev A user manual — Example
Page 235 · click to enlarge
Page 235

Handle******\n”); 51 printf(“Drive ID = %dDriveType =

%d\n”,DriveID,DriveType); 52 printf(“ArchiveName =

%s\n”,ArchiveName); 53 printf(“Comp State = %dAssignment =

%d\n”,ComponentState,Assignment); 54 printf(“Mount State = %dUsageCount =

%d\n”,MountState,UsageCount); 55 printf(“Current Usage = %dTotal

Usage = %d\n”, CurrentTime, TotalTime); 56 printf(“Error Count = %d\n”,

ErrorCount ); 57 printf(“MediaID =

%s\n”,MountedMediaID); 58 59 /* DrivePoolQuery Doesn’t use this

Field */ 60 if (MediaTypeTable !=

(VST_TABLE_HANDLE)NULL) 61 { 62 VS_Table_GetFields(MediaTypeTable , 63 VSID_NUMBER_ENTRIES, &n, 64 VSID_ENDFIELD); 65 for ( i = 0; i < n; i++) 66 { 67 VS_Table_GetFields(MediaTypeTable , 68 VSID_TABLE_ENTRY, i, &MediaType, 69 VSID_ENDFIELD); 70 printf(“MediaType Entry #%d = %s\n”,i,MediaType); 71 } 72 } 73 }

50 printf(“******Drive

Page 236 of the ADIC 601355 Rev A user manual — Note
Page 236 · click to enlarge
Page 236

The VSID_MEDIA_TYPE_ENTRY parameter requires that two arguments be passed instead of one. The first argument passed is the entry number in the drive table. The second argument is a pointer to the location where the value is stored.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Drive_Create(l),
  • VS_Drive_Destroy(l),
  • VS_Drive_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_MediaType_GetFields(l),
  • VS_MediaType_SetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_DriveQuery(l),
  • VSCMD_DrivePoolQuery(l)
Page 237 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 237 · click to enlarge
Page 237

VS_Drive_Set Fields

VS_Drive_SetFields sets the value of one or more fields in a drive handle. A drive handle is used to pass information to and from VolServ.

Synopsis VST_BOOLEAN VS_Drive_SetFields ( VST_DRIVE_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Drive handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive with which this drive is associated. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ASSIGNMENT (VST_ASSIGNMENT) Current assignment of this drive. Valid VSID_ASSIGNMENT values are enumerated in the vs_type.h file.

Parameters · Parameter Type Description

Page 238 of the ADIC 601355 Rev A user manual — VSID_USAGE_COUNT (VST_USAGE_COUNT)
Page 238 · click to enlarge
Page 238

VSID_COMP_STATE (VST_COMP_STATE) Operational state of this archive. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_DRIVE_ID (VST_DRIVE_ID) Identifier of this drive.

VSID_DRIVE_TYPE (VST_DRIVE_TYPE) Type of this drive. Valid VSID_DRIVE_TYPE values are enumerated in the vs_types.h file.

VSID_ERROR_COUNT (VST_COUNT) Error count of the drive.

VSID_MEDIA_ID (VST_MEDIA_ID) If the VSID_MOUNT_STATE of this drive is VSE_MOUNT_MOUNTED, the identifier of the medium mounted on this drive.

VSID_MEDIA_TYPE_TABLE (VST_TABLE_HANDLE)

Media types (in table format) supported by this drive.

VSID_MOUNT_STATE (VST_MOUNT_STATE)

Mount state of this drive. Valid VSID_MOUNT_STATE values are enumerated in the vs_types.h file.

VSID_USAGE_COUNT (VST_USAGE_COUNT)

Number of times this drive has been mounted.

VSID_USAGE_TIME (VST_USAGE_TIME) Current usage time of the drive.

VSID_TOTAL_USAGE_TIME (VST_USAGE) Total usage time of the drive.

Return Values VS_Drive_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error
  • VSE_ERR_BADFIELD - An invalid parameter was specified.

Parameter Type Description

Page 239 of the ADIC 601355 Rev A user manual — Example
Page 239 · click to enlarge
Page 239
  • VSE_ERR_BADHANDLE - Specified handle was not a drive handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_drive_handle 4 * 5 * PURPOSE: 6 * This function tests a drive handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_drive_handle(void) 14 #else 15 VST_BOOLEAN vst_drive_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVE_HANDLE h; 20 VST_DRIVE_ID DriveID; 21 VST_DRIVE_TYPE DriveType; 22 VST_ARCHIVE_NAME ArchiveName; 23 VST_COMP_STATE ComponentState; 24 VST_ASSIGNMENT Assignment; 25 VST_MOUNT_STATE MountState; 26 VST_USAGE_COUNT UsageCount;

Example 1 /****************************************

Page 240 of the ADIC 601355 Rev A user manual — Example
Page 240 · click to enlarge
Page 240

27 VST_USAGE CurrentTime; 28 VST_USAGE TotalTime; 29 VST_COUNT ErrorCount; 30 VST_MEDIA_ID MountedMediaID; 31 32 /* create the handle */ 33 h = VS_Drive_Create(); 34 if (h != (VST_DRIVE_HANDLE) NULL) 35 { 36 /* get values from user */ 37 printf(“Enter Drive ID ==> “); 38 DriveID = atoi(gets(input)); 39 printf(“Enter Drive Type ==> “); 40 DriveType = atoi(gets(input)); 41 printf(“Enter Associated Archive ==> “); 42 gets(ArchiveName); 43 printf(“Enter Component State ==> “); 44 ComponentState = atoi(gets(input)); 45 printf(“Enter Assignment ==> “); 46 Assignment = atoi(gets(input)); 47 printf(“Enter Mount State ==> “); 48 MountState = atoi(gets(input)); 49 printf(“Enter Usage Count ==> “); 50 UsageCount = atoi(gets(input)); 51 printf(“Enter Current Usage Time ==> “); 52 CurrentTime = atoi(gets(input)); 53 printf(“Enter Total Usage Time ==> “); 54 TotalTime = atoi(gets(input)); 55 printf(“Enter Error Count ==> “); 56 ErrorCount = atoi(gets(input)); 57 printf(“Enter Mounted Media ID ==> “); 58 gets(MountedMediaID); 59 /* set the fields */ 60 rc = VS_Drive_SetFields(h, 61 VSID_DRIVE_ID, DriveID,

Page 241 of the ADIC 601355 Rev A user manual — Note
Page 241 · click to enlarge
Page 241

62 VSID_DRIVE_TYPE, DriveType, 63 VSID_ARCHIVE_NAME, ArchiveName, 64 VSID_COMP_STATE, ComponentState, 65 VSID_ASSIGNMENT, Assignment, 66 VSID_MOUNT_STATE, MountState, 67 VSID_USAGE_COUNT, UsageCount, 68 VSID_USAGE_TIME, CurrentTime, 69 VSID_TOTAL_USAGE_TIME, TotalTime, 70 VSID_ERROR_COUNT, ErrorCount, 71 VSID_MEDIA_ID, MountedMediaID, 72 VSID_ENDFIELD); 73 if (rc) 74 { 75 vst_print_drive(h); 76 } 77 VS_Drive_Destroy(h); 78 } 79 return(rc); 80 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 242 of the ADIC 601355 Rev A user manual — See Also
Page 242 · click to enlarge
Page 242

See Also • vsapi(l),

  • VS_Drive_Create(l),
  • VS_Drive_Destroy(l),
  • VS_Drive_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_MediaType_GetFields(l),
  • VS_MediaType_SetFields(l),
  • VS_Table_GetFields(l)
Page 243 of the ADIC 601355 Rev A user manual — Synopsis VST_DRIVEPOOL_HANDLE VS_DrivePool_Create ( void )
Page 243 · click to enlarge
Page 243

VS_DrivePool _Create

VS_DrivePool_Create allocates a VolServ API drive pool handle. A drive pool handle is used to pass drive pool information to and from VolServ.

Synopsis VST_DRIVEPOOL_HANDLE VS_DrivePool_Create ( void )

Return Values VS_DrivePool_Create returns:

  • A drive pool handle, if one can be allocated.
  • NULL, if a drive pool handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_drivepool_handle 4 * 5 * PURPOSE: 6 * This function tests a drive pool handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Arguments None · Example 1 /**************************************** · vst_drivepool_handle(void) 14 #else

Page 244 of the ADIC 601355 Rev A user manual — 15 VST_BOOLEAN
Page 244 · click to enlarge
Page 244

15 VST_BOOLEAN

vst_drivepool_handle(void) 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVEPOOL_HANDLE h; 20 VST_DRIVE_POOL_NAME

DrivePoolName; 21 22 /* create the handle */ 23 h = VS_DrivePool_Create(); 24 if (h != (VST_DRIVEPOOL_HANDLE) NULL) 25 { 26 /* get values from user */ 27 printf(“*** Drive Pool Handle ***\n”); 28 printf(“Enter Drive Pool Name ==> “); 29 gets(DrivePoolName); 30 rc = VS_DrivePool_SetFields(h, 31 VSID_DRIVEPOOL_NAME, DrivePoolName, 32 VSID_ENDFIELD); 33 if (rc) 34 { 35 vst_print_drivepool(h); 36 } 37 VS_DrivePool_Destroy(h); 38 } 39 return(rc); 40 }

Page 245 of the ADIC 601355 Rev A user manual — See Also
Page 245 · click to enlarge
Page 245

See Also • vsapi(l),

  • VS_DrivePool_Destroy(l),
  • VS_DrivePool_GetFields(l),
  • VS_DrivePool_SetFields(l),
  • VS_Error_GetFields(l)
Page 246 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_DrivePool_Destroy ( VST_DRIVEPOOL_HANDLE handle )
Page 246 · click to enlarge
Page 246

VS_DrivePool _Destroy

VS_DrivePool_Destroy deallocates a drive pool handle that was allocated with VS_DrivePool_Create. A drive pool handle is used to pass drive pool information to and from VolServ.

Synopsis VST_BOOLEAN VS_DrivePool_Destroy ( VST_DRIVEPOOL_HANDLE handle )

Arguments • handle = Drive pool handle to be destroyed.

Return Values VS_DrivePool_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a drive pool handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_drivepool_handle 4 * 5 * PURPOSE: 6 * This function tests a drive pool handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 247 of the ADIC 601355 Rev A user manual — VS_DrivePool _Destroy
Page 247 · click to enlarge
Page 247

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_drivepool_handle(void) 14 #else 15 VST_BOOLEAN

vst_drivepool_handle(void) 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVEPOOL_HANDLE h; 20 VST_DRIVE_POOL_NAME

DrivePoolName; 21 22 /* create the handle */ 23 h = VS_DrivePool_Create(); 24 if (h != (VST_DRIVEPOOL_HANDLE) NULL) 25 { 26 /* get values from user */ 27 printf(“*** Drive Pool Handle ***\n”); 28 printf(“Enter Drive Pool Name ==> “); 29 gets(DrivePoolName); 30 rc = VS_DrivePool_SetFields(h, 31 VSID_DRIVEPOOL_NAME, DrivePoolName, 32 VSID_ENDFIELD); 33 if (rc) 34 { 35 vst_print_drivepool(h); 36 } 37 VS_DrivePool_Destroy(h); 38 } 39 return(rc); 40 }

Page 248 of the ADIC 601355 Rev A user manual — Notes
Page 248 · click to enlarge
Page 248

See Also • vsapi(l),

  • VS_DrivePool_Create(l),
  • VS_DrivePool_GetFields(l),
  • VS_DrivePool_SetFields(l),
  • VS_Error_GetFields(l)
Page 249 of the ADIC 601355 Rev A user manual — VSID_DRIVE_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 249 · click to enlarge
Page 249

VS_DrivePool _GetFields

VS_DrivePool_GetFields retrieves information associated with a drive pool handle. A drive pool handle is used to pass drive pool information to and from VolServ.

Synopsis VST_BOOLEAN VS_DrivePool_GetFields ( VST_DRIVEPOOL_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Drive pool handle for which information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_DRIVE_HANDLE_ENTRY (int) Index of the drive handle to retrieve.

(VST_DRIVE_HANDLE *) Pointer to the location to store the drive handle.

VSID_DRIVE_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the drives (in table format) that belong to this drive pool group.

VSID_DRIVE_ID (VST_DRIVE_ID *) Pointer to the first drive id in the drive handle table.

Parameters · Parameter Type Description

Page 250 of the ADIC 601355 Rev A user manual — VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)
Page 250 · click to enlarge
Page 250

VSID_DRIVE_ID_Entry (int, VST_DRIVE_ID *)

Index of the drive in the drive handle table. Pointer to the location to store the drive identifier.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Pointer to the name associated with the drive pool group. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_NUMBER_DRIVE_HANDLES (int *) Pointer to the number of drive handles in the drive handle table.

Return Values VS_DrivePool_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a drive pool handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_OUTOFRANGE - An index value was out of range.

Parameter Type Description

Page 251 of the ADIC 601355 Rev A user manual — (VST_TABLE_HANDLE) NULL )
Page 251 · click to enlarge
Page 251

********* 2 * 3 * FUNCTION: vst_print_drivepool 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * in a drive pool handle. 8 * 9 * PARAMETERS: 10 * h : the drive pool handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_drivepool(VST_DRIVEPOOL _HANDLE h) 15 #else 16 void vst_print_drivepool(h) 17 VST_DRIVEPOOL_HANDLE h; 18 #endif 19 { 20 VST_DRIVE_POOL_NAME DrivePoolName; 21 VST_TABLE_HANDLE

DriveHandleTable; 22 VST_DRIVE_HANDLE DriveHandle; 23 int i; 24 int n; 25 26 VS_DrivePool_GetFields(h, 27 VSID_DRIVEPOOL_NAME, DrivePoolName, 28 VSID_DRIVE_HANDLE_TABLE &DriveHandleTable, 29 VSID_ENDFIELD); 30 printf(“DrivePoolName =

%s\n”,DrivePoolName); 31 /* Get # of entries */ 32 if ( DriveHandleTable !=

(VST_TABLE_HANDLE) NULL )

Example 1 /****************************************

Page 252 of the ADIC 601355 Rev A user manual — Note
Page 252 · click to enlarge
Page 252

33 { 34 VS_Table_GetFields(DriveHandleTab le, 35 VSID_NUMBER_ENTRIES, &n, 36 VSID_ENDFIELD); 37 for ( i = 0; i < n; i++) 38 { 39 VS_Table_GetFields(DriveHandleTab le, 40 VSID_TABLE_ENTRY, i, &DriveHandle, 41 VSID_ENDFIELD); 42 vst_print_drive(DriveHandle); 43 } 44 } 45 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_DrivePool_Create(l),
  • VS_DrivePool_Destroy(l),
  • VS_DrivePool_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Table_GetFields(l)
Page 253 of the ADIC 601355 Rev A user manual — Notes
Page 253 · click to enlarge
Page 253
  • VSCMD_DrivePoolQuery(l)
Page 254 of the ADIC 601355 Rev A user manual — VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)
Page 254 · click to enlarge
Page 254

VS_DrivePool _SetFields

VS_DrivePool_SetFields sets the value of one or more fields in a drive pool handle. A drive pool handle is used to pass drive pool information to and from VolServ.

Synopsis VST_BOOLEAN VS_DrivePool_SetFields ( VST_DRIVEPOOL_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = Drive pool handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_DRIVE_HANDLE_TABLE (VST_TABLE_HANDLE)

Drive handles (in table format) that belong to this drive pool group.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Name associated with the drive pool group. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Return Values VS_DrivePool_SetFields returns:

Parameters · Parameter Type Description

Page 255 of the ADIC 601355 Rev A user manual — Example
Page 255 · click to enlarge
Page 255
  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a drive pool handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_drivepool_handle 4 * 5 * PURPOSE: 6 * This function tests a drive pool handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_drivepool_handle(void) 14 #else 15 VST_BOOLEAN

Example 1 /**************************************** · vst_drivepool_handle(void)

Page 256 of the ADIC 601355 Rev A user manual — Note
Page 256 · click to enlarge
Page 256

16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVEPOOL_HANDLE h; 20 VST_DRIVE_POOL_NAME

DrivePoolName; 21 22 /* create the handle */ 23 h = VS_DrivePool_Create(); 24 if (h != (VST_DRIVEPOOL_HANDLE) NULL) 25 { 26 /* get values from user */ 27 printf(“*** Drive Pool Handle ***\n”); 28 printf(“Enter Drive Pool Name ==> “); 29 gets(DrivePoolName); 30 rc = VS_DrivePool_SetFields(h, 31 VSID_DRIVEPOOL_NAME, DrivePoolName, 32 VSID_ENDFIELD); 33 if (rc) 34 { 35 vst_print_drivepool(h); 36 } 37 VS_DrivePool_Destroy(h); 38 } 39 return(rc); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 257 of the ADIC 601355 Rev A user manual — See Also
Page 257 · click to enlarge
Page 257

See Also • vsapi(l),

  • VS_DrivePool_Create(l),
  • VS_DrivePool_Destroy(l),
  • VS_DrivePool_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Table_Getfields(l)
Page 258 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Error_GetFields ( VST_ERROR_HANDLE handle, "…", VSID_ENDFIELD )
Page 258 · click to enlarge
Page 258

VS_Error_Get Fields

VS_Error_GetFields retrieves information associated with an error handle. An error handle is used to pass error information to and from VolServ.

An error handle is associated with each command handle and with each notify handle. There is also a global error handle for errors that cannot be associated with a command.

After a VolServ request or an attempt to receive callbacks fails, information is stored in an error handle. VS_Error_GetFields allows the user to retrieve this information.

Synopsis VST_BOOLEAN VS_Error_GetFields ( VST_ERROR_HANDLE handle, "…", VSID_ENDFIELD )

Arguments • handle = The error handle where information is retrieved.

  • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 259 of the ADIC 601355 Rev A user manual — VSID_ERROR_OBJECT (VST_ERROR_OBJCODE *)
Page 259 · click to enlarge
Page 259

VSID_ERROR_CODE (VST_ERROR_CODE) Pointer to the error code for the given error.

VSID_ERROR_FILE (VST_ERROR_FILE) Name of the source file where the error occurred (API internal errors only).

VSID_ERROR_LINE (int *) Pointer to the source line number where the error occurred (API internal errors only).

VSID_ERROR_NUMBER (VST_ERROR_NUMCODE *)

Pointer to the field that indicates which error occurred.

VSID_ERROR_OBJECT (VST_ERROR_OBJCODE *)

Pointer to the field that indicates the location of the error.

Return Values VS_Error_GetFields returns

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an error handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_error 4 * 5 * PURPOSE:

Parameters · Parameter Type Description · Example 1 /****************************************

Page 260 of the ADIC 601355 Rev A user manual — Parameters
Page 260 · click to enlarge
Page 260

6 * This function prints out the information stored in 7 * an error handle. 8 * 9 * PARAMETERS: 10 * h : the error handle to print 11 * 12 **************************************** **********/ 13 #ifdef ANSI_C 14 void

vst_print_error(VST_ERROR_HANDLE h) 15 #else 16 void vst_print_error(h) 17 VST_ERROR_HANDLE h; 18 #endif 19 { 20 VST_ERROR_CODE err; 21 int line; 22 VST_ERROR_FILE file; 23 24 VS_Error_GetFields(h, 25 VSID_ERROR_CODE, err, 26 VSID_ERROR_LINE, &line, 27 VSID_ERROR_FILE, file, 28 VSID_ENDFIELD); 29 30 printf(“******Error

Handle******\n”); 31 printf(“Error Code = %s\n”,err); 32 printf(“Error File = %s\n”,file); 33 printf(“Error Line = %d\n”,line); 34 }

Page 261 of the ADIC 601355 Rev A user manual — Note
Page 261 · click to enlarge
Page 261

The VSID_ERROR_FILE and VSID_ERROR_LINE parameters are valid only for API internal errors (e.g., VSE_ERR_OUTOFMEM).

The VSID_ERROR_CODE parameter is a human-readable code that tells where the error occurred and gives the error number. It is in the form AAAnnn, where AAA is an abbreviation that corresponds with the VST_ERROR_OBJCODE type. If this abbreviation is VOL, the error number is a VolServ error code. Otherwise, it is in the VST_ERROR_NUMCODE type.

If the string parameters are not sufficiently long, unpredictable results occur.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_GetFields(l),
  • VS_Notify_GetFields(l)
Page 262 of the ADIC 601355 Rev A user manual — Synopsis VST_EXPRESSION_HANDLE VS_Expression_Create ( void )
Page 262 · click to enlarge
Page 262

VS_ Expression_ Create

VS_Expression_Create allocates a VolServ API expression handle. An expression handle is used to pass expression information to and from VolServ.

An expression handle has three parts: a relation operator (=, >, =,

Synopsis VST_EXPRESSION_HANDLE VS_Expression_Create ( void )

Arguments • handle = The expression handle to be created.

Return Values VS_Expression_Create returns:

  • An expression handle, if one can be allocated.
  • NULL, if the expression handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle and sets the values in it according to 8 * user input.

Example 1 /****************************************

Page 263 of the ADIC 601355 Rev A user manual — VS_ Expression_ Create
Page 263 · click to enlarge
Page 263
9 * 10 * PARAMETERS11 * none 12 * 13 **************************************** *********/ 14 #ifdef ANSI_C 15 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 16 #else 17 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 18 #endif 19 { 20 int i; 21 int j; 22 int numcrit; 23 int numexpr; 24 VST_BOOLEAN rc = VSE_TRUE; 25 VST_EXPRESSION_HANDLE exprh; 26 VST_CRITERIA_HANDLE

criteriah; 27 VST_CRITERIAGROUP_HANDLE grouph; 28 VST_COUNT field; 29 VST_MOUNT_CRITERIA_ORDER sort; 30 VST_MEDIA_STAT_VALUE value; 31 VST_MOUNT_CRITERIA_OPT relopt; 32 VST_CONNECTIVE_OP conop; 33 34 /* create the criteria group */ 35 grouph = VS_CriteriaGroup_Create(); 36 37 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 38 { 39 /* out of memory -- return */ 40 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 41 } 42

Page 264 of the ADIC 601355 Rev A user manual — VS_ Expression_ Create
Page 264 · click to enlarge
Page 264

43 /* populate the criteria group with

criteria */ 44 /* (upto 5) */ 45 printf ( “Enter number of Criteria in

group ==> “ ); 46 numcrit = atoi(gets(input)); 47 48 for ( i = 0 ; i < numcrit ; i++ ) 49 { 50 /* create the criteria for a media stat field */ 51 criteriah = VS_Criteria_Create(); 52 53 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 54 { 55 /* could not allocate handle */ 56 rc = VSE_FALSE; 57 break; 58 } 59 60 printf ( “Enter the media’s field number ==> “ ); 61 field = atoi(gets(input)); 62 63 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 64 sort = atoi(gets(input)); 65 66 /* set the criteria parameters */ 67 /VS_Criteria_SetFields ( criteriah, 68 VSID_FIELD, field, 69 VSID_MOUNT_CRITERIA_ORDER, sort, 70 VSID_ENDFIELD ); 71 72 /* populate the critera with expressions */ 73 /* (upto 4) */

Page 265 of the ADIC 601355 Rev A user manual — VS_ Expression_ Create
Page 265 · click to enlarge
Page 265

74 printf ( “Enter the number of criteria expressions ==> “ ); 75 numexpr = atoi(gets(input)); 76 77 for ( j = 0 ; j < numexpr ; j++ ) 78 { 79 /* create an expression for this criteria */ 80 exprh = VS_Expression_Create(); 81 82 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 83 { 84 /* could not allocate memory for this */ 85 /* handle */ 86 rc = VSE_FALSE; 87 break; 88 } 89 90 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 91 relopt = atoi(gets(input)); 92 93 printf ( “Enter the media field value ==> “ ); 94 gets( value); 95 96 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 97 conop = atoi(gets(input)); 98 99 /* set the expression’s parameters */ 100 VS_Expression_SetFields ( exprh, 101 VSID_MOUNT_CRITERIA_OPT, relopt,

Page 266 of the ADIC 601355 Rev A user manual — VS_ Expression_ Create
Page 266 · click to enlarge
Page 266

102 VSID_CONNECTIVE_OP, conop, 103 VSID_MEDIA_STAT_VALUE, value, 104 VSID_ENDFIELD ); 105 106 /* add the expression to the criteria */ 107 VS_Criteria_SetFields ( criteriah, 108 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 109 VSID_ENDFIELD ); 110 111 } 112 /* add the criteria to the criteria group */ 113 VS_CriteriaGroup_SetFields ( grouph, 114 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 115 VSID_ENDFIELD ); 116 } 117 118 /* if it failed, destroy the criteria

group handle */ 119 if ( rc == VSE_FALSE ) 120 { 121 /* criteria group will destroy any */ 122 /* criteria and their expressions */ 123 /* for us */ 124 VS_CriteriaGroup_Destroy ( grouph ); 125 126 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 127 } 128 129 return ( grouph );

Page 267 of the ADIC 601355 Rev A user manual — Notes
Page 267 · click to enlarge
Page 267

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)

130}

Page 268 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_EXPRESSION_DESTROY (VST_EXPRESSION_HANDLE handle)
Page 268 · click to enlarge
Page 268

VS_ Expression_ Destroy

VS_Expression_Destroy deallocates an expression handle that was allocated with VS_Expression_Create. An expression handle is used to pass expression information to and from VolServ.

Synopsis VST_BOOLEAN VS_EXPRESSION_DESTROY (VST_EXPRESSION_HANDLE handle)

Arguments • handle = The expression handle to be destroyed.

Return Values VS_Expression_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADHANDLE - Specified handle was not an expression handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group handle 7 * and sets the values in it according to user input. 8 * 9 * PARAMETERS:

Example 1 /****************************************

Page 269 of the ADIC 601355 Rev A user manual — VS_ Expression_ Destroy
Page 269 · click to enlarge
Page 269

10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 15 #else 16 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 17 #endif 18 { 19 int i; 20 int j; 21 int numcrit; 22 int numexpr; 23 VST_BOOLEAN rc = VSE_TRUE; 24 VST_EXPRESSION_HANDLE exprh; 25 VST_CRITERIA_HANDLE

criteriah; 26 VST_CRITERIAGROUP_HANDLE grouph; 27 VST_COUNT field; 28 VST_MOUNT_CRITERIA_ORDER sort; 29 VST_MEDIA_STAT_VALUE value; 30 VST_MOUNT_CRITERIA_OPT relopt; 31 VST_CONNECTIVE_OP conop; 32 33 /* create the criteria group */ 34 grouph = VS_CriteriaGroup_Create(); 35 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 36 { 37 /* out of memory -- return */ 38 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 39 } 40 /* populate the criteria group with

criteria */ 41 /* (upto 5) */

Page 270 of the ADIC 601355 Rev A user manual — VS_ Expression_ Destroy
Page 270 · click to enlarge
Page 270

42 printf ( “Enter number of Criteria in

group ==> “ ); 43 numcrit = atoi(gets(input)); 44 for ( i = 0 ; i < numcrit ; i++ ) 45 { 46 /* create the criteria for a media stat field */ 47 criteriah = VS_Criteria_Create(); 48 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 49 { 50 /* could not allocate handle */ 51 rc = VSE_FALSE; 52 break; 53 } 54 printf ( “Enter the media’s field number ==> “ ); 55 field = atoi(gets(input)); 56 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==>“ ); 57 sort = atoi(gets(input)); 58 /* set the criteria parameters */ 59 VS_Criteria_SetFields ( criteriah, 60 VSID_FIELD, field, 61 VSID_MOUNT_CRITERIA_ORDER, sort, 62 VSID_ENDFIELD ); 63 /* populate the critera with expressions */ 64 /* (upto 4) */ 65 printf ( “Enter the number of criteria expressions ==> “ ); 66 numexpr = atoi(gets(input)); 67 for ( j = 0 ; j < numexpr ; j++ ) 68 { 69 /* create an expression for this criteria */ 70 exprh = VS_Expression_Create();

Page 271 of the ADIC 601355 Rev A user manual — VS_ Expression_ Destroy
Page 271 · click to enlarge
Page 271

71 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 72 { 73 /* could not allocate memory for this */ 74 /* handle */ 75 rc = VSE_FALSE; 76 break; 77 } 78 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 79 relopt = atoi(gets(input)); 80 printf ( “Enter the media field value ==> “ ); 81 gets( value); 82 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 83 conop = atoi(gets(input)); 84 /* set the expression’s parameters */ 85 VS_Expression_SetFields ( exprh, 86 VSID_MOUNT_CRITERIA_OPT,

relopt, 87 VSID_CONNECTIVE_OP, conop, 88 VSID_MEDIA_STAT_VALUE, value, 89 VSID_ENDFIELD ); 90 /* add the expression to the criteria */ 91 VS_Criteria_SetFields ( criteriah, 92 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 93 VSID_ENDFIELD ); 94 } 95 /* add the criteria to the criteria group */

Page 272 of the ADIC 601355 Rev A user manual — VS_ Expression_ Destroy
Page 272 · click to enlarge
Page 272

96 VS_CriteriaGroup_SetFields ( grouph, 97 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 98 VSID_ENDFIELD ); 99 } 100 /* if it failed, destroy the criteria

group handle */ 101 if ( rc == VSE_FALSE ) 102 { 103 /* criteria group will destroy any */ 104 /* criteria and their expressions */ 105 /* for us, so the only thing that is really */ 106 /* needed here is a call to */ 107 /* VS_CriteriaGroup_Destroy. */ 108 /* This is written out the ’long way’ for */ 109 /* documentation purposes. First, get the */ 110 /* number of criteria */ 111 VS_CriteriaGroup_GetFields(grouph , 112 VSID_NUMBER_ENTRIES, &numcrit, 113 VSID_ENDFIELD); 114 for (i = 0; i < numcrit; i++) 115 { 116 /* get a criteria handle */ 117 VS_CriteriaGroup_GetFields(grouph , 118 VSID_CRITERIA_HANDLE_ENTRY, i, &criteriah, 119 VSID_ENDFIELD); 120 /* get the number of expressions */ 121 VS_Criteria_GetFields(criteriah,

Page 273 of the ADIC 601355 Rev A user manual — VS_ Expression_ Destroy
Page 273 · click to enlarge
Page 273

122 VSID_NUMBER_ENTRIES, &numexpr, 123 VSID_ENDFIELD); 124 for (j = 0; j < numexpr; j++) 125 { 126 /* get the expressions from the criteria */ 127 VS_Criteria_GetFields(criteriah, 128 VSID_EXPRESSION_HANDLE_ENTRY, j, &exprh, 129 VSID_ENDFIELD); 130 /* destroy the expression handle */ 131 VS_Expression_Destroy(exprh); 132 /* let Criteria handle know that the */ 133 /* expression handle has been destroyed */ 134 VS_Criteria_SetFields(criteriah, 135 VSID_EXPRESSION_HANDLE_ENTRY, j, NULL, 136 VSID_ENDFIELD); 137 } 138 /* now, destroy Criteria handle. */ 139 VS_Criteria_Destroy(criteriah); 140 /*let the criteria group handle know */ 141 /* that Criteria handle has been */ 142 /* destroyed. */ 143 VS_CriteriaGroup_SetFields(grouph , 144 VSID_CRITERIA_HANDLE_ENTRY, i, NULL,

Page 274 of the ADIC 601355 Rev A user manual — Notes
Page 274 · click to enlarge
Page 274

145 VSID_ENDFIELD); 146 } 147 /* finally, destroy the criteria group handle. */ 148 VS_CriteriaGroup_Destroy ( grouph ); 149 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 150 } 151 return ( grouph ); 152}

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l)
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_GetFields(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 275 of the ADIC 601355 Rev A user manual — VSID_MOUNT_CRITERIA_OP (VST_MOUNT_CRITERIA_OPT *)
Page 275 · click to enlarge
Page 275

VS_ Expression_ GetFields

VS_Expression_GetFields retrieves information associated with an expression handle. An expression handle is used to pass expression information to and from VolServ.

Synopsis VST_BOOLEAN VS_Expression_GetFields ( VST_EXPRESSION_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = The expression handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_MOUNT_CRITERIA_OP (VST_MOUNT_CRITERIA_OPT *)

Pointer to the relational operation for this expression:

Parameters · Parameter Type Description

Page 276 of the ADIC 601355 Rev A user manual — VSID_MEDIA_STAT_VALUE (VST_MEDIA_STAT_VALUE)
Page 276 · click to enlarge
Page 276

VSID_CONNECTIVE_OP (VST_CONNECTIVE_OP *)

Pointer to the connective operation between two expressions. Valid VS_Expression_GetFields values are enumerated in the vs_types.h file. The last expression in a criteria must have the connect operator set to none.

VSID_MEDIA_STAT_VALUE (VST_MEDIA_STAT_VALUE)

Value for comparison. All values are compared as strings. If numbers are needed, they must be left filled with zeros within the string.

Return Values VS_Expression_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an error handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_criteria_group 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a criteria group handle. 8 *

Parameter Type Description · Example 1 /****************************************

Page 277 of the ADIC 601355 Rev A user manual — Return Values
Page 277 · click to enlarge
Page 277

9 * PARAMETERS: 10 * grouph : the mount handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 void

vst_print_criteria_group(VST_CRIT ERIAGROUP_HANDLE grouph) 15 #else 16 void

vst_print_criteria_group(grouph) 17 VST_CRITERIAGROUP_HANDLE grouph; 18 #endif 19 { 20 int i, j; 21 int numcrit = 0; 22 int numexpr = 0; 23 24 VST_EXPRESSION_HANDLE exprh =

(VST_EXPRESSION_HANDLE) NULL; 25 VST_CRITERIA_HANDLE criteriah =

(VST_CRITERIA_HANDLE) NULL; 26 27 VST_COUNT field; 28 VST_MOUNT_CRITERIA_ORDER sort; 29 VST_MEDIA_STAT_VALUE value; 30 VST_MOUNT_CRITERIA_OPT relopt; 31 VST_CONNECTIVE_OP conop; 32 33 /* get the number of criteria within

this group */ 34 VS_CriteriaGroup_GetFields ( grouph, 35 VSID_NUMBER_ENTRIES, &numcrit, 36 VSID_ENDFIELD ); 37 38 for ( i = 0 ; i < numcrit ; i++ ) 39 { 40 /* get the criteria to print */

Page 278 of the ADIC 601355 Rev A user manual — Return Values
Page 278 · click to enlarge
Page 278

41 VS_CriteriaGroup_GetFields ( grouph, 42 VSID_CRITERIA_HANDLE_ENTRY, i, &criteriah, 43 VSID_ENDFIELD ); 44 45 /* get the criteria parameters */ 46 VS_Criteria_GetFields ( criteriah, 47 VSID_FIELD, &field, 48 VSID_MOUNT_CRITERIA_ORDER, &sort, 49 VSID_NUMBER_ENTRIES, &numexpr, 50 VSID_ENDFIELD ); 51 52 printf ( “*** Criteria # %d ***\n”, i ); 53 printf ( “ Field Index ==> %d\n”, field ); 54 printf ( “ Mount Criteria Order ==> %d\n”, sort ); 55 printf ( “Number of Expressions ==> %d\n”, numexpr ); 56 57 for ( j = 0 ; j < numexpr ; j++ ) 58 { 59 /* get the expression to print */ 60 VS_Criteria_GetFields ( criteriah, 61 VSID_EXPRESSION_HANDLE_ENTRY, j, &exprh, 62 VSID_ENDFIELD ); 63 64 /* get the expression’s parameters */ 65 VS_Expression_GetFields ( exprh,

Page 279 of the ADIC 601355 Rev A user manual — Note
Page 279 · click to enlarge
Page 279

66 VSID_MOUNT_CRITERIA_OPT, &relopt, 67 VSID_CONNECTIVE_OP, &conop, 68 VSID_MEDIA_STAT_VALUE, value, 69 VSID_ENDFIELD ); 70 71 printf ( “*** Expression # %d ***\n”, j ); 72 printf ( “Mount Criteria Option ==> %d\n”, relopt); 73 printf ( “ Media Stat Value ==> %s\n”, value); 74 printf ( “ Connective Operation ==> %d\n”, conop); 75 } 76 } 77 78 return; 79 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Criteria_Create(l),
  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
Page 280 of the ADIC 601355 Rev A user manual — Notes
Page 280 · click to enlarge
Page 280
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Expression_Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_SetFields(l),
  • VSCMD_Mount(l)
Page 281 of the ADIC 601355 Rev A user manual — VSID_CONNECTIVE_OP (VST_CONNECTIVE_OP)
Page 281 · click to enlarge
Page 281

VS_ Expression_ SetFields

VS_Expression_SetFields sets the value of one or more fields in an expression handle. An expression handle is used to pass information to and from VolServ.

Synopsis VST_BOOLEAN VS_Expression_SetFields ( VST_EXPRESSION_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = The expression handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_MOUNT_CRITERIA_OP (VST_MOUNT_CRITERIA_OPT)

Relational operation for this expression:

VSID_CONNECTIVE_OP (VST_CONNECTIVE_OP)

Connective operation between two expressions. Valid VSID_CONNECTIVE_OP values are enumerated in the vs_types.h file. The last expression in a criteria must have the connect operator set to NONE.

Parameters · Parameter Type Description

Page 282 of the ADIC 601355 Rev A user manual — VSID_MEDIA_STAT_VALUE (VST_MEDIA_STAT_VALUE)
Page 282 · click to enlarge
Page 282

VSID_MEDIA_STAT_VALUE (VST_MEDIA_STAT_VALUE)

Value for comparison. All values are compared as strings. If numbers are needed, they are left filled with zeros within the string.

Return Values VS_Expression_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an expression handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_create_mount_criteria 4 * 5 * PURPOSE: 6 * This function creates the mount criteria group 7 * handle andsets the values in it according to

Parameter Type Description · Example 1 /****************************************

Page 283 of the ADIC 601355 Rev A user manual — Return Values
Page 283 · click to enlarge
Page 283

8 * user input. 9 * 10 * PARAMETERS: 11 * none 12 * 13 **************************************** *********/ 14 #ifdef ANSI_C 15 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria(void) 16 #else 17 VST_CRITERIAGROUP_HANDLE

vst_create_mount_criteria() 18 #endif 19 { 20 int i; 21 int j; 22 int numcrit; 23 int numexpr; 24 VST_BOOLEAN rc = VSE_TRUE; 25 VST_EXPRESSION_HANDLE exprh; 26 VST_CRITERIA_HANDLE

criteriah; 27 VST_CRITERIAGROUP_HANDLE grouph; 28 VST_COUNT field; 29 VST_MOUNT_CRITERIA_ORDER sort; 30 VST_MEDIA_STAT_VALUE value; 31 VST_MOUNT_CRITERIA_OPT relopt; 32 VST_CONNECTIVE_OP conop; 33 34 /* create the criteria group */ 35 grouph = VS_CriteriaGroup_Create(); 36 37 if ( grouph ==

(VST_CRITERIAGROUP_HANDLE) NULL ) 38 { 39 /* out of memory -- return */ 40 return ( (VST_CRITERIAGROUP_HANDLE) NULL ); 41 }

Page 284 of the ADIC 601355 Rev A user manual — Return Values
Page 284 · click to enlarge
Page 284

42 43 /* populate the criteria group with

criteria */ 44 /* (upto 5) */ 45 printf ( “Enter number of Criteria in

group ==> “ ); 46 numcrit = atoi(gets(input)); 47 48 for ( i = 0 ; i < numcrit ; i++ ) 49 { 50 /* create the criteria for a media stat field */ 51 criteriah = VS_Criteria_Create(); 52 53 if ( criteriah == (VST_CRITERIA_HANDLE) NULL ) 54 { 55 /* could not allocate handle */ 56 rc = VSE_FALSE; 57 break; 58 } 59 60 printf ( “Enter the media’s field number ==> “ ); 61 field = atoi(gets(input)); 62 63 printf ( “Enter the sort order (Ascending - 1, Descending - 2) ==> “ ); 64 sort = atoi(gets(input)); 65 66 /* set the criteria parameters */ 67 /VS_Criteria_SetFields ( criteriah, 68 VSID_FIELD, field, 69 VSID_MOUNT_CRITERIA_ORDER, sort, 70 VSID_ENDFIELD ); 71 72 /* populate the critera with expressions */

Page 285 of the ADIC 601355 Rev A user manual — Return Values
Page 285 · click to enlarge
Page 285

73 /* (upto 4) */ 74 printf ( “Enter the number of criteria expressions ==> “ ); 75 numexpr = atoi(gets(input)); 76 77 for ( j = 0 ; j < numexpr ; j++ ) 78 { 79 /* create an expression for this */ 80 /* criteria */ 81 exprh = VS_Expression_Create(); 82 83 if ( exprh == (VST_EXPRESSION_HANDLE) NULL ) 84 { 85 /* could not allocate memory for this */ 86 /* handle */ 87 rc = VSE_FALSE; 88 break; 89 } 90 91 printf ( “Enter relational option (eq 1, gt 2, ge 3, lt 4, le 5, ne 6) ==> “ ); 92 relopt = atoi(gets(input)); 93 94 printf ( “Enter the media field value ==> “ ); 95 gets( value); 96 97 printf ( “Enter connective operation (none 0, and 1, or 2) ==> “ ); 98 conop = atoi(gets(input)); 99 100 /* set the expression’s parameters */ 101 VS_Expression_SetFields ( exprh,

Page 286 of the ADIC 601355 Rev A user manual — Return Values
Page 286 · click to enlarge
Page 286

102 VSID_MOUNT_CRITERIA_OPT, relopt, 103 VSID_CONNECTIVE_OP, conop, 104 VSID_MEDIA_STAT_VALUE, value, 105 VSID_ENDFIELD ); 106 107 /* add the expression to the criteria */ 108 VS_Criteria_SetFields ( criteriah, 109 VSID_EXPRESSION_HANDLE_ENTRY, j, exprh, 110 VSID_ENDFIELD ); 111 112 } 113 /* add the criteria to the criteria group */ 114 VS_CriteriaGroup_SetFields ( grouph, 115 VSID_CRITERIA_HANDLE_ENTRY, i, criteriah, 116 VSID_ENDFIELD ); 117 } 118 119 /* if it failed, destroy the criteria

group handle */ 120 if ( rc == VSE_FALSE ) 121 { 122 /* criteria group will destroy any */ 123 /* criteria and their expressions */ 124 /* for us */ 125 VS_CriteriaGroup_Destroy ( grouph ); 126 127 grouph = (VST_CRITERIAGROUP_HANDLE) NULL; 128 }

Page 287 of the ADIC 601355 Rev A user manual — Note
Page 287 · click to enlarge
Page 287

129 130 return ( grouph ); 131}

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l), VS_Criteria_Create(l),

  • VS_Criteria_Destroy(l),
  • VS_Criteria_GetFields(l),
  • VS_Criteria_SetFields(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Expression__Create(l),
  • VS_Expression_Destroy(l),
  • VS_Expression_GetFields(l),
  • VSCMD_Mount(l).
Page 288 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Global_GetFields ( "…", VSID_ENDFIELD )
Page 288 · click to enlarge
Page 288

VS_Global_ GetFields

VS_Global_GetFields retrieves global default parameters for all commands. A global handle is used to maintain global default parameter values for VolServ commands.

Tip

Global defaults can be overridden by command-level specific defaults. Command-specific defaults, in turn, can be overridden by parameter values specified in an actual command’s parameter list.

Synopsis VST_BOOLEAN VS_Global_GetFields ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 289 of the ADIC 601355 Rev A user manual — VSID_NOTIFY_DISPATCH (VST_NOTIFY_DISPATCH *)
Page 289 · click to enlarge
Page 289

VSID_ASYNC_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)

Pointer to the RPC program number to use for asynchronous processing.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH *)

Pointer to the dispatch function for all commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the identifier of the enterprise, if any, to receive intermediate and final status on every command request.

VSID_INIT (int *) Pointer to a flag that indicates whether the API is initialized. The value is VSE_TRUE if the API is initialized and VSE_FALSE otherwise.

VSID_NOTIFY_DISPATCH (VST_NOTIFY_DISPATCH *)

Pointer to the dispatch function used for notification (MediaClass callback) processing.

VSID_PRIORITY (VST_PRIORITY *) Pointer to the default execution priority to be assigned to every command request. Default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT *) Pointer to the default number of times the API software retries for command status from VolServ before returning a time-out to the client software for every command request. Total length of time the API software waits for a command status from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. Default value is 3.

Parameters · Parameter Type Description

Page 290 of the ADIC 601355 Rev A user manual — VSID_SYNC_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)
Page 290 · click to enlarge
Page 290

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG*)

Pointer to a flag that indicates whether the API software is to wait for final status from VolServ (or to time-out) for a request. Valid options are VSE_TRUE (API is to wait for final status) and VSE_FALSE (API is not to wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). Default value is VSE_TRUE.

VSID_SYNC_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)

Pointer to the RPC program number to use for synchronous processing.

VSID_TIMEOUT_VALUE (VST_TIME_OUT *) Pointer to the amount of time (in seconds) the API software is to wait for status from VolServ before returning a time-out to the client software. Default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Pointer to the default value to be placed in the VSID_USER_FIELD for every command request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for each command. Neither the API software nor VolServ uses USER_FIELD.

Return Values VS_Global_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.

Parameter Type Description

Page 291 of the ADIC 601355 Rev A user manual — Example
Page 291 · click to enlarge
Page 291

********* 2 * 3 * FUNCTION: vst_show_globals 4 * 5 * PURPOSE: 6 * This function allows the user to display the 7 * VolServ API’s global parameters. 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_show_globals( void ) 14 #else 15 VST_BOOLEAN vst_show_globals() 16 #endif 17 { 18 VST_PRIORITY priority; 19 VST_USER_FIELD user_field; 20 VST_TIME_OUT timeout; 21 VST_RETRY_LIMIT retries; 22 VST_STATUS_WAIT_FLAG wait; 23 VST_ENTERPRISE_ID enterprise; 24 25 VS_Global_GetFields(VSID_PRIORITY,

&priority, 26 VSID_USER_FIELD, user_field, 27 VSID_TIMEOUT_VALUE, &timeout, 28 VSID_RETRY_LIMIT, &retries, 29 VSID_STATUS_WAIT_FLAG, &wait, 30 VSID_ENTERPRISE_ID, &enterprise, 31 VSID_ENDFIELD); 32 printf(“*** Global Parameters

Example 1 /**************************************** · ***\n”);

Page 292 of the ADIC 601355 Rev A user manual — Note
Page 292 · click to enlarge
Page 292

33 printf(“Priority = %d User field =

[%s]\n”, priority, user_field); 34 printf(“Time out value = %d Retry

count = %d\n”, timeout, retries); 35 printf(“Status wait = %d Enterprise =

%lu\n”, wait, enterprise); 36 }

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Select(l)
Page 293 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Global_SetFields ( "…", VSID_ENDFIELD )
Page 293 · click to enlarge
Page 293

VS_Global_ SetFields

VS_Global_SetFields sets the value of one or more fields in a global handle. A global handle is used to maintain global default parameter values for VolServ commands.

Tip

Global defaults can be overridden by command-level specific defaults. Command-specific defaults, in turn, can be overridden by parameter values specified in an actual command’s parameter list.

Synopsis VST_BOOLEAN VS_Global_SetFields ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 294 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 294 · click to enlarge
Page 294

VSID_ASYNC_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number to use for asynchronous processing. If not specified or 0, the API uses a transient number. Default value is 0.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Dispatch function for all commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on every command request.

VSID_NOTIFY_DISPATCH (VST_NOTIFY_DISPATCH)

Pointer to the dispatch function used for notification (MediaClass callback) processing.

VSID_PRIORITY (VST_PRIORITY) Default execution priority to be assigned to every command. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. Default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Default number of times the API software is to retry for command status from VolServ before returning a time-out to the client software for every command request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. Default value is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software is to wait for final status from VolServ (or to time-out) for a command. Valid options are VSE_TRUE (API is to wait for final status) and VSE_FALSE (API is not to wait for final status).

Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). Default value is VSE_TRUE.

Parameters · Parameter Type Description

Page 295 of the ADIC 601355 Rev A user manual — VSID_SYNC_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 295 · click to enlarge
Page 295

VSID_SYNC_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number to use for synchronous processing. If not specified or 0, the API uses a transient number. Default value is 0.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. Default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Pointer to the default value to be put in the VSID_USER_FIELD for every command. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for each command. Neither the API software nor VolServ uses USER_FIELD.

Return Values VS_Global_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not an expression handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 296 of the ADIC 601355 Rev A user manual — Example
Page 296 · click to enlarge
Page 296
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_set_globals 4 * 5 * PURPOSE: 6 * This function allows the user to set VolServ API’s 7 * global parameters. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_set_globals( void ) 15 #else 16 VST_BOOLEAN vst_set_globals() 17 #endif 18 { 19 VST_PRIORITY priority; 20 VST_USER_FIELD user_field; 21 VST_TIME_OUT timeout; 22 VST_RETRY_LIMIT retries; 23 VST_STATUS_WAIT_FLAG wait_flag; 24 VST_ENTERPRISE_ID enterprise_id; 25 VST_BOOLEAN rc; 26 27 printf(“*** Set Global Parameters

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 29 rc =

VS_Global_SetFields(VSID_PRIORITY , priority,

Example 1 /**************************************** · ***\n\n”); 28 vst_promptforglobals(&priority,

Page 297 of the ADIC 601355 Rev A user manual — Note
Page 297 · click to enlarge
Page 297

30 VSID_USER_FIELD, user_field, 31 VSID_TIMEOUT_VALUE, timeout, 32 VSID_RETRY_LIMIT, retries, 33 VSID_STATUS_WAIT_FLAG, wait_flag, 34 VSID_ENTERPRISE_ID, enterprise_id, 35 VSID_ENDFIELD); 36 return (rc); 37 }

This function can be called before VS_Initialize. To set the SYNC/ASYNC program numbers, this function must be called before VS_Initialize.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_GetFields(l),
  • VS_Select(l),
Page 298 of the ADIC 601355 Rev A user manual — Notes
Page 298 · click to enlarge
Page 298
  • VS_Initialize(l)
Page 299 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Initialize ( VST_HOSTNAME hostname, VST_PROGRAM_NUMBER prognum, int time-out )
Page 299 · click to enlarge
Page 299

VS_Initialize VS_Initialize readies the VolServ API library for use by the client software.

VS_Initialize creates and registers RPC transports for receiving VolServ status messages and also performs initialization processing required by other API functions.

VS_Initialize must be called before any API command functions are called.

Synopsis VST_BOOLEAN VS_Initialize ( VST_HOSTNAME hostname, VST_PROGRAM_NUMBER prognum, int time-out )

Arguments • hostname = Name of the computer running VolServ.

- If NULL is specified, hostname defaults to the current host machine.

  • prognum = Program number on which VolServ is registered.

- If 0 is specified, prognum defaults to 300016 - the VolServ default.

  • timeout = Amount of time, in seconds, to wait for an initial status from VolServ before timing out.
Page 300 of the ADIC 601355 Rev A user manual — Return Values
Page 300 · click to enlarge
Page 300

Return Values VS_Initialize returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - The appropriate error code is set in VSG_Error.
  • VSE_ERR_INITIALIZED - VolServ API is already initialized.
  • VSE_ERR_OUTOFMEM - Memory allocation call failed.
  • VSE_ERR_PMAPFAILED - RPC registration for return status failed. RPC address specified could not be registered with the local machine’s port mapper.
  • VSE_ERR_SYSTEMCALL - A system call failed (usually from RPC). This generic error code covers an error that stems from a system call. The API sets this error code when encountering a failure during RPC setup.

********* 2 * 3 * FUNCTION: vst_initialize 4 * 5 * PURPOSE: 6 * This function initializes the VolServ API. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_initialize(void) 14 #else 15 VST_BOOLEAN vst_initialize() 16 #endif 17 {

Example 1 /****************************************

Page 301 of the ADIC 601355 Rev A user manual — Return Values
Page 301 · click to enlarge
Page 301

18 int timeout; 19 VST_HOSTNAME host; 20 VST_PROGRAM_NUMBER prognum; 21 VST_PROGRAM_NUMBER syncnum; 22 VST_PROGRAM_NUMBER asyncnum; 23 VST_BOOLEAN rc = VSE_FALSE; 24 25 /* get parameters from user */ 26 printf(“*** Initialize parameters

***\n” ); 27 printf(“Enter VolServ Host ==> “ ); 28 gets( host ); 29 printf(“Enter VolServ Program Number

==> “ ); 30 prognum = atol(gets(input)); 31 printf(“Enter Timeout Value ==> “ ); 32 timeout = atoi(gets(input)); 33 34 /* change the sync/async program

numbers */ 35 printf(“*** RPC Program numbers

***\n” ); 36 printf(“Enter Sync Program Number (0

for default) ==> “ ); 37 syncnum = atol(gets(input)); 38 printf(“Enter Async Program Number (0

for default) ==> “ ); 39 asyncnum = atol(gets(input)); 40 41 if ( syncnum != 0 ) 42 { 43 VS_Global_SetFields ( 44 VSID_SYNC_PROGRAM_NUMBER, syncnum, 45 VSID_ENDFIELD ); 46 } 47 48 if ( asyncnum != 0 ) 49 { 50 VS_Global_SetFields (

Page 302 of the ADIC 601355 Rev A user manual — Notes
Page 302 · click to enlarge
Page 302

51 VSID_ASYNC_PROGRAM_NUMBER, asyncnum, 52 VSID_ENDFIELD ); 53 } 54 rc = VS_Initialize(host, prognum,

timeout); 55 return(rc); 56 }

All command functions fail if VS_Initialize is not invoked.

VS_Initialize does not verify that VolServ is currently running on the given host. Use VS_Ping to check VolServ's status.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Terminate(1),
  • VS_Global_SetFields(l)
Page 303 of the ADIC 601355 Rev A user manual — Synopsis VST_MEDIA_HANDLE VS_Media_Create ( void )
Page 303 · click to enlarge
Page 303

VS_Media_ Create

VS_Media_Create allocates a VolServ API media handle. A media handle is used to pass media information to and from VolServ.

Synopsis VST_MEDIA_HANDLE VS_Media_Create ( void )

Return Values VS_Media_Create returns:

  • A media handle, if one could be allocated.
  • NULL, if a media handle could not be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_media_handle 4 * 5 * PURPOSE: 6 * This function tests a media handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_media_handle(void) 14 #else 15 VST_BOOLEAN vst_media_handle() 16 #endif 17 {

Arguments None · Example 1 /****************************************

Page 304 of the ADIC 601355 Rev A user manual — VS_Media_ Create
Page 304 · click to enlarge
Page 304

18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_HANDLE h; 20 VST_MEDIA_ID MediaID; 21 VST_MEDIA_TYPE_NAME

MediaTypeName; 22 VST_BATCH_NAME BatchName; 23 VST_MANUFACTURER_NAME

LocationState; 26 VST_ACTION_STATE ActionState; 27 VST_ARCHIVE_NAME

PendingArchive; 29 VST_TIME ImportDate; 30 VST_TIME

LastDismount; 31 VST_ASSIGNMENT Assignment; 32 int MountCount; 33 int MoveCount; 34 35 /* create the handle */ 36 h = VS_Media_Create(); 37 if (h != (VST_MEDIA_HANDLE) NULL) 38 { 39 /* get values from user */ 40 printf(“*** Media Handle ***\n”); 41 printf(“Enter media id ==> “); 42 gets(MediaID); 43 printf(“Enter media type ==> “); 44 gets(MediaTypeName); 45 printf(“Enter batch name ==> “); 46 gets(BatchName); 47 printf(“Enter Manufacturer ==> “); 48 gets(Manufacturer); 49 printf(“Enter Media Class Name ==> “);

Manufacturer; 24 VST_MEDIA_CLASS_NAME · MediaClassName; 25 VST_MEDIA_LOC_STATE · CurrentArchive; 28 VST_ARCHIVE_NAME

Page 305 of the ADIC 601355 Rev A user manual — VS_Media_ Create
Page 305 · click to enlarge
Page 305

50 gets(MediaClassName); 51 printf(“Enter media location state ==> “); 52 LocationState = atoi(gets(input)); 53 printf(“Enter action state ==> “); 54 ActionState = atoi(gets(input)); 55 printf(“Enter current archive ==> “); 56 gets(CurrentArchive); 57 printf(“Enter pending archive ==> “); 58 gets(PendingArchive); 59 printf(“enter assignment value ==> “); 60 Assignment = atoi(gets(input)); 61 printf(“enter mount count ==> “); 62 MountCount = atoi(gets(input)); 63 printf(“enter move count ==> “); 64 MoveCount = atoi(gets(input)); 65 /* set the fields in the handle */ 66 rc = VS_Media_SetFields(h, 67 VSID_MEDIA_ID, MediaID, 68 VSID_MEDIA_TYPE_NAME, MediaTypeName, 69 VSID_BATCH_NAME, BatchName, 70 VSID_MANUFACTURER, Manufacturer, 71 VSID_MEDIA_CLASS_NAME, MediaClassName, 72 VSID_MEDIA_LOC_STATE, LocationState, 73 VSID_ACTION_STATE, ActionState, 74 VSID_CURRENT_ARCHIVE_NAME, CurrentArchive, 75 VSID_PENDING_ARCHIVE_NAME, PendingArchive, 76 VSID_ASSIGNMENT, Assignment,

Page 306 of the ADIC 601355 Rev A user manual — Notes
Page 306 · click to enlarge
Page 306

77 VSID_MOUNT_COUNT, MountCount, 78 VSID_MOVE_COUNT, MoveCount, 79 VSID_ENDFIELD); 80 if (rc) 81 { 82 vst_print_media(h); 83 } 84 VS_Media_Destroy(h); 85 } 86 return(rc); 87 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Media_Destroy(l),
  • VS_Media_GetFields(l),
  • VS_Media_SetFields(l)
Page 307 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Media_Destroy (VST_MEDIA_HANDLE handle)
Page 307 · click to enlarge
Page 307

VS_Media_ Destroy

VS_Media_Destroy deallocates a VolServ API media handle that was allocated by VS_Media_Create. A media destroy handle is used to pass media information to and from VolServ.

Synopsis VST_BOOLEAN VS_Media_Destroy (VST_MEDIA_HANDLE handle)

Arguments • handle = The media handle to be destroyed.

Return Values VS_Media_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a media handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_media_handle 4 * 5 * PURPOSE: 6 * This function tests a media handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/

Example 1 /****************************************

Page 308 of the ADIC 601355 Rev A user manual — VS_Media_ Destroy
Page 308 · click to enlarge
Page 308

12 #ifdef ANSI_C 13 VST_BOOLEAN vst_media_handle(void) 14 #else 15 VST_BOOLEAN vst_media_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_HANDLE h; 20 VST_MEDIA_ID MediaID; 21 VST_MEDIA_TYPE_NAME

MediaTypeName; 22 VST_BATCH_NAME BatchName; 23 VST_MANUFACTURER_NAME

LocationState; 26 VST_ACTION_STATE ActionState; 27 VST_ARCHIVE_NAME

PendingArchive; 29 VST_TIME ImportDate; 30 VST_TIME

LastDismount; 31 VST_ASSIGNMENT Assignment; 32 int MountCount; 33 int MoveCount; 34 35 /* create the handle */ 36 h = VS_Media_Create(); 37 if (h != (VST_MEDIA_HANDLE) NULL) 38 { 39 /* get values from user */ 40 printf(“*** Media Handle ***\n”); 41 printf(“Enter media id ==> “); 42 gets(MediaID); 43 printf(“Enter media type ==> “); 44 gets(MediaTypeName); 45 printf(“Enter batch name ==> “);

Manufacturer; 24 VST_MEDIA_CLASS_NAME · MediaClassName; 25 VST_MEDIA_LOC_STATE · CurrentArchive; 28 VST_ARCHIVE_NAME

Page 309 of the ADIC 601355 Rev A user manual — VS_Media_ Destroy
Page 309 · click to enlarge
Page 309

46 gets(BatchName); 47 printf(“Enter Manufacturer ==> “); 48 gets(Manufacturer); 49 printf(“Enter Media Class Name ==> “); 50 gets(MediaClassName); 51 printf(“Enter media location state ==> “); 52 LocationState = atoi(gets(input)); 53 printf(“Enter action state ==> “); 54 ActionState = atoi(gets(input)); 55 printf(“Enter current archive ==> “); 56 gets(CurrentArchive); 57 printf(“Enter pending archive ==> “); 58 gets(PendingArchive); 59 printf(“enter assignment value ==> “); 60 Assignment = atoi(gets(input)); 61 printf(“enter mount count ==> “); 62 MountCount = atoi(gets(input)); 63 printf(“enter move count ==> “); 64 MoveCount = atoi(gets(input)); 65 /* set the fields in the handle */ 66 rc = VS_Media_SetFields(h, 67 VSID_MEDIA_ID, MediaID, 68 VSID_MEDIA_TYPE_NAME, MediaTypeName, 69 VSID_BATCH_NAME, BatchName, 70 VSID_MANUFACTURER, Manufacturer, 71 VSID_MEDIA_CLASS_NAME, MediaClassName, 72 VSID_MEDIA_LOC_STATE, LocationState, 73 VSID_ACTION_STATE, ActionState,

Page 310 of the ADIC 601355 Rev A user manual — Notes
Page 310 · click to enlarge
Page 310

74 VSID_CURRENT_ARCHIVE_NAME, CurrentArchive, 75 VSID_PENDING_ARCHIVE_NAME, PendingArchive, 76 VSID_ASSIGNMENT, Assignment, 77 VSID_MOUNT_COUNT, MountCount, 78 VSID_MOVE_COUNT, MoveCount, 79 VSID_ENDFIELD); 80 if (rc) 81 { 82 vst_print_media(h); 83 } 84 VS_Media_Destroy(h); 85 } 86 return(rc); 87 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Media_Create(l),
  • VS_Media_GetFields(l),
  • VS_Media_SetFields(l)
Page 311 of the ADIC 601355 Rev A user manual — VSID_ACTION_STATE (VST_ACTION_STATE *)
Page 311 · click to enlarge
Page 311

VS_Media_ GetFields

VS_Media_GetFields retrieves information associated with a media handle. A media handle is used to pass media information to and from VolServ.

Synopsis VST_BOOLEAN VS_Media_GetFields (VST_MEDIA_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The media handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ACTION_STATE (VST_ACTION_STATE *)

Action state associated with this medium. Valid VSID_ACTION_STATE values are enumerated in the vs_types.h file.

VSID_ASSIGNMENT (VST_ASSIGNMENT *) Current assignment of this medium. Valid VSID_ASSIGNMENT values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 312 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 312 · click to enlarge
Page 312

VSID_BATCH_NAME (VST_BATCH_NAME) Pointer to the name of the batch associated with this medium. Valid batch names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CURRENT_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of the archive where the medium is currently stored. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_IMPORT_DATE (VST_TIME *) Pointer to the date this medium was imported into the VolServ system.

VSID_LAST_DISMOUNT (VST_TIME *) Pointer to the time this medium was last dismounted.

VSID_MANUFACTURER (VST_MANUFACTURER_NAME)

Pointer to the manufacturer associated with this medium. Valid manufacturer names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass group with which this medium is associated.

VSID_MEDIA_ID (VST_MEDIA_ID) Pointer to the identifier of this medium.

VSID_MEDIA_LOC_STATE (VST_MEDIA_LOC_STATE *)

Pointer to the location state of this medium. Valid VSID_MEDIA_LOC_STATE values are enumerated in the vs_types.h file

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Pointer to the media type associated with this medium. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MOUNT_COUNT (VST_COUNT *) Pointer to the number of times this medium has been mounted.

Parameter Type Description

Page 313 of the ADIC 601355 Rev A user manual — VSID_PENDING_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 313 · click to enlarge
Page 313

VSID_MOVE_COUNT (VST_COUNT *) Pointer to the number of times this medium has been moved from one archive to another.

VSID_PENDING_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of the destination archive for this medium. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Return Values VS_Media_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a media handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_media 4 * 5 * PURPOSE: 6 * This function prints out the information stored 7 * in a media handle. 8 * PARAMETERS: 9 * h : the media handle to print 10 *

Parameter Type Description · Example 1 /****************************************

Page 314 of the ADIC 601355 Rev A user manual — Return Values
Page 314 · click to enlarge
Page 314

11 **************************************** *********/ 12 #ifdef ANSI_C 13 void vst_print_media(VST_MEDIA_HANDLE h) 14 #else 15 void vst_print_media(h) 16 VST_MEDIA_HANDLE h; 17 #endif 18 { 19 VST_MEDIA_ID MediaID; 20 VST_MEDIA_TYPE_NAME

MediaTypeName; 21 VST_BATCH_NAME BatchName; 22 VST_MANUFACTURER_NAME

LocationState; 25 VST_ACTION_STATE ActionState; 26 VST_ARCHIVE_NAME

PendingArchive; 28 VST_TIME ImportDate; 29 VST_TIME

LastDismount; 30 VST_ASSIGNMENT Assignment; 31 int MountCount; 32 int MoveCount; 33 34 VS_Media_GetFields(h, 35 VSID_MEDIA_ID, MediaID, 36 VSID_MEDIA_TYPE_NAME, MediaTypeName, 37 VSID_BATCH_NAME, BatchName, 38 VSID_MANUFACTURER, Manufacturer,

Manufacturer; 23 VST_MEDIA_CLASS_NAME · MediaClassName; 24 VST_MEDIA_LOC_STATE · CurrentArchive; 27 VST_ARCHIVE_NAME

Page 315 of the ADIC 601355 Rev A user manual — Return Values
Page 315 · click to enlarge
Page 315

39 VSID_MEDIA_CLASS_NAME, MediaClassName, 40 VSID_MEDIA_LOC_STATE, &LocationState, 41 VSID_ACTION_STATE, &ActionState, 42 VSID_CURRENT_ARCHIVE_NAME, CurrentArchive, 43 VSID_PENDING_ARCHIVE_NAME, PendingArchive, 44 VSID_IMPORT_DATE, &ImportDate, 45 VSID_LAST_DISMOUNT, &LastDismount, 46 VSID_ASSIGNMENT, &Assignment, 47 VSID_MOUNT_COUNT, &MountCount, 48 VSID_MOVE_COUNT, &MoveCount, 49 VSID_ENDFIELD); 50 printf(“******Media

Handle******\n”); 51 printf(“Media ID = %s\n”,MediaID); 52 printf(“Media Type Name =

%s\n”,MediaTypeName); 53 printf(“Batch Name =

%s\n”,BatchName); 54 printf(“Manufacturer =

%s\n”,Manufacturer); 55 printf(“Media Class Name =

%s\n”,MediaClassName); 56 printf(“Media Loc State =

%d\n”,LocationState); 57 printf(“Action State =

%d\n”,ActionState); 58 printf(“Current Archive =

%s\n”,CurrentArchive); 59 printf(“Pending Archive =

%s\n”,PendingArchive); 60 printf(“Import Date =

%d\n”,ImportDate);

Page 316 of the ADIC 601355 Rev A user manual — Note
Page 316 · click to enlarge
Page 316

61 printf(“Last Dismount =

%d\n”,LastDismount); 62 printf(“Assignment =

%d\n”,Assignment); 63 printf(“Move Count =

%d\n”,MoveCount); 64 printf(“Mount Count =

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Media_Create(l),
  • VS_Media_Destroy(l),
  • VS_Media_SetFields(l),
  • VSCMS_MediaQuery(l),
  • VSCMD_MediaClassQuery(l)

%d\n”,MountCount); 65 }

Page 317 of the ADIC 601355 Rev A user manual — VSID_ACTION_STATE (VST_ACTION_STATE)
Page 317 · click to enlarge
Page 317

VS_Media_ SetFields

VS_Media_SetFields sets the value of one or more fields associated with a media handle. A media handle is used to pass media information to and from VolServ.

Synopsis VST_BOOLEAN VS_Media_SetFields (VST_MEDIA_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The media handle where information is stored or updated.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ACTION_STATE (VST_ACTION_STATE)

Action state associated with this medium. Valid VSID_ACTION_STATE values are enumerated in the vs_types.h file.

VSID_ASSIGNMENT (VST_ASSIGNMENT) Current assignment of this medium. Valid VSID_ASSIGNMENT values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 318 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAM (VST_MEDIA_TYPE_NAME)
Page 318 · click to enlarge
Page 318

VSID_BATCH_NAME (VST_BATCH_NAME) Name of the batch associated with this medium. Valid batch names may contain 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CURRENT_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive where the medium is currently stored. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_IMPORT_DATE (VST_TIME) Date this medium was imported into the VolServ system.

VSID_LAST_DISMOUNT (VST_TIME) Time this medium was last dismounted.

VSID_MANUFACTURER (VST_MANUFACTURER_NAME)

Manufacturer associated with this medium. Valid manufacturer names may contain 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

MediaClass group with which this medium is associated.

VSID_MEDIA_ID (VST_MEDIA_ID) Identifier of this medium.

VSID_MEDIA_LOC_STATE (VST_MEDIA_LOC_STATE)

Location state of this medium. Valid VSID_MEDIA_LOC_STATE values are enumerated in the vs_types.h file

VSID_MEDIA_TYPE_NAM (VST_MEDIA_TYPE_NAME)

Media type associated with this medium. Valid media types may contain 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MOUNT_COUNT (VST_COUNT) Number of times this medium has been mounted.

VSID_MOVE_COUNT (VST_COUNT) Number of times this medium has been moved from one archive to another.

Parameter Type Description

Page 319 of the ADIC 601355 Rev A user manual — VSID_PENDING_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 319 · click to enlarge
Page 319

VSID_PENDING_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the destination archive for this medium. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Return Values VS_Media_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a media handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_media_handle 4 * 5 * PURPOSE: 6 * This function tests a media handle. 7 * 8 * PARAMETERS: 9 * none

Parameter Type Description · Example 1 /****************************************

Page 320 of the ADIC 601355 Rev A user manual — Return Values
Page 320 · click to enlarge
Page 320

10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_media_handle(void) 14 #else 15 VST_BOOLEAN vst_media_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_HANDLE h; 20 VST_MEDIA_ID MediaID; 21 VST_MEDIA_TYPE_NAME

MediaTypeName; 22 VST_BATCH_NAME BatchName; 23 VST_MANUFACTURER_NAME

LocationState; 26 VST_ACTION_STATE ActionState; 27 VST_ARCHIVE_NAME

PendingArchive; 29 VST_TIME ImportDate; 30 VST_TIME

LastDismount; 31 VST_ASSIGNMENT Assignment; 32 int MountCount; 33 int MoveCount; 34 35 /* create the handle */ 36 h = VS_Media_Create(); 37 if (h != (VST_MEDIA_HANDLE) NULL) 38 { 39 /* get values from user */ 40 printf(“*** Media Handle ***\n”); 41 printf(“Enter media id ==> “); 42 gets(MediaID);

Manufacturer; 24 VST_MEDIA_CLASS_NAME · MediaClassName; 25 VST_MEDIA_LOC_STATE · CurrentArchive; 28 VST_ARCHIVE_NAME

Page 321 of the ADIC 601355 Rev A user manual — Return Values
Page 321 · click to enlarge
Page 321

43 printf(“Enter media type ==> “); 44 gets(MediaTypeName); 45 printf(“Enter batch name ==> “); 46 gets(BatchName); 47 printf(“Enter Manufacturer ==> “); 48 gets(Manufacturer); 49 printf(“Enter Media Class Name ==> “); 50 gets(MediaClassName); 51 printf(“Enter media location state ==> “); 52 LocationState = atoi(gets(input)); 53 printf(“Enter action state ==> “); 54 ActionState = atoi(gets(input)); 55 printf(“Enter current archive ==> “); 56 gets(CurrentArchive); 57 printf(“Enter pending archive ==> “); 58 gets(PendingArchive); 59 printf(“enter assignment value ==> “); 60 Assignment = atoi(gets(input)); 61 printf(“enter mount count ==> “); 62 MountCount = atoi(gets(input)); 63 printf(“enter move count ==> “); 64 MoveCount = atoi(gets(input)); 65 /* set the fields in the handle */ 66 rc = VS_Media_SetFields(h, 67 VSID_MEDIA_ID, MediaID, 68 VSID_MEDIA_TYPE_NAME, MediaTypeName, 69 VSID_BATCH_NAME, BatchName, 70 VSID_MANUFACTURER, Manufacturer, 71 VSID_MEDIA_CLASS_NAME, MediaClassName,

Page 322 of the ADIC 601355 Rev A user manual — Note
Page 322 · click to enlarge
Page 322

72 VSID_MEDIA_LOC_STATE, LocationState, 73 VSID_ACTION_STATE, ActionState, 74 VSID_CURRENT_ARCHIVE_NAME, CurrentArchive, 75 VSID_PENDING_ARCHIVE_NAME, PendingArchive, 76 VSID_ASSIGNMENT, Assignment, 77 VSID_MOUNT_COUNT, MountCount, 78 VSID_MOVE_COUNT, MoveCount, 79 VSID_ENDFIELD); 80 if (rc) 81 { 82 vst_print_media(h); 83 } 84 VS_Media_Destroy(h); 85 } 86 return(rc); 87 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Media_Create(l),
  • VS_Media_Destroy(l),
  • VS_Media_SetFields(l)
Page 323 of the ADIC 601355 Rev A user manual — Synopsis VST_MEDIACLASS_HANDLE VS_MediaClass_Create (void)
Page 323 · click to enlarge
Page 323

VS_ MediaClass_ Create

VS_MediaClass_Create allocates a VolServ API MediaClass handle. A MediaClass handle is used to pass MediaClass information to and from VolServ.

Synopsis VST_MEDIACLASS_HANDLE VS_MediaClass_Create (void)

Return Values VS_MediaClass_Create returns:

  • A MediaClass handle, if one can be allocated.
  • NULL, if a MediaClass handle could not be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_mediaclass_handle 4 * 5 * PURPOSE: 6 * This function tests a mediaclass handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Arguments None · Example 1 /**************************************** · vst_mediaclass_handle(void)

Page 324 of the ADIC 601355 Rev A user manual — VS_ MediaClass_ Create
Page 324 · click to enlarge
Page 324

14 #else 15 VST_BOOLEAN vst_mediaclass_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIACLASS_HANDLE h; 20 VST_MEDIA_CLASS_NAME MediaClass; 21 VST_MEDIA_TYPE_NAME

ReleasePriority; 23 VST_CAPACITY Capacity; 24 VST_FILL_LEVEL FillLevel; 25 VST_CLASS_MOUNT_STATE MountState; 26 VST_HIGH_MARK HighMark; 27 VST_CLASS_RPC_OPTION RPC_Option; 28 VST_HOSTNAME

RPC_HostName; 29 VST_PROGRAM_NUMBER RPC_ProgNum; 30 VST_VERSION_NUMBER RPC_VersNum; 31 VST_PROCEDURE_NUMBER RPC_ProcNum; 32 VST_PROTOCOL

NotifyComment; 35 36 /* create the handle */ 37 h = VS_MediaClass_Create(); 38 if (h != (VST_MEDIACLASS_HANDLE)

NULL) 39 { 40 /* get values from user */ 41 printf(“*** Media Class Handle ***\n”); 42 printf(“Enter mediaclass name ==> “); 43 gets(MediaClass); 44 printf(“Enter media type name ==> “);

MediaTypeName; 22 VST_PRIORITY · RPC_Protocol; 33 VST_ENTERPRISE_ID · EnterpriseID; 34 VST_NOTIFY_COMMENT

Page 325 of the ADIC 601355 Rev A user manual — VS_ MediaClass_ Create
Page 325 · click to enlarge
Page 325

45 gets(MediaTypeName); 46 printf(“Enter release priority ==> “); 47 ReleasePriority = atoi(gets(input)); 48 printf(“Enter capacity ==> “); 49 Capacity = atoi(gets(input)); 50 printf(“Enter fill level ==> “); 51 FillLevel = atoi(gets(input)); 52 printf(“Enter mount state ==> “); 53 MountState = atoi(gets(input)); 54 printf(“Enter high mark ==> “); 55 HighMark = atoi(gets(input)); 56 printf(“Enter class RPC option ==> “); 57 RPC_Option = atoi(gets(input)); 58 printf(“Enter RPC host name ==> “); 59 gets(RPC_HostName); 60 printf(“Enter RPC program number ==> “); 61 RPC_ProgNum = atol(gets(input)); 62 printf(“Enter RPC version number ==> “); 63 RPC_VersNum = atol(gets(input)); 64 printf(“Enter RPC procedure number ==> “); 65 RPC_ProcNum = atol(gets(input)); 66 printf(“Enter RPC protocol ==> “); 67 RPC_Protocol = atoi(gets(input)); 68 printf(“Enter enterprise id ==> “); 69 EnterpriseID = atol(gets(input)); 70 printf(“Enter notify comment ==> “); 71 gets(NotifyComment); 72 /* set the fields */ 73 rc = VS_MediaClass_SetFields(h, 74 VSID_MEDIA_CLASS_NAME, MediaClass, 75 VSID_MEDIA_TYPE_NAME, MediaTypeName,

Page 326 of the ADIC 601355 Rev A user manual — Notes
Page 326 · click to enlarge
Page 326

76 VSID_RELEASE_PRIORITY, ReleasePriority, 77 VSID_CAPACITY, Capacity, 78 VSID_FILL_LEVEL, FillLevel, 79 VSID_CLASS_MOUNT_STATE, MountState, 80 VSID_HIGH_MARK, HighMark, 81 VSID_CLASS_RPC_OPTION, RPC_Option, 82 VSID_HOST_NAME, RPC_HostName, 83 VSID_PROGRAM_NUMBER, RPC_ProgNum, 84 VSID_VERSION_NUMBER, RPC_VersNum, 85 VSID_PROCEDURE_NUMBER, RPC_ProcNum, 86 VSID_PROTOCOL, RPC_Protocol, 87 VSID_ENTERPRISE_ID, EnterpriseID, 88 VSID_NOTIFY_COMMENT, NotifyComment, 89 VSID_ENDFIELD); 90 if (rc) 91 { 92 vst_print_mediaclass(h); 93 } 94 VS_MediaClass_Destroy(h); 95 } 96 return(rc); 97 }

Page 327 of the ADIC 601355 Rev A user manual — See Also
Page 327 · click to enlarge
Page 327

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaClass_Destroy(l),
  • VS_MediaClass_GetFields(l),
  • VS_MediaClass_SetFields(l)
Page 328 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_MediaClass_Destroy (VST_MEDIACLASS_HANDLE handle)
Page 328 · click to enlarge
Page 328

VS_ MediaClass_ Destroy

VS_MediaClass_Destroy deallocates a VolServ API MediaClass handle that was allocated with VS_MediaClass_Create. A MediaClass handle is used to pass MediaClass information to and from VolServ.

Synopsis VST_BOOLEAN VS_MediaClass_Destroy (VST_MEDIACLASS_HANDLE handle)

Arguments • handle = The MediaClass handle to be destroyed.

Return Values VS_MediaClass_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a MediaClass handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_mediaclass_handle 4 * 5 * PURPOSE: 6 * This function tests a mediaclass handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 329 of the ADIC 601355 Rev A user manual — VS_ MediaClass_ Destroy
Page 329 · click to enlarge
Page 329

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediaclass_handle(void) 14 #else 15 VST_BOOLEAN vst_mediaclass_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIACLASS_HANDLE h; 20 VST_MEDIA_CLASS_NAME MediaClass; 21 VST_MEDIA_TYPE_NAME

ReleasePriority; 23 VST_CAPACITY Capacity; 24 VST_FILL_LEVEL FillLevel; 25 VST_CLASS_MOUNT_STATE MountState; 26 VST_HIGH_MARK HighMark; 27 VST_CLASS_RPC_OPTION RPC_Option; 28 VST_HOSTNAME

RPC_HostName; 29 VST_PROGRAM_NUMBER RPC_ProgNum; 30 VST_VERSION_NUMBER RPC_VersNum; 31 VST_PROCEDURE_NUMBER RPC_ProcNum; 32 VST_PROTOCOL

NotifyComment; 35 36 /* create the handle */ 37 h = VS_MediaClass_Create(); 38 if (h != (VST_MEDIACLASS_HANDLE)

NULL) 39 { 40 /* get values from user */ 41 printf(“*** Media Class Handle ***\n”);

MediaTypeName; 22 VST_PRIORITY · RPC_Protocol; 33 VST_ENTERPRISE_ID · EnterpriseID; 34 VST_NOTIFY_COMMENT

Page 330 of the ADIC 601355 Rev A user manual — VS_ MediaClass_ Destroy
Page 330 · click to enlarge
Page 330

42 printf(“Enter mediaclass name ==> “); 43 gets(MediaClass); 44 printf(“Enter media type name ==> “); 45 gets(MediaTypeName); 46 printf(“Enter release priority ==> “); 47 ReleasePriority = atoi(gets(input)); 48 printf(“Enter capacity ==> “); 49 Capacity = atoi(gets(input)); 50 printf(“Enter fill level ==> “); 51 FillLevel = atoi(gets(input)); 52 printf(“Enter mount state ==> “); 53 MountState = atoi(gets(input)); 54 printf(“Enter high mark ==> “); 55 HighMark = atoi(gets(input)); 56 printf(“Enter class RPC option ==> “); 57 RPC_Option = atoi(gets(input)); 58 printf(“Enter RPC host name ==> “); 59 gets(RPC_HostName); 60 printf(“Enter RPC program number ==> “); 61 RPC_ProgNum = atol(gets(input)); 62 printf(“Enter RPC version number ==> “); 63 RPC_VersNum = atol(gets(input)); 64 printf(“Enter RPC procedure number ==> “); 65 RPC_ProcNum = atol(gets(input)); 66 printf(“Enter RPC protocol ==> “); 67 RPC_Protocol = atoi(gets(input)); 68 printf(“Enter enterprise id ==> “); 69 EnterpriseID = atol(gets(input)); 70 printf(“Enter notify comment ==> “); 71 gets(NotifyComment); 72 /* set the fields */

Page 331 of the ADIC 601355 Rev A user manual — VS_ MediaClass_ Destroy
Page 331 · click to enlarge
Page 331

73 rc = VS_MediaClass_SetFields(h, 74 VSID_MEDIA_CLASS_NAME, MediaClass, 75 VSID_MEDIA_TYPE_NAME, MediaTypeName, 76 VSID_RELEASE_PRIORITY, ReleasePriority, 77 VSID_CAPACITY, Capacity, 78 VSID_FILL_LEVEL, FillLevel, 79 VSID_CLASS_MOUNT_STATE, MountState, 80 VSID_HIGH_MARK, HighMark, 81 VSID_CLASS_RPC_OPTION, RPC_Option, 82 VSID_HOST_NAME, RPC_HostName, 83 VSID_PROGRAM_NUMBER, RPC_ProgNum, 84 VSID_VERSION_NUMBER, RPC_VersNum, 85 VSID_PROCEDURE_NUMBER, RPC_ProcNum, 86 VSID_PROTOCOL, RPC_Protocol, 87 VSID_ENTERPRISE_ID, EnterpriseID, 88 VSID_NOTIFY_COMMENT, NotifyComment, 89 VSID_ENDFIELD); 90 if (rc) 91 { 92 vst_print_mediaclass(h); 93 } 94 VS_MediaClass_Destroy(h); 95 } 96 return(rc); 97 }

Page 332 of the ADIC 601355 Rev A user manual — Notes
Page 332 · click to enlarge
Page 332

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaClass_Create(l),
  • VS_MediaClass_GetFields(l),
  • VS_MediaClass_SetFields(l)
Page 333 of the ADIC 601355 Rev A user manual — VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE *)
Page 333 · click to enlarge
Page 333

VS_ MediaClass_ GetFields

VS_MediaClass_GetFields retrieves information associated with a MediaClass handle. A MediaClass handle is used to pass MediaClass information to and from VolServ.

Synopsis VST_BOOLEAN VS_MediaClass_GetFields (VST_MEDIACLASS_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The MediaClass handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CAPACITY (VST_CAPACITY *) Pointer to the maximum number of media allowed in this MediaClass group.

VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE *)

Pointer that indicates whether this MediaClass group supports the “mount by MediaClass” functionality. Valid VSID_CLASS_MOUNT_STATE values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 334 of the ADIC 601355 Rev A user manual — VSID_MEDIA_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 334 · click to enlarge
Page 334

VSID_CLASS_RPC_OPTION (VST_CLASS_RPC_OPTION *)

Pointer that indicates whether callbacks are to be activated for this MediaClass group and if they are, which callback scheme is to be used. Valid VSID_CLASS_RPC_OPTION values are enumerated in the vs_types.h file.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE, a pointer to the identifier of the enterprise to receive unsolicited callbacks. Otherwise, VSID_ENTERPRISE_ID is not applicable.

VSID_FILL_LEVEL (VST_FILL_LEVEL *) Pointer to the current number of media in this MediaClass group.

VSID_HIGH_MARK (VST_HIGH_MARK *) Pointer to the percentage of the MediaClass capacity above which notification or automatic media migration is initiated.

VSID_HOST_NAME (VST_HOSTNAME) If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, a pointer to the network-assigned name of the computer where the task that “listens” for unsolicited callbacks executes. Otherwise, VSID_HOST_NAME is not applicable.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the name of this MediaClass group.

VSID_MEDIA_HANDLE_TABLE (VST_TABLE_HANDLE *)

Media (in table format) that belong to this MediaClass group.

VSID_MEDIA_ID (VST_MEDIA_ID) Pointer to the first media id in the media handle table.

Index of the medium in the media handle table. Pointer to the location to store the media identifier.

Parameter Type Description · VSID_MEDIA_ID_ENTRY (int, VST_MEDIA_ID)

Page 335 of the ADIC 601355 Rev A user manual — VSID_RELEASE_PRIORITY (VST_PRIORITY *)
Page 335 · click to enlarge
Page 335

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Pointer to the media type supported by this MediaClass group. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)

Pointer to the user-specified comment to be included in a system log message when the number of media in the MediaClass group exceeds the high mark threshold or drops below the low mark threshold.

VSID_NUMBER_MEDIA_HANDLES (int *) Pointer to the number of media handles in the media handle table.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER *)

If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, a pointer to the RPC procedure number of the “listening task.” Otherwise, VSID_PROCEDURE_NUMBER is not applicable.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)

If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, a pointer to the RPC program number of the client process to receive MediaClass notification messages from VolServ. If the VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_NONE or VSE_CLASS_RPC_ENTERPRISE, VSID_PROGRAM_NUMBER is not applicable.

VSID_PROTOCOL (VST_PROTOCOL *) If the VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, a pointer where Internet protocol to use to return unsolicited callbacks to the client. Valid VSID_PROTOCOL values are enumerated in the vs_types.h file.

VSID_RELEASE_PRIORITY (VST_PRIORITY *)

Pointer to the release priority for this MediaClass group.

Parameter Type Description

Page 336 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER *)
Page 336 · click to enlarge
Page 336

VSID_VERSION_NUMBER (VST_VERSION_NUMBER *)

If the VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, a pointer to the RPC version number of the “listening task.” Otherwise, VSID_VERSION_NUMBER is not applicable.

Return Values VS_MediaClass_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a MediaClass handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_mediaclass 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a media class handle. 8 * 9 * PARAMETERS: 10 * h : the media class handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C

Parameter Type Description · Example 1 /****************************************

Page 337 of the ADIC 601355 Rev A user manual — Return Values
Page 337 · click to enlarge
Page 337

vst_print_mediaclass(VST_MEDIACLA SS_HANDLEh) 15 #else 16 void vst_print_mediaclass(h) 17 VST_MEDIACLASS_HANDLE h; 18 #endif 19 { 20 VST_MEDIA_CLASS_NAME MediaClass; 21 VST_MEDIA_TYPE_NAME

ReleasePriority; 23 VST_CAPACITY Capacity; 24 VST_FILL_LEVEL FillLevel; 25 VST_CLASS_MOUNT_STATE MountState; 26 VST_HIGH_MARK HighMark; 27 VST_CLASS_RPC_OPTION RPC_Option; 28 VST_HOSTNAME

RPC_HostName; 29 VST_PROGRAM_NUMBER RPC_ProgNum; 30 VST_VERSION_NUMBER RPC_VersNum; 31 VST_PROCEDURE_NUMBER RPC_ProcNum; 32 VST_PROTOCOL

MediaHandleTable; 36 int NumEntries; 37 int i; 38 VST_MEDIA_HANDLE Media; 39 40 VS_MediaClass_GetFields(h, 41 VSID_MEDIA_CLASS_NAME, MediaClass, 42 VSID_MEDIA_TYPE_NAME, MediaTypeName, 43 VSID_RELEASE_PRIORITY, &ReleasePriority,

Show 5 more labels / short text on this page
14 void · MediaTypeName; 22 VST_PRIORITY · RPC_Protocol; 33 VST_ENTERPRISE_ID · EnterpriseID; 34 VST_NOTIFY_COMMENT · NotifyComment; 35 VST_TABLE_HANDLE
Page 338 of the ADIC 601355 Rev A user manual — Return Values
Page 338 · click to enlarge
Page 338

44 VSID_CAPACITY, &Capacity, 45 VSID_FILL_LEVEL, &FillLevel, 46 VSID_CLASS_MOUNT_STATE, &MountState, 47 VSID_HIGH_MARK, &HighMark, 48 VSID_CLASS_RPC_OPTION, &RPC_Option, 49 VSID_HOST_NAME, RPC_HostName, 50 VSID_PROGRAM_NUMBER, &RPC_ProgNum, 51 VSID_VERSION_NUMBER, &RPC_VersNum, 52 VSID_PROCEDURE_NUMBER, &RPC_ProcNum, 53 VSID_PROTOCOL, &RPC_Protocol, 54 VSID_ENTERPRISE_ID, &EnterpriseID, 55 VSID_NOTIFY_COMMENT, NotifyComment, 56 VSID_MEDIA_HANDLE_TABLE,&MediaHan dleTable, 57 VSID_ENDFIELD); 58 printf(“****** Media Class Handle

******\n”); 59 printf(“Media Class = %s\n”,

MediaClass); 60 printf(“Media Type = %s\n”,

MediaTypeName); 61 printf(“Release Priority=%d\n”,

ReleasePriority); 62 printf(“Capacity = %d\n”, Capacity); 63 printf(“Fill Level = %d\n”,

FillLevel); 64 printf(“Mount State = %d\n”,

MountState); 65 printf(“High Mark = %d\n”, HighMark);

Page 339 of the ADIC 601355 Rev A user manual — Return Values
Page 339 · click to enlarge
Page 339

66 printf(“RPC Option = %d\n”,

RPC_Option); 67 printf(“Host Name = %s\n”,

RPC_HostName); 68 rintf(“Program Number = %ld\n”,

RPC_ProgNum); 69 printf(“Version Number = %d\n”,

RPC_VersNum); 70 printf(“Procedure Number = %d\n”,

RPC_ProcNum); 71 printf(“RPC Protocol = %d\n”,

RPC_Protocol); 72 printf(“Enterprise ID = %ld\n”,

EnterpriseID); 73 printf(“Notify Comment = %s\n”,

NotifyComment); 74 if ( MediaHandleTable !=

(VST_TABLE_HANDLE) NULL) 75 { 76 VS_Table_GetFields(MediaHandleTab le, 77 VSID_NUMBER_ENTRIES, &NumEntries, 78 VSID_ENDFIELD); 79 for (i = 0; i < NumEntries; i++) 80 { 81 VS_Table_GetFields(MediaHandleTab le, 82 VSID_TABLE_ENTRY, i, &Media, 83 VSID_ENDFIELD); 84 vst_print_media(Media); 85 } 86 } 87 }

Page 340 of the ADIC 601355 Rev A user manual — Note
Page 340 · click to enlarge
Page 340

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Media_GetFields(l),
  • VS_MediaClass_Create(l),
  • VS_MediaClass_Destroy(l),
  • VS_MediaClass_SetFields(l),
  • VS_Table_Create(l),
  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_SetFields(l),
  • VSCMD_MediaClassQuery(l)
Page 341 of the ADIC 601355 Rev A user manual — VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE)
Page 341 · click to enlarge
Page 341

VS_ MediaClass_ SetFields

VS_MediaClass_SetFields sets the value for one or more fields in a specified MediaClass handle. A MediaClass handle is used to pass MediaClass information to and from VolServ.

Synopsis VST_BOOLEAN VS_MediaClass_SetFields (VST_MEDIACLASS_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The MediaClass handle where the information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CAPACITY (VST_CAPACITY) Maximum number of media allowed in this MediaClass group.

VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE)

Indicates whether this MediaClass group supports the “mount by MediaClass” functionality. Valid values for this field are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 342 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 342 · click to enlarge
Page 342

VSID_CLASS_RPC_OPTION (VST_CLASS_RPC_OPTION)

Indicates whether callbacks are to be activated for this MediaClass group and if they are, which callback scheme is to be used. Valid VSID_CLASS_RPC_OPTION values are enumerated in the vs_types.h file.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

If the VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE, the identifier of the enterprise to receive unsolicited callbacks. Otherwise, VSID_ENTERPRISE_ID is not applicable.

VSID_FILL_LEVEL (VST_FILL_LEVEL) Current number of media in this MediaClass group.

VSID_HIGH_MARK (VST_HIGH_MARK) Percentage of the MediaClass capacity above which notification or automatic media migration is initiated.

VSID_HOST_NAME (VST_HOSTNAME) If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, the network-assigned name of the computer where the task that “listens” for unsolicited callbacks executes. Otherwise, VSID_HOST_NAME is not applicable.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Name of this MediaClass group.Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces.

VSID_MEDIA_HANDLE_TABLE (VST_TABLE_HANDLE)

Media (in table format) that belong to this MediaClass group.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Media type supported by this MediaClass group. Valid media type names may contain up to 16 alphanumeric characters, including spaces.

Parameter Type Description

Page 343 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 343 · click to enlarge
Page 343

VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)

User-specified comment to be included in a system log message when the number of media in the MediaClass group exceeds the high mark threshold. The MediaClass name, fill level, high mark threshold, and capacity values are automatically included in the system log message and need not be included in VSID_NOTIFY_COMMENT.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, the RPC procedure number of the “listening task.” Otherwise, VSID_PROCEDURE_NUMBER is not applicable.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, the RPC program number of the client process to receive MediaClass notification messages. If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_NONE or VSE_CLASS_RPC_ENTERPRISE, VSID_PROGRAM_NUMBER is not applicable.

VSID_PROTOCOL (VST_PROTOCOL) If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, the Internet protocol to use to return unsolicited callbacks to the client. Valid VSID_PROTOCOL values are enumerated in the vs_types.h file.

VSID_RELEASE_PRIORITY (VST_PRIORITY)

Release priority for this MediaClass group.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

If VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_STANDARD, the RPC version number of the “listening task.” Otherwise, VSID_VERSION_NUMBER is not applicable.

Parameter Type Description

Page 344 of the ADIC 601355 Rev A user manual — Return Values
Page 344 · click to enlarge
Page 344

Return Values VS_MediaClass_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a MediaClass handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_mediaclass_handle 4 * 5 * PURPOSE: 6 * This function tests a mediaclass handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediaclass_handle(void) 14 #else 15 VST_BOOLEAN vst_mediaclass_handle()

Example 1 /****************************************

Page 345 of the ADIC 601355 Rev A user manual — Return Values
Page 345 · click to enlarge
Page 345

16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIACLASS_HANDLE h; 20 VST_MEDIA_CLASS_NAME MediaClass; 21 VST_MEDIA_TYPE_NAME

ReleasePriority; 23 VST_CAPACITY Capacity; 24 VST_FILL_LEVEL FillLevel; 25 VST_CLASS_MOUNT_STATE MountState; 26 VST_HIGH_MARK HighMark; 27 VST_CLASS_RPC_OPTION RPC_Option; 28 VST_HOSTNAME

RPC_HostName; 29 VST_PROGRAM_NUMBER RPC_ProgNum; 30 VST_VERSION_NUMBER RPC_VersNum; 31 VST_PROCEDURE_NUMBER RPC_ProcNum; 32 VST_PROTOCOL

NotifyComment; 35 36 /* create the handle */ 37 h = VS_MediaClass_Create(); 38 if (h != (VST_MEDIACLASS_HANDLE)

NULL) 39 { 40 /* get values from user */ 41 printf(“*** Media Class Handle ***\n”); 42 printf(“Enter mediaclass name ==> “); 43 gets(MediaClass); 44 printf(“Enter media type name ==> “); 45 gets(MediaTypeName);

MediaTypeName; 22 VST_PRIORITY · RPC_Protocol; 33 VST_ENTERPRISE_ID · EnterpriseID; 34 VST_NOTIFY_COMMENT

Page 346 of the ADIC 601355 Rev A user manual — Return Values
Page 346 · click to enlarge
Page 346

46 printf(“Enter release priority ==> “); 47 ReleasePriority = atoi(gets(input)); 48 printf(“Enter capacity ==> “); 49 Capacity = atoi(gets(input)); 50 printf(“Enter fill level ==> “); 51 FillLevel = atoi(gets(input)); 52 printf(“Enter mount state ==> “); 53 MountState = atoi(gets(input)); 54 printf(“Enter high mark ==> “); 55 HighMark = atoi(gets(input)); 56 printf(“Enter class RPC option ==> “); 57 RPC_Option = atoi(gets(input)); 58 printf(“Enter RPC host name ==> “); 59 gets(RPC_HostName); 60 printf(“Enter RPC program number ==> “); 61 RPC_ProgNum = atol(gets(input)); 62 printf(“Enter RPC version number ==> “); 63 RPC_VersNum = atol(gets(input)); 64 printf(“Enter RPC procedure number ==> “); 65 RPC_ProcNum = atol(gets(input)); 66 printf(“Enter RPC protocol ==> “); 67 RPC_Protocol = atoi(gets(input)); 68 printf(“Enter enterprise id ==> “); 69 EnterpriseID = atol(gets(input)); 70 printf(“Enter notify comment ==> “); 71 gets(NotifyComment); 72 /* set the fields */ 73 rc = VS_MediaClass_SetFields(h, 74 VSID_MEDIA_CLASS_NAME, MediaClass, 75 VSID_MEDIA_TYPE_NAME, MediaTypeName,

Page 347 of the ADIC 601355 Rev A user manual — Return Values
Page 347 · click to enlarge
Page 347

76 VSID_RELEASE_PRIORITY, ReleasePriority, 77 VSID_CAPACITY, Capacity, 78 VSID_FILL_LEVEL, FillLevel, 79 VSID_CLASS_MOUNT_STATE, MountState, 80 VSID_HIGH_MARK, HighMark, 81 VSID_CLASS_RPC_OPTION, RPC_Option, 82 VSID_HOST_NAME, RPC_HostName, 83 VSID_PROGRAM_NUMBER, RPC_ProgNum, 84 VSID_VERSION_NUMBER, RPC_VersNum, 85 VSID_PROCEDURE_NUMBER, RPC_ProcNum, 86 VSID_PROTOCOL, RPC_Protocol, 87 VSID_ENTERPRISE_ID, EnterpriseID, 88 VSID_NOTIFY_COMMENT, NotifyComment, 89 VSID_ENDFIELD); 90 if (rc) 91 { 92 vst_print_mediaclass(h); 93 } 94 VS_MediaClass_Destroy(h); 95 } 96 return(rc); 97 }

Page 348 of the ADIC 601355 Rev A user manual — Note
Page 348 · click to enlarge
Page 348

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaClass_Create(l),
  • VS_MediaClass_Destroy(l),
  • VS_MediaClass_GetFields(l),
  • VS_Table_Create(l),
  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_SetFields(l)
Page 349 of the ADIC 601355 Rev A user manual — Synopsis VST_MEDIATYPE_HANDLE VS_MediaType_Create (void)
Page 349 · click to enlarge
Page 349

VS_ MediaType_ Create

VS_MediaType_Create allocates a VolServ API media type handle. A media type handle is used to pass media type information to and from VolServ.

Synopsis VST_MEDIATYPE_HANDLE VS_MediaType_Create (void)

Return Values VS_MediaType_Create returns:

  • A media type handle, if one can be allocated
  • NULL, if a media type handle could be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_mediatype_handle 4 * 5 * PURPOSE: 6 * This function tests a mediatype handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Arguments None · Example 1 /**************************************** · vst_mediatype_handle(void) 14 #else

Page 350 of the ADIC 601355 Rev A user manual — VS_ MediaType_ Create
Page 350 · click to enlarge
Page 350

15 VST_BOOLEAN vst_mediatype_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIATYPE_HANDLE h; 20 VST_MEDIA_TYPE_NAME

MediaTypeName; 21 int NumberSides; 22 VST_MEDIA_TYPE_CAPACITY Capacity; 23 24 h = VS_MediaType_Create(); 25 if (h != (VST_MEDIATYPE_HANDLE) NULL) 26 { 27 /* get values from user */ 28 printf(“Enter Media Type Name ==> “); 29 gets(MediaTypeName); 30 printf(“Enter number of sides ==> “); 31 NumberSides = atoi(gets(input)); 32 printf(“Enter media type capacity ==> “); 33 Capacity = atof(gets(input)); 34 rc = VS_MediaType_SetFields(h, 35 VSID_MEDIA_TYPE_NAME, MediaTypeName, 36 VSID_NUMBER_SIDES, NumberSides, 37 VSID_MEDIA_TYPE_CAPACITY, Capacity, 38 VSID_ENDFIELD); 39 if (rc) 40 { 41 vst_print_mediatype(h); 42 } 43 VS_MediaType_Destroy(h); 44 } 45 return(rc); 46 }

Page 351 of the ADIC 601355 Rev A user manual — Notes
Page 351 · click to enlarge
Page 351

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaType_Destroy(l),
  • VS_MediaType_GetFields(l),
  • VS_MediaType_SetFields(l)
Page 352 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_MediaType_Destroy (VST_MEDIATYPE_HANDLE handle)
Page 352 · click to enlarge
Page 352

VS_ MediaType_ Destroy

VS_MediaType_Destroy deallocates a VolServ API media type handle that was allocated with VS_MediaType_Create. A media type handle is used to pass information to and from VolServ.

Synopsis VST_BOOLEAN VS_MediaType_Destroy (VST_MEDIATYPE_HANDLE handle)

Arguments • handle = The media type handle to be destroyed.

Return Values VS_MediaType_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a media type handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_mediatype_handle 4 * 5 * PURPOSE: 6 * This function tests a mediatype handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 353 of the ADIC 601355 Rev A user manual — VS_ MediaType_ Destroy
Page 353 · click to enlarge
Page 353

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediatype_handle(void) 14 #else 15 VST_BOOLEAN vst_mediatype_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIATYPE_HANDLE h; 20 VST_MEDIA_TYPE_NAME

MediaTypeName; 21 int NumberSides; 22 VST_MEDIA_TYPE_CAPACITY Capacity; 23 24 h = VS_MediaType_Create(); 25 if (h != (VST_MEDIATYPE_HANDLE) NULL) 26 { 27 /* get values from user */ 28 printf(“Enter Media Type Name ==> “); 29 gets(MediaTypeName); 30 printf(“Enter number of sides ==> “); 31 NumberSides = atoi(gets(input)); 32 printf(“Enter media type capacity ==> “); 33 Capacity = atof(gets(input)); 34 rc = VS_MediaType_SetFields(h, 35 VSID_MEDIA_TYPE_NAME, MediaTypeName, 36 VSID_NUMBER_SIDES, NumberSides, 37 VSID_MEDIA_TYPE_CAPACITY, Capacity, 38 VSID_ENDFIELD); 39 if (rc) 40 { 41 vst_print_mediatype(h); 42 }

Page 354 of the ADIC 601355 Rev A user manual — Notes
Page 354 · click to enlarge
Page 354

43 VS_MediaType_Destroy(h); 44 } 45 return(rc); 46 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaType_Create(l),
  • VS_MediaType_GetFields(l),
  • VS_MediaType_SetFields(l)
Page 355 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 355 · click to enlarge
Page 355

VS_ MediaType_ GetFields

VS_MediaType_GetFields retrieves information associated with a media type handle. A media type handle is used to pass media type information to and from VolServ.

Synopsis VST_BOOLEAN VS_MediaType_GetFields (VST_MEDIATYPE_HANDLE handle, “…” VSID_ENDFIELD)

Arguments • handle = The media type handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_MEDIA_TYPE_CAPACITY (VST_MEDIA_TYPE_CAPACITY *)

Pointer to the capacity (in megabytes) of a medium belonging to this media type classification.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Pointer to the name of this media type classification. Valid media type names may contain up to 16 alphanumeric characters, including spaces.

Parameters · Parameter Type Description

Page 356 of the ADIC 601355 Rev A user manual — Return Values
Page 356 · click to enlarge
Page 356

VSID_NUMBER_SIDES (int *) Pointer to the number of sides a medium belonging to this media type classification supports.

Return Values VS_MediaType_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a media type handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_mediatype 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a media type handle. 8 * 9 * PARAMETERS: 10 * h : the media type handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C

Parameter Type Description · Example 1 /****************************************

Page 357 of the ADIC 601355 Rev A user manual — Note
Page 357 · click to enlarge
Page 357

vst_print_mediatype(VST_MEDIATYPE _HANDLE h) 15 #else 16 void vst_print_mediatype(h) 17 VST_MEDIATYPE_HANDLE h; 18 #endif 19 { 20 VST_MEDIA_TYPE_NAME

MediaTypeName; 21 int NumberSides; 22 VST_MEDIA_TYPE_CAPACITY Capacity; 23 24 VS_MediaType_GetFields(h, 25 VSID_MEDIA_TYPE_NAME, MediaTypeName, 26 VSID_NUMBER_SIDES, &NumberSides, 27 VSID_MEDIA_TYPE_CAPACITY, &Capacity, 28 VSID_ENDFIELD); 29 printf(“*** Media Type Handle

***\n”); 30 printf(“media type name = %s\n”,

MediaTypeName); 31 printf(“number of sides = %d\n”,

NumberSides); 32 printf(“Capacity = %.2f\n”,

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

14 void · Capacity); 33 }

Page 358 of the ADIC 601355 Rev A user manual — See Also
Page 358 · click to enlarge
Page 358

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaType_Create(l),
  • VS_MediaType_Destroy(l),
  • VS_MediaType_SetFields(l),
  • VSCMD_MediaTypeQuery(l)
Page 359 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 359 · click to enlarge
Page 359

VS_ MediaType_ SetFields

VS_MediaType_SetFields sets the value for one or more fields associated with a media type handle. A media type handle is used to pass media type information to and from VolServ.

Synopsis VST_BOOLEAN VS_MediaType_SetFields (VST_MEDIATYPE_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The media type handle where information is stored or updated.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_MEDIA_TYPE_CAPACITY (VST_MEDIA_TYPE_CAPACITY)

Capacity (in megabytes) of a medium belonging to this media type classification.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Name of this media type classification. Valid media type names may contain up to 16 alphanumeric characters, including spaces. No leading or trailing spaces are permitted.

Parameters · Parameter Type Description

Page 360 of the ADIC 601355 Rev A user manual — Return Values
Page 360 · click to enlarge
Page 360

VSID_NUMBER_SIDES (int) Number of sides a medium belonging to this media type classification supports.

Return Values VS_MediaType_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a media type handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_mediatype_handle 4 * 5 * PURPOSE: 6 * This function tests a mediatype handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Parameter Type Description · Example 1 /****************************************

Page 361 of the ADIC 601355 Rev A user manual — Return Values
Page 361 · click to enlarge
Page 361

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediatype_handle(void) 14 #else 15 VST_BOOLEAN vst_mediatype_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIATYPE_HANDLE h; 20 VST_MEDIA_TYPE_NAME

MediaTypeName; 21 int NumberSides; 22 VST_MEDIA_TYPE_CAPACITY Capacity; 23 24 h = VS_MediaType_Create(); 25 if (h != (VST_MEDIATYPE_HANDLE) NULL) 26 { 27 /* get values from user */ 28 printf(“Enter Media Type Name ==> “); 29 gets(MediaTypeName); 30 printf(“Enter number of sides ==> “); 31 NumberSides = atoi(gets(input)); 32 printf(“Enter media type capacity ==> “); 33 Capacity = atof(gets(input)); 34 rc = VS_MediaType_SetFields(h, 35 VSID_MEDIA_TYPE_NAME, MediaTypeName, 36 VSID_NUMBER_SIDES, NumberSides, 37 VSID_MEDIA_TYPE_CAPACITY, Capacity, 38 VSID_ENDFIELD); 39 if (rc) 40 { 41 vst_print_mediatype(h); 42 }

Page 362 of the ADIC 601355 Rev A user manual — Note
Page 362 · click to enlarge
Page 362

43 VS_MediaType_Destroy(h); 44 } 45 return(rc); 46 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_MediaType_Create(l),
  • VS_MediaType_Destroy(l),
  • VS_MediaType_GetFields(l),
  • VSCMD_MediaTypeQuery(l)
Page 363 of the ADIC 601355 Rev A user manual — Synopsis VST_MOUNT_HANDLE VS_Mount_Create (void)
Page 363 · click to enlarge
Page 363

VS_Mount_ Create

VS_Mount_Create function allocates a VolServ API mount handle. A mount handle is used to pass mount information to and from VolServ.

Synopsis VST_MOUNT_HANDLE VS_Mount_Create (void)

Return Values VS_Mount_Create returns:

  • A mount handle, if one can be allocated.
  • NULL, if the mount handle cannot be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_create_mount_handle 4 * 5 * PURPOSE: 6 * This function creates the mount handle and sets the 7 * values in it according to user input. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_MOUNT_HANDLE

vst_create_mount_handle ( void ) 15 #else

Arguments None · Example 1 /****************************************

Page 364 of the ADIC 601355 Rev A user manual — 16 VST_MOUNT_HANDLE
Page 364 · click to enlarge
Page 364

16 VST_MOUNT_HANDLE

vst_create_mount_handle () 17 #endif 18 { 19 int i; 20 int entry; 21 VST_DRIVE_ID driveid; 22 VST_DRIVE_POOL_NAME

drivepool; 23 VST_MEDIA_ID mediaid; 24 VST_MEDIA_CLASS_NAME

mediaclass; 25 VST_MOUNT_HANDLE mounth; 26 VST_CRITERIAGROUP_HANDLE grouph; 27 28 /* create the handle */ 29 mounth = VS_Mount_Create(); 30 if ( mounth == (VST_MOUNT_HANDLE)

NULL ) 31 { 32 return ( (VST_MOUNT_HANDLE) NULL ); 33 } 34 /* prompt user for values */ 35 printf ( “Mount by (1) Media ID or (2)

Media Class ==> “ ); 36 entry = atoi(gets(input)); 37 38 if ( entry == 1 ) 39 { 40 printf ( “Enter Media ID for mounting ==> “ ); 41 gets(mediaid); 42 VS_Mount_SetFields ( mounth, 43 VSID_MEDIA_ID, mediaid, 44 VSID_ENDFIELD ); 45 } 46 else 47 { 48 printf ( “Enter Media Class for mounting ==> “ ); 49 gets(mediaclass);

Page 365 of the ADIC 601355 Rev A user manual — VS_Mount_ Create
Page 365 · click to enlarge
Page 365

50 VS_Mount_SetFields ( mounth, 51 VSID_MEDIA_CLASS_NAME, mediaclass, 52 VSID_ENDFIELD ); 53 54 printf ( “Reclassify media (1) yes or (2) no ==> “ ); 55 entry = atoi(gets(input)); 56 57 if ( entry == 1 ) 58 { 59 printf ( “Enter Target Media Class ==> “ ); 60 gets(mediaclass); 61 VS_Mount_SetFields( mounth, 62 VSID_TARGET_MEDIA_CLASS_NAME, mediaclass, 63 VSID_ENDFIELD ); 64 } 65 } 66 printf ( “Mount by (1) Drive ID or (2)

Drive Pool ==> “ ); 67 entry = atoi(gets(input)); 68 69 if ( entry == 1 ) 70 { 71 printf ( “Enter Drive ID for mounting ==> “ ); 72 driveid = atoi(gets(input)); 73 VS_Mount_SetFields ( mounth, 74 VSID_DRIVE_ID, driveid, 75 VSID_ENDFIELD ); 76 } 77 else 78 { 79 printf ( “Enter Drive Pool for mount ==> “ ); 80 gets(drivepool); 81 VS_Mount_SetFields ( mounth,

Page 366 of the ADIC 601355 Rev A user manual — Notes
Page 366 · click to enlarge
Page 366

82 VSID_DRIVEPOOL_NAME, drivepool, 83 VSID_ENDFIELD ); 84 } 85 printf ( “Mount by criteria (1) yes

or (2) no ==> “ ); 86 entry = atoi(gets(input)); 87 88 if ( entry == 1 ) 89 { 90 printf ( “Enter number of criteria groups ==> “ ); 91 entry = atoi(gets(input)); 92 93 for ( i = 0 ; i < entry ; i++ ) 94 { 95 /* create a criteria group handle */ 96 grouph = vst_create_mount_criteria(); 97 if ( grouph != (VST_CRITERIAGROUP_HANDLE) NULL ) 98 { 99 VS_Mount_SetFields ( mounth, 100 VSID_CRITERIA_GROUP_HANDLE, i, grouph, 101 VSID_ENDFIELD ); 102 } 103 } 104 } 105 return ( mounth ); 106}

Page 367 of the ADIC 601355 Rev A user manual — See Also
Page 367 · click to enlarge
Page 367

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Mount_Destroy(l),
  • VS_Mount_GetFields(l),
  • VS_Mount_SetFields(l),
  • VSCMD_Mount(l),
  • VSCMD_MultiMount(l)
Page 368 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Mount_Destroy (VST_MOUNT_HANDLE handle)
Page 368 · click to enlarge
Page 368

VS_Mount_ Destroy

VS_Mount_Destroy deallocates a VolServ mount handle that was allocated with VS_Mount_Create. A mount handle is used to pass mount information to and from VolServ.

Synopsis VST_BOOLEAN VS_Mount_Destroy (VST_MOUNT_HANDLE handle)

Arguments • handle = The mount handle to be destroyed.

Return Values VS_Mount_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a mount handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_multimount_execute 4 * 5 * PURPOSE: 6 * This function will test the VSCMD_Multimount call. 7 * 8 * PARAMETERS: 9 * none 10 11 **************************************** *********/

Example 1 /****************************************

Page 369 of the ADIC 601355 Rev A user manual — VS_Mount_ Destroy
Page 369 · click to enlarge
Page 369

12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_multimount_execute(void) 14 #else 15 VST_BOOLEAN vst_multimount_execute() 16 #endif 17 { 18 int i; 19 int num; 20 VST_BOOLEAN rc = VSE_FALSE; 21 VST_COMMAND_HANDLE cmdh; 22 VST_MOUNT_HANDLE

mounth[VSD_MAX_MOUNT_REQS]; 23 24 /* get parameters from user */ 25 printf(“*** MultiMount Parameters

***\n”); 26 printf(“Enter the number of mount

requests ==> “ ); 27 num = atoi(gets(input)); 28 29 /* loop through the number of mount

request */ 30 for ( i = 0 ; i < num ; i++ ) 31 { 32 /* Create a mount handle. */ 33 /* Each mount handle stores a single mount */ 34 /* request.The MultiMount command accepts */ 35 /* multiple mount requests and executes */ 36 /* them all as one operation.*/ 37 mounth[i] = vst_create_mount_handle(); 38 if ( mounth[i] != (VST_MOUNT_HANDLE) NULL ) 39 { 40 /* add the mount request to the multimount */ 41 /* via the command default function */

Page 370 of the ADIC 601355 Rev A user manual — VS_Mount_ Destroy
Page 370 · click to enlarge
Page 370

42 VSCMD_MultiMount_SetDefaults ( 43 VSID_MOUNT_HANDLE, i, mounth[i], 44 VSID_ENDFIELD ); 45 } 46 else 47 { 48 rc = VSE_FALSE; 49 break; 50 } 51 } 52 53 if ( rc ) 54 { 55 cmdh = VS_Command_Create(); 56 if (cmdh != (VST_COMMAND_HANDLE) NULL) 57 { 58 /* execute the multimount command, note */ 59 /* that all parameters have been set via */ 60 /* default functions if sync, we will */ 61 /* wait for all mounts to complete */ 62 /* if async, we will leave once initial */ 63 /* status has been returned */ 64 rc = VSCMD_MultiMount ( cmdh, 65 VSID_ENDFIELD ); 66 } 67 else 68 { 69 rc = VSE_FALSE; 70 } 71 } 72 73 /* destroy the mount handles that

contain the */ 74 /* individual mount requests. */

Page 371 of the ADIC 601355 Rev A user manual — Notes
Page 371 · click to enlarge
Page 371

75 for ( i = 0 ; i < num ; i++ ) 76 { 77 VS_Mount_Destroy ( mounth[i] ); 78 } 79 return ( rc ); 80 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Mount_Create(l),
  • VS_Mount_GetFields(l),
  • VS_Mount_SetFields(l),
  • VSCMD_Mount(l),
  • VSCMD_MultiMount(l)
Page 372 of the ADIC 601355 Rev A user manual — VSID_DRIVE_SELECT (VST_DRIVE_SELECT *)
Page 372 · click to enlarge
Page 372

VS_ MediaClass_ GetFields

VS_Mount_GetFields retrieves information associated with a mount handle. A mount handle is used to pass mount information to and from VolServ.

Synopsis VST_BOOLEAN VS_Mount_GetFields (VST_MOUNT_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The mount handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CRITERIA_GROUP_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the table of criteria group handles associated with the mount handle.

VSID_DRIVE_SELECT (VST_DRIVE_SELECT *)

Pointer to the type of drive selection (drive identifier or drive pool) to associate with the mount command. Valid VSID_DRIVE_SELECT values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 373 of the ADIC 601355 Rev A user manual — VSID_MOUNT_OPTION (VST_MOUNT_OPTION *)
Page 373 · click to enlarge
Page 373

VSID_DRIVE_ID (VST_DRIVE_ID *) Pointer to the drive identifier to mount when mounting by drive identifier.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Pointer to the name of a drive pool group from which to select a drive when mounting by drive pool group. Valid DrivePool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_DRIVE_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the list of drives to exclude from the given drive pool group when mounting by drive pool group.

VSID_LOCK_ID (VST_LOCK_ID *) Pointer to the lock identifier that is required if a drive is locked.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass name from which a medium is selected to mount. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_ID (VST_MEDIA_ID) Pointer to the identifier of the medium to be mounted.

VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the media identifier list (in table format) from which the medium to be mounted is selected when mounting by media list.

VSID_MEDIA_SELECT (VST_MEDIA_SELECT *)

Pointer to the type of media selection (media identifier, media list, or MediaClass group).

VSID_MOUNT_OPTION (VST_MOUNT_OPTION *)

Pointer to a flag that indicates which mount processing options are in effect for the mount command. Valid VSID_MOUNT_OPTION values are listed in the vs_defs.h file.

Parameter Type Description

Page 374 of the ADIC 601355 Rev A user manual — VSID_TARGET_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 374 · click to enlarge
Page 374

VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION *)

Pointer to a flag that indicates how VolServ is to process a mount request that requires an inter-archive move. Valid VSID_MOVEWAIT_OPTION values are enumerated in the vs_types.h file.

VSID_TARGET_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass name where the mounted media is reclassified if the reclassify option is in effect for the mount command.

Return Values VS_Mount_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a mount handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_mount 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a mount handle. 8 * PARAMETERS: 9 * mounth : the mount handle to print 10 *

Parameter Type Description · Example 1 /****************************************

Page 375 of the ADIC 601355 Rev A user manual — Return Values
Page 375 · click to enlarge
Page 375

11 **************************************** *********/ 12 #ifdef ANSI_C 13 void

vst_print_mount(VST_MOUNT_HANDLE mounth) 14 #else 15 void vst_print_mount(mounth) 16 VST_MOUNT_HANDLE mounth; 17 #endif 18 { 19 int i, size; 20 VST_DRIVE_SELECT

driveselect; 21 VST_DRIVE_ID driveid; 22 VST_DRIVE_POOL_NAME

mediaselect; 24 VST_MEDIA_ID mediaid; 25 VST_MEDIA_CLASS_NAME

targetmediaclass; 27 VST_MOUNT_OPTION mountopt; 28 VST_CRITERIAGROUP_HANDLE grouph; 29 VST_TABLE_HANDLE tableh; 30 31 /* check for a null handle */ 32 if ( mounth == (VST_MOUNT_HANDLE)

NULL ) 33 { 34 printf(“error…mount handle is null\n”); 35 return; 36 } 37 38 VS_Mount_GetFields ( mounth, 39 VSID_DRIVE_SELECT, &driveselect, 40 VSID_MEDIA_SELECT, &mediaselect,

drivepool; 23 VST_MEDIA_SELECT · mediaclass; 26 VST_MEDIA_CLASS_NAME

Page 376 of the ADIC 601355 Rev A user manual — Return Values
Page 376 · click to enlarge
Page 376

41 VSID_MOUNT_OPTION, &mountopt, 42 VSID_ENDFIELD ); 43 44 printf(“**** Mount Handle Values

****\n”); 45 switch ( driveselect ) 46 { 47 case VSE_DRIVE_SELECT_ID: 48 VS_Mount_GetFields ( mounth, 49 VSID_DRIVE_ID, &driveid, 50 VSID_ENDFIELD ); 51 printf ( “Drive ID: %d\n”, driveid ); 52 break; 53 case VSE_DRIVE_SELECT_POOL: 54 VS_Mount_GetFields ( mounth, 55 VSID_DRIVEPOOL_NAME, drivepool, 56 VSID_ENDFIELD ); 57 printf ( “Drive Pool: %s\n”, drivepool ); 58 break; 59 default: 60 printf ( “error…incorrect drive select value\n”); 61 break; 62 } 63 64 switch ( mediaselect ) 65 { 66 case VSE_MEDIA_SELECT_ID: 67 VS_Mount_GetFields ( mounth, 68 VSID_MEDIA_ID, mediaid, 69 VSID_ENDFIELD ); 70 printf ( “Media ID: %s\n”, mediaid ); 71 break; 72 case VSE_MEDIA_SELECT_LIST: 73 printf ( “Media List:\n” );

Page 377 of the ADIC 601355 Rev A user manual — Return Values
Page 377 · click to enlarge
Page 377

74 75 VS_Mount_GetFields ( mounth, 76 VSID_MEDIA_ID_TABLE, &tableh, 77 VSID_ENDFIELD ); 78 79 VS_Table_GetFields ( tableh, 80 VSID_NUMBER_ENTRIES, &size, 81 VSID_ENDFIELD ); 82 83 for ( i = 0 ; i < size ; i++ ) 84 { 85 VS_Table_GetFields ( tableh, 86 VSID_TABLE_ENTRY, i, &mediaid, 87 VSID_ENDFIELD ); 88 89 printf ( “%s”, mediaid ); 90 } 91 break; 92 case VSE_MEDIA_SELECT_CLASS: 93 VS_Mount_GetFields(mounth, 94 VSID_MEDIA_CLASS_NAME, mediaclass, 95 VSID_ENDFIELD); 96 printf( “Media Class: %s\n”, mediaclass); 97 98 if (mountopt & VSD_MOUNT_OPTION_RECLASS) 99 { 100 VS_Mount_GetFields(mounth, 101 VSID_TARGET_MEDIA_CLASS_NAME,

targetmediaclass, 102 VSID_ENDFIELD ); 103 printf(“Target Media Class: %s\n”,

targetmediaclass ); 104 }

Page 378 of the ADIC 601355 Rev A user manual — Return Values
Page 378 · click to enlarge
Page 378
105 break; 106 default107 printf(“error … incorrect media select

value\n”); 108 break; 109 } 110 111 if (mountopt &

VSD_MOUNT_OPTION_CRITERIA) 112 { 113 VS_Mount_GetFields(mounth, 114 VSID_CRITERIA_GROUP_HANDLE_TABLE, &tableh, 115 VSID_ENDFIELD); 116 117 VS_Table_GetFields(tableh, 118 VSID_NUMBER_ENTRIES, &size, 119 VSID_ENDFIELD); 120 121 for (i = 0; i < size; i++) 122 { 123 VS_Table_GetFields(tableh, 124 VSID_TABLE_ENTRY, i, &grouph, 125 VSID_ENDFIELD); 126 127 vst_print_criteria_group(grouph); 128 } 129 } 130 return; 131}

Page 379 of the ADIC 601355 Rev A user manual — Note
Page 379 · click to enlarge
Page 379

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Mount_Create(l),
  • VS_Mount_Destroy(l),
  • VS_Mount_SetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_Mount(l),
  • VSCMD_MultiMount(l)
Page 380 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Mount_SetFields (VST_MOUNT_HANDLE handle, “…”, VSID_ENDFIELD)
Page 380 · click to enlarge
Page 380

VS_Mount_ SetFields

VS_Mount_SetFields sets the value for one or more fields associated with the mount handle. A mount handle is used to pass mount information to and from VolServ.

Synopsis VST_BOOLEAN VS_Mount_SetFields (VST_MOUNT_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The mount handle where information is stored.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CRITERIA_GROUP_HANDLE (int) Number of the specified criteria group. A criteria group number can be 0 through 3, inclusive.

(VST_CRITERIAGROUP_HANDLE) A criteria group to be used by the mount command in selecting media for mounting.

VSID_DRIVE_ID (VST_DRIVE_ID) Drive identifier to mount when mounting by drive identifier. If VSID_DRIVE_ID is specified, VSID_DRIVEPOOL_NAME and VSID_DRIVE_EXCL_LIST cannot be specified.

Parameters · Parameter Type Description

Page 381 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 381 · click to enlarge
Page 381

VSID_DRIVEPOOL_NAME (VS_DRIVE_POOL_NAME)

Drive pool group from which a drive is selected to mount when mounting by drive pool group. If VSID_DRIVEPOOL_NAME is specified, VSID_DRIVE_ID cannot be specified. Valid DrivePool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_DRIVE_EXCL_LIST (int) Number of drives to exclude from the specified drive pool group when mounting by drive pool group.

(VST_DRIVE_ID *) List of drives to exclude from the specified drive pool group when mounting by drive pool group.

VSID_LOCK_ID (VST_LOCK_ID) Lock identifier that is required if a drive is locked.

VSID_MEDIA_ID (VST_MEDIA_ID) Identifier of the medium to be mounted when mounting by medium identifier. If VSID_MEDIA_ID is specified, VSID_MEDIA_CLASS_NAME and VSID_MEDIA_ID_LIST cannot be specified.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Name of the MediaClass group from which a medium is selected to mount when mounting by MediaClass group. If VSID_MEDIA_CLASS_NAME is specified, VSID_MEDIA_ID and VSID_MEDIA_ID_LIST cannot be specified.

VSID_MEDIA_ID_LIST (int) Number of media in the list.

(char *) List of media from which one medium is selected for mounting. If VSID_MEDIA_ID_LIST is specified, VSID_MEDIA_CLASS_NAME and VSID_MEDIA_ID cannot be specified.

Parameter Type Description

Page 382 of the ADIC 601355 Rev A user manual — VSID_TARGET_MEDIA_CLASS_NAME (VST_TARGET_MEDIA_CLASS_NAME)
Page 382 · click to enlarge
Page 382

VSID_MOUNT_OPTION (VST_MOUNT_OPTION)

Flag that indicates which mount processing options are in effect for the mount command. Valid VSID_MOUNT_OPTION values are listed in the vs_defs.h file.

VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)

Flag that indicates how VolServ is to process a mount request that requires an inter-archive move. Valid VSID_MOVEWAIT_OPTION values are enumerated in the vs_types.h file.

VSID_TARGET_MEDIA_CLASS_NAME (VST_TARGET_MEDIA_CLASS_NAME)

Name of the MediaClass group where the mounted medium is reclassified if the reclassify option is in effect for the mount command.

Return Values VS_Mount_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a mount handle.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Parameter Type Description

Page 383 of the ADIC 601355 Rev A user manual — NULL )
Page 383 · click to enlarge
Page 383
  • VSE_ERR_OUTOFRANGE - Specified entry does not exist in the table’s range of values.

********* 2 * 3 * FUNCTION: vst_create_mount_handle 4 * 5 * PURPOSE: 6 * This function creates the mount handle and sets the 7 * values in it according to user input. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_MOUNT_HANDLE

vst_create_mount_handle ( void ) 15 #else 16 VST_MOUNT_HANDLE

vst_create_mount_handle () 17 #endif 18 { 19 int i; 20 int entry; 21 VST_DRIVE_ID driveid; 22 VST_DRIVE_POOL_NAME

drivepool; 23 VST_MEDIA_ID mediaid; 24 VST_MEDIA_CLASS_NAME

mediaclass; 25 VST_MOUNT_HANDLE mounth; 26 VST_CRITERIAGROUP_HANDLE grouph; 27 28 /* create the handle */ 29 mounth = VS_Mount_Create(); 30 if ( mounth == (VST_MOUNT_HANDLE)

NULL )

Example 1 /****************************************

Page 384 of the ADIC 601355 Rev A user manual — Example
Page 384 · click to enlarge
Page 384

31 { 32 return ( (VST_MOUNT_HANDLE) NULL ); 33 } 34 /* prompt user for values */ 35 printf ( “Mount by (1) Media ID or (2)

Media Class ==> “ ); 36 entry = atoi(gets(input)); 37 38 if ( entry == 1 ) 39 { 40 printf ( “Enter Media ID for mounting ==> “ ); 41 gets(mediaid); 42 VS_Mount_SetFields ( mounth, 43 VSID_MEDIA_ID, mediaid, 44 VSID_ENDFIELD ); 45 } 46 else 47 { 48 printf ( “Enter Media Class for mounting ==> “ ); 49 gets(mediaclass); 50 VS_Mount_SetFields ( mounth, 51 VSID_MEDIA_CLASS_NAME, mediaclass, 52 VSID_ENDFIELD ); 53 54 printf ( “Reclassify media (1) yes or (2) no ==> “ ); 55 entry = atoi(gets(input)); 56 57 if ( entry == 1 ) 58 { 59 printf ( “Enter Target Media Class ==> “ ); 60 gets(mediaclass); 61 VS_Mount_SetFields( mounth, 62 VSID_TARGET_MEDIA_CLASS_NAME, mediaclass, 63 VSID_ENDFIELD );

Page 385 of the ADIC 601355 Rev A user manual — Example
Page 385 · click to enlarge
Page 385

64 } 65 } 66 printf ( “Mount by (1) Drive ID or (2)

Drive Pool ==> “ ); 67 entry = atoi(gets(input)); 68 69 if ( entry == 1 ) 70 { 71 printf ( “Enter Drive ID for mounting ==> “ ); 72 driveid = atoi(gets(input)); 73 VS_Mount_SetFields ( mounth, 74 VSID_DRIVE_ID, driveid, 75 VSID_ENDFIELD ); 76 } 77 else 78 { 79 printf ( “Enter Drive Pool for mount ==> “ ); 80 gets(drivepool); 81 VS_Mount_SetFields ( mounth, 82 VSID_DRIVEPOOL_NAME, drivepool, 83 VSID_ENDFIELD ); 84 } 85 printf ( “Mount by criteria (1) yes

or (2) no ==> “ ); 86 entry = atoi(gets(input)); 87 88 if ( entry == 1 ) 89 { 90 printf ( “Enter number of criteria groups ==> “ ); 91 entry = atoi(gets(input)); 92 93 for ( i = 0 ; i < entry ; i++ ) 94 { 95 /* create a criteria group handle */ 96 grouph = vst_create_mount_criteria();

Page 386 of the ADIC 601355 Rev A user manual — Note
Page 386 · click to enlarge
Page 386

97 if ( grouph != (VST_CRITERIAGROUP_HANDLE) NULL ) 98 { 99 VS_Mount_SetFields ( mounth, 100 VSID_CRITERIA_GROUP_HANDLE, i, grouph, 101 VSID_ENDFIELD ); 102 } 103 } 104 } 105 return ( mounth ); 106}

The VSID_CRITERIA_GROUP_HANDLE, VSID_DRIVE_EXCL_LIST, and VSID_MEDIA_ID_LIST parameters require that two arguments be passed instead of one. The first argument passed is the entry number in the appropriate table. The second argument is a pointer to the values for setting.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 387 of the ADIC 601355 Rev A user manual — See Also
Page 387 · click to enlarge
Page 387

See Also • vsapi(l),

  • VS_Mount_Create(l),
  • VS_Mount_Destroy(l),
  • VS_Mount_GetFields(l),
  • VSCMD_Mount(l),
  • VSCMD_MultiMount(l)
Page 388 of the ADIC 601355 Rev A user manual — Synopsis VST_NOTIFY_HANDLE VS_Notify_Create (void)
Page 388 · click to enlarge
Page 388

VS_Notify_ Create

VS_Notify_Create allocates a VolServ API notify handle. A notify handle is used by the API to allow a client to listen for MediaClass notifications.

Synopsis VST_NOTIFY_HANDLE VS_Notify_Create (void)

Return Values VS_Notify_Create returns:

  • A notify handle, if one can be allocated
  • NULL, if a notify handle could not be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation call failed.

********* 2 * 3 * FUNCTION: vst_notify 4 * 5 * PURPOSE: 6 * This routine is used to test the notify loop. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_notify( void ) 14 #else 15 VST_BOOLEAN 16 vst_notify()

Arguments None · Example 1 /****************************************

Page 389 of the ADIC 601355 Rev A user manual — VS_Notify_ Create
Page 389 · click to enlarge
Page 389

17 #endif 18 { 19 VST_BOOLEAN done, rc; 20 int i, count, timeout; 21 unsigned long prognum, versnum, procnum; 22 VST_TIME_OUT t; 23 VST_TABLE_HANDLE table; 24 VST_MEDIA_CLASS_NAME class,

newclass; 25 VST_NOTIFY_HANDLE h; 26 27 rc = VSE_TRUE; 28 done = VSE_FALSE; 29 NumNotifies = 0; 30 31 /* get parameters from user */ 32 printf(“*** Notify Parameters ***\n”

); 33 printf(“Program Number ==> “ ); 34 prognum = (VST_PROGRAM_NUMBER)

atol(gets(input)); 35 36 printf(“Version Number ==> “ ); 37 versnum = (VST_VERSION_NUMBER)

atol(gets(input)); 38 39 printf(“Procedure Number ==> “ ); 40 procnum = (VST_PROCEDURE_NUMBER)

atol(gets(input)); 41 42 printf(“Number of Notifies to listen

==> “ ); 43 count = atoi(gets(input)); 44 45 printf(“Timeout Value ==> “ ); 46 t = atoi(gets(input)); 47 48 printf(“Number of Timeouts to process

==> “ ); 49 timeout = atoi(gets(input));

Page 390 of the ADIC 601355 Rev A user manual — VS_Notify_ Create
Page 390 · click to enlarge
Page 390

50 51 printf(“\nlistening…\n” ); 52 53 /* create the notify handle */ 54 if ( (h = VS_Notify_Create()) !=

(VST_NOTIFY_HANDLE) NULL ) 55 { 56 /* initialize the notify handle */ 57 VS_Notify_SetFields ( h, 58 VSID_PROTOCOL, VSE_PROT_TCP, 59 VSID_PROGRAM_NUMBER, prognum, 60 VSID_VERSION_NUMBER, versnum, 61 VSID_PROCEDURE_NUMBER,procnum, 62 VSID_CLIENT_DISPATCH, vst_notify_dispatch, 63 VSID_TIMEOUT_VALUE, t, 64 VSID_ENDFIELD ); 65 66 done = VSE_FALSE; 67 while ( ! done ) 68 { 69 /* “listen” for callbacks and act on the */ 70 /* error code */ 71 switch ( (i = VS_Notify_Listen( h )) ) 72 { 73 case VSE_ERR_TIMEOUT: 74 printf(“Timed out\n” ); 75 timeout--; 76 break; 77 case VSE_ERR_NONE: 78 /* This is the successful case. */ 79 /* Nothing is printed here because */ 80 /* the notify handle is printed in */ 81 /* vst_notify_dispatch */ 82 break; 83 default:

Page 391 of the ADIC 601355 Rev A user manual — Notes
Page 391 · click to enlarge
Page 391

84 printf(“Select Error %d\n”, i ); 85 rc = VSE_FALSE; 86 done = VSE_TRUE; 87 break; 88 } 89 90 if ( NumNotifies > count ) 91 { 92 printf(“Number of Notifies reached\n” ); 93 done = VSE_TRUE; 94 } 95 96 if ( timeout

Page 392 of the ADIC 601355 Rev A user manual — See Also
Page 392 · click to enlarge
Page 392

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Notify_Destroy(l),
  • VS_Notify_GetFields(l),
  • VS_Notify_Listen(l),
  • VS_Notify_SetFields(l)
Page 393 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Notify_Destroy (VST_NOTIFY_HANDLE notifyhandle)
Page 393 · click to enlarge
Page 393

VS_Notify_ Destroy

VS_Notify_Destroy deallocates a VolServ API notify handle that was allocated with VS_Notify_Create.

Synopsis VST_BOOLEAN VS_Notify_Destroy (VST_NOTIFY_HANDLE notifyhandle)

Arguments • notifyhandle = The notify handle to be destroyed.

Return Values VS_Notify_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a notify handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_notify 4 * 5 * PURPOSE: 6 * This routine is used to test the notify loop. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C

Example 1 /****************************************

Page 394 of the ADIC 601355 Rev A user manual — VS_Notify_ Destroy
Page 394 · click to enlarge
Page 394

13 VST_BOOLEAN vst_notify( void ) 14 #else 15 VST_BOOLEAN 16 vst_notify() 17 #endif 18 { 19 VST_BOOLEAN done, rc; 20 int i, count, timeout; 21 unsigned long prognum, versnum, procnum; 22 VST_TIME_OUT t; 23 VST_TABLE_HANDLE table; 24 VST_MEDIA_CLASS_NAME class,

newclass; 25 VST_NOTIFY_HANDLE h; 26 27 rc = VSE_TRUE; 28 done = VSE_FALSE; 29 NumNotifies = 0; 30 31 /* get parameters from user */ 32 printf(“*** Notify Parameters ***\n”

); 33 printf(“Program Number ==> “ ); 34 prognum = (VST_PROGRAM_NUMBER)

atol(gets(input)); 35 36 printf(“Version Number ==> “ ); 37 versnum = (VST_VERSION_NUMBER)

atol(gets(input)); 38 39 printf(“Procedure Number ==> “ ); 40 procnum = (VST_PROCEDURE_NUMBER)

atol(gets(input)); 41 42 printf(“Number of Notifies to listen

==> “ ); 43 count = atoi(gets(input)); 44 45 printf(“Timeout Value ==> “ ); 46 t = atoi(gets(input));

Page 395 of the ADIC 601355 Rev A user manual — VS_Notify_ Destroy
Page 395 · click to enlarge
Page 395

47 48 printf(“Number of Timeouts to process

==> “ ); 49 timeout = atoi(gets(input)); 50 51 printf(“\nlistening…\n” ); 52 53 /* create the notify handle */ 54 if ( (h = VS_Notify_Create()) !=

(VST_NOTIFY_HANDLE) NULL ) 55 { 56 /* initialize the notify handle */ 57 VS_Notify_SetFields ( h, 58 VSID_PROTOCOL, VSE_PROT_TCP, 59 VSID_PROGRAM_NUMBER, prognum, 60 VSID_VERSION_NUMBER, versnum, 61 VSID_PROCEDURE_NUMBER, procnum, 62 VSID_CLIENT_DISPATCH, vst_notify_dispatch, 63 VSID_TIMEOUT_VALUE, t, 64 VSID_ENDFIELD ); 65 66 done = VSE_FALSE; 67 while ( ! done ) 68 { 69 /* “listen” for callbacks and act on the */ 70 /* error code */ 71 switch ( (i = VS_Notify_Listen( h )) ) 72 { 73 case VSE_ERR_TIMEOUT: 74 printf(“Timed out\n” ); 75 timeout--; 76 break; 77 case VSE_ERR_NONE: 78 /* This is the successful case. */

Page 396 of the ADIC 601355 Rev A user manual — VS_Notify_ Destroy
Page 396 · click to enlarge
Page 396

79 /* Nothing is printed here because */ 80 /* the notify handle is printed in */ 81 /* vst_notify_dispatch */ 82 break; 83 default: 84 printf(“Select Error %d\n”, i ); 85 rc = VSE_FALSE; 86 done = VSE_TRUE; 87 break; 88 } 89 90 if ( NumNotifies > count ) 91 { 92 printf(“Number of Notifies reached\n” ); 93 done = VSE_TRUE; 94 } 95 96 if ( timeout

Page 397 of the ADIC 601355 Rev A user manual — Notes
Page 397 · click to enlarge
Page 397

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Notify_Create(l),
  • VS_Notify_GetFields(l),
  • VS_Notify_Listen(l),
  • VS_Notify_SetFields(l)
Page 398 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 398 · click to enlarge
Page 398

VS_Notify_ GetFields

VS_Notify_GetFields retrieves information associated with a notify handle. A notify handle is used by the API to allow a client to listen for MediaClass notifications.

Synopsis VST_BOOLEAN VS_Notify_GetFields (VST_NOTIFY_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The notify handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the archive name for this callback. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_DRIVE_ID (VST_DRIVEID *) Pointer to the drive identifier for this callback.

VSID_DRIVE_ID_ENTRY (int) Index of a specific entry in the drive identifier table.

Parameters · Parameter Type Description

Page 399 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)
Page 399 · click to enlarge
Page 399

(VST_DRIVE_ID *) Pointer to a specific entry in the drive identifier table.

VSID_DRIVE_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the drive identifiers (in table format) associated with this callback.

VSID_ERROR_HANDLE (VST_ERROR_HANDLE *)

Pointer to the error handle for this callback.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass name for this callback.

VSID_MEDIA_ID (VST_MEDIA_ID) Pointer to the media identifier for this callback.

VSID_MEDIA_ID_ENTRY (int) Number of media in the media identifier table.

(VST_MEDIA_ID *) Pointer to the media identifier table.

VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the media identifiers (in table format) associated with this callback.

VSID_NOTIFY_TYPE (VST_NOTIFY_TYPE *)

Pointer to the type of VolServ command that generated this callback. Valid VSID_NOTIFY_TYPE values are enumerated in the vs_types.h file.

VSID_NUMBER_DRIVE_IDS (int *) Pointer to the number of drive ids present in the drive id table.

VSID_NUMBER_MEDIA_IDS (int *) Pointer to the number of media ids present in the media id table.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER *)

Pointer to the RPC procedure number of the client process to receive callbacks generated for this MediaClass group.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER *)

Pointer to the RPC program number of the client process to receive MediaClass callbacks.

Parameter Type Description

Page 400 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER *)
Page 400 · click to enlarge
Page 400

VSID_PROTOCOL (VST_PROTOCOL *) Pointer to the RPC protocol the API should use for callbacks. Valid VSID_PROTOCOL values for this field are enumerated in the vs_types.h file.

VSID_STATUS_CODE (VST_STATUS_CODE *)

Pointer to the status code stating whether the enter or eject passed or failed. VSID_STATUS_CODE is returned only for enter and eject callbacks.

VSID_TARGET_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the target MediaClass name for this callback.

VSID_TIMEOUT_VALUE (VST_TIME_OUT *) Pointer to the amount of time (in seconds) the API software is to wait for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER *)

Pointer to the RPC version number the API should use to receive callbacks.

Return Values VS_Notify_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a notify handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 401 of the ADIC 601355 Rev A user manual — Example
Page 401 · click to enlarge
Page 401

********* 2 * 3 * FUNCTION: vst_notify_dispatch 4 * 5 * PURPOSE: 6 * This is the dispatch routine used to test the 7 * notify loop. 8 * 9 * PARAMETERS: 10 * h : the notify handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 int vst_notify_dispatch ( VST_NOTIFY_HANDLE h ) 15 #else 16 int vst_notify_dispatch ( h ) 17 VST_NOTIFY_HANDLE h; 18 #endif 19 { 20 int i, n; 21 VST_ARCHIVE_NAME archive; 22 VST_DRIVE_ID * did; 23 char * mid; 24 VST_MEDIA_CLASS_NAME class, newclass; 25 VST_NOTIFY_TYPE type; 26 VST_ERROR_HANDLE eh; 27 VST_TABLE_HANDLE dt, mt; 28 VST_STATUS_CODE sc; 29 30 /* increment a counter for the number

of */ 31 /* notifies processed */ 32 NumNotifies++; 33 /* initialize values in the notify

handle. */ 34 VS_Notify_GetFields ( h,

Example 1 /****************************************

Page 402 of the ADIC 601355 Rev A user manual — Example
Page 402 · click to enlarge
Page 402

35 VSID_NOTIFY_TYPE, &type, 36 VSID_ARCHIVE_NAME, archive, 37 VSID_MEDIA_CLASS_NAME, class, 38 VSID_TARGET_MEDIA_CLASS_NAME, newclass, 39 VSID_DRIVE_ID_TABLE, &dt, 40 VSID_MEDIA_ID_TABLE, &mt, 41 VSID_ERROR_HANDLE, &eh, 42 VSID_ENDFIELD ); 43 44 printf(“***************** Notify

Handle Information *************\\pn” ); 45 printf(“Notify Type = %d\n”, type ); 46 if ((type == VSE_NOTIFY_EJECT) ||

(type == VSE_NOTIFY_ENTER)) 47 { 48 VS_Notify_GetFields ( h, 49 VSID_STATUS_CODE, &sc, 50 VSID_ENDFIELD ); 51 if (sc == VSE_STATUS_OK) 52 printf(“Successful\n”); 53 else 54 printf(“Failure\n”); 55 } 56 printf(“Archive Name = %s\n”, archive

); 57 printf(“Media Class = %s\n”, class ); 58 switch(type) 59 { 60 case VSE_NOTIFY_IMPORT: 61 case VSE_NOTIFY_EXPORT: 62 case VSE_NOTIFY_ENTER:

Page 403 of the ADIC 601355 Rev A user manual — Example
Page 403 · click to enlarge
Page 403

63 case VSE_NOTIFY_EJECT: 64 case VSE_NOTIFY_CHECKIN: 65 case VSE_NOTIFY_CHECKOUT: 66 case VSE_NOTIFY_RECLASSIFY: 67 /* media callbacks */ 68 /* -- print the media table */ 69 if (type == VSE_NOTIFY_RECLASSIFY) 70 { 71 printf(“New Media Class = %s\n”, newclass); 72 } 73 if ( mt != (VST_TABLE_HANDLE) NULL ) 74 { 75 VS_Table_GetFields ( mt, 76 VSID_NUMBER_ENTRIES, &n, 77 VSID_ENDFIELD ); 78 for ( i = 0 ; i < n ; i++ ) 79 { 80 VS_Table_GetFields ( mt, 81 VSID_TABLE_ENTRY, i, &mid, 82 VSID_ENDFIELD ); 83 printf(“Media ID Entry # %d = %s\n“, i, mid ); 84 } 85 } 86 break; 87 case VSE_NOTIFY_MOUNT: 88 case VSE_NOTIFY_DISMOUNT: 89 /* print the drive and media id */ 90 VS_Notify_GetFields(h, 91 VSID_MEDIA_ID, mid, 92 VSID_DRIVE_ID, &did,

Page 404 of the ADIC 601355 Rev A user manual — Note
Page 404 · click to enlarge
Page 404

93 VSID_ENDFIELD); 94 printf(“media id = %s\n”, mid); 95 printf(“drive id = %d\n”, did); 96 break; 97 default: 98 break; 99 } 100 /* print the error handle */ 101 vst_print_error ( eh ); 102}

After the client receives a MediaClass notification from VS_Notify_Listen, the Notify handle contains the notify information. To determine the Notify type, the client then retrieves the relevant information from the Notify handle (i.e., for a Mount notification, the media identifier and drive identifier must be retrieved).

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 405 of the ADIC 601355 Rev A user manual — See Also
Page 405 · click to enlarge
Page 405

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Notify_Create(l),
  • VS_Notify_Destroy(l),
  • VS_Notify_Listen (l),
  • VS_Notify_SetFields(l),
  • VS_Table_GetFields(l)
Page 406 of the ADIC 601355 Rev A user manual — Synopsis int VS_Notify_Listen (VST_NOTIFY_HANDLE handle)
Page 406 · click to enlarge
Page 406

VS_Notify_ Listen

VS_Notify_Listen listens for MediaClass callbacks from VolServ.

Client registers a notify dispatch routine with the API using either the VS_Global_SetFields or the VS_Notify_SetFields function. Client is then responsible for putting the API into a “listening” state by calling VS_Notify_Listen. VS_Notify_Listen terminates either after receiving a MediaClass callback and notifying the client’s notify dispatch routine or after timing out.

Synopsis int VS_Notify_Listen (VST_NOTIFY_HANDLE handle)

Arguments • handle = The notify handle used to listen for MediaClass callbacks.

Return Values VS_Notify_Listen returns:

  • VSE_ERR_BADHANDLE - Specified handle was not a notify handle.
  • VSE_ERR_NONE - Successfully received and processed a callback.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLHANDLE - Specified handle was a null handle.
  • VSE_ERR_SELECT - An error occurred during a select system call.
  • VSE_ERR_SIGNAL - A select system call was interrupted by a signal.
Page 407 of the ADIC 601355 Rev A user manual — Example
Page 407 · click to enlarge
Page 407
  • VSE_ERR_TIMEOUT - The VolServ API timed out waiting for MediaClass callbacks from VolServ.

********* 2 * 3 * FUNCTION: vst_notify 4 * 5 * PURPOSE: 6 * This routine is used to test the notify loop. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_notify( void ) 14 #else 15 VST_BOOLEAN 16 vst_notify() 17 #endif 18 { 19 VST_BOOLEAN done, rc; 20 int i, count, timeout; 21 unsigned long prognum, versnum, procnum; 22 VST_TIME_OUT t; 23 VST_TABLE_HANDLE table; 24 VST_MEDIA_CLASS_NAME class,

newclass; 25 VST_NOTIFY_HANDLE h; 26 27 rc = VSE_TRUE; 28 done = VSE_FALSE; 29 NumNotifies = 0; 30 31 /* get parameters from user */

Example 1 /****************************************

Page 408 of the ADIC 601355 Rev A user manual — Example
Page 408 · click to enlarge
Page 408

32 printf(“*** Notify Parameters ***\n”

); 33 printf(“Program Number ==> “ ); 34 prognum = (VST_PROGRAM_NUMBER)

atol(gets(input)); 35 36 printf(“Version Number ==> “ ); 37 versnum = (VST_VERSION_NUMBER)

atol(gets(input)); 38 39 printf(“Procedure Number ==> “ ); 40 procnum = (VST_PROCEDURE_NUMBER)

atol(gets(input)); 41 42 printf(“Number of Notifies to listen

==> “ ); 43 count = atoi(gets(input)); 44 45 printf(“Timeout Value ==> “ ); 46 t = atoi(gets(input)); 47 48 printf(“Number of Timeouts to process

==> “ ); 49 timeout = atoi(gets(input)); 50 51 printf(“\nlistening…\n” ); 52 53 /* create the notify handle */ 54 if ( (h = VS_Notify_Create()) !=

(VST_NOTIFY_HANDLE) NULL ) 55 { 56 /* initialize the notify handle */ 57 VS_Notify_SetFields ( h, 58 VSID_PROTOCOL, VSE_PROT_TCP, 59 VSID_PROGRAM_NUMBER, prognum, 60 VSID_VERSION_NUMBER, versnum, 61 VSID_PROCEDURE_NUMBER, procnum, 62 VSID_CLIENT_DISPATCH, vst_notify_dispatch, 63 VSID_TIMEOUT_VALUE, t,

Page 409 of the ADIC 601355 Rev A user manual — Example
Page 409 · click to enlarge
Page 409

64 VSID_ENDFIELD ); 65 66 done = VSE_FALSE; 67 while ( ! done ) 68 { 69 /* “listen” for callbacks and act on the */ 70 /* error code */ 71 switch ( (i = VS_Notify_Listen( h )) ) 72 { 73 case VSE_ERR_TIMEOUT: 74 printf(“Timed out\n” ); 75 timeout--; 76 break; 77 case VSE_ERR_NONE: 78 /* This is the successful case. */ 79 /* Nothing is printed here because */ 80 /* the notify handle is printed in */ 81 /* vst_notify_dispatch */ 82 break; 83 default: 84 printf(“Select Error %d\n”, i ); 85 rc = VSE_FALSE; 86 done = VSE_TRUE; 87 break; 88 } 89 90 if ( NumNotifies > count ) 91 { 92 printf(“Number of Notifies reached\n” ); 93 done = VSE_TRUE; 94 } 95 96 if ( timeout

Page 410 of the ADIC 601355 Rev A user manual — Notes
Page 410 · click to enlarge
Page 410

98 printf(“Timeout value reached\n” ); 99 done = VSE_TRUE; 100 } 101 } 102 103 /* destroy the notify handle */ 104 VS_Notify_Destroy ( h ); 105 } 106 else 107 { 108 rc = VSE_FALSE; 109 } 110 111 return ( rc ); 112}

If a VSE_ERR_SIGNAL is returned, any client error handling routines that have been installed for that signal have been called.

VS_Notify_Listen returns error codes instead of the normal VST_BOOLEAN values (VSE_TRUE, VSE_FALSE). This simplifies client code when performing asynchronous processing. Client can use the “switch” statement on the return code directly from the routine without having to retrieve error codes.

Page 411 of the ADIC 601355 Rev A user manual — See Also
Page 411 · click to enlarge
Page 411

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Notify_Create(l),
  • VS_Notify_Destroy(l),
  • VS_Notify_GetFields(l),
  • VS_Notify_SetFields(l)
Page 412 of the ADIC 601355 Rev A user manual — VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)
Page 412 · click to enlarge
Page 412

VS_Notify_ SetFields

VS_Notify_SetFields sets the value of one or more fields in a notify handle. A notify handle is used to pass notify information to and from VolServ.

Synopsis VST_BOOLEAN VS_Notify_SetFields (VST_NOTIFY_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The notify handle where information is stored or updated.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_NOTIFY_DISPATCH (VST_NOTIFY_DISPATCH)

Function in the client’s program that the VolServ API calls when a MediaClass callback is received.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

RPC procedure number of the client process that the VolServ API calls when a MediaClass callback is received.

Parameters · Parameter Type Description

Page 413 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 413 · click to enlarge
Page 413

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number of the client process that the VolServ API calls when a MediaClass callback is received. If VSID_PROGRAM_NUMBER is not specified, the program number defaults to 0. When VSID_PROGRAM_NUMBER is allowed to default to 0, the API software obtains a transient RPC number.

VSID_PROTOCOL (VST_PROTOCOL) RPC protocol that the VolServ API uses for callbacks. The default VSID_PROTOCOL is VSE_PROT_TCP.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) that the VolServ API waits for a MediaClass callback from VolServ before timing out.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

RPC version number of the client process that the VolServ API calls when a MediaClass callback is received.

Return Values VS_Notify_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a notify handle.
  • VSE_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 414 of the ADIC 601355 Rev A user manual — Example
Page 414 · click to enlarge
Page 414
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_notify 4 * 5 * PURPOSE: 6 * This routine is used to test the notify loop. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_notify( void ) 14 #else 15 VST_BOOLEAN 16 vst_notify() 17 #endif 18 { 19 VST_BOOLEAN done, rc; 20 int i, count, timeout; 21 unsigned long prognum, versnum, procnum; 22 VST_TIME_OUT t; 23 VST_TABLE_HANDLE table; 24 VST_MEDIA_CLASS_NAME class,

newclass; 25 VST_NOTIFY_HANDLE h; 26 27 rc = VSE_TRUE; 28 done = VSE_FALSE; 29 NumNotifies = 0; 30 31 /* get parameters from user */

Example 1 /****************************************

Page 415 of the ADIC 601355 Rev A user manual — Example
Page 415 · click to enlarge
Page 415

32 printf(“*** Notify Parameters ***\n”

); 33 printf(“Program Number ==> “ ); 34 prognum = (VST_PROGRAM_NUMBER)

atol(gets(input)); 35 36 printf(“Version Number ==> “ ); 37 versnum = (VST_VERSION_NUMBER)

atol(gets(input)); 38 39 printf(“Procedure Number ==> “ ); 40 procnum = (VST_PROCEDURE_NUMBER)

atol(gets(input)); 41 42 printf(“Number of Notifies to listen

==> “ ); 43 count = atoi(gets(input)); 44 45 printf(“Timeout Value ==> “ ); 46 t = atoi(gets(input)); 47 48 printf(“Number of Timeouts to process

==> “ ); 49 timeout = atoi(gets(input)); 50 51 printf(“\nlistening…\n” ); 52 53 /* create the notify handle */ 54 if ( (h = VS_Notify_Create()) !=

(VST_NOTIFY_HANDLE) NULL ) 55 { 56 /* initialize the notify handle */ 57 VS_Notify_SetFields ( h, 58 VSID_PROTOCOL, VSE_PROT_TCP, 59 VSID_PROGRAM_NUMBER, prognum, 60 VSID_VERSION_NUMBER, versnum, 61 VSID_PROCEDURE_NUMBER, procnum, 62 VSID_CLIENT_DISPATCH, vst_notify_dispatch,

Page 416 of the ADIC 601355 Rev A user manual — Example
Page 416 · click to enlarge
Page 416

63 VSID_TIMEOUT_VALUE, t, 64 VSID_ENDFIELD ); 65 66 done = VSE_FALSE; 67 while ( ! done ) 68 { 69 /* “listen” for callbacks and act on the */ 70 /* error code */ 71 switch ( (i = VS_Notify_Listen( h )) ) 72 { 73 case VSE_ERR_TIMEOUT: 74 printf(“Timed out\n” ); 75 timeout--; 76 break; 77 case VSE_ERR_NONE: 78 /* This is the successful case. */ 79 /* Nothing is printed here because */ 80 /* the notify handle is printed in */ 81 /* vst_notify_dispatch */ 82 break; 83 default: 84 printf(“Select Error %d\n”, i ); 85 rc = VSE_FALSE; 86 done = VSE_TRUE; 87 break; 88 } 89 90 if ( NumNotifies > count ) 91 { 92 printf(“Number of Notifies reached\n” ); 93 done = VSE_TRUE; 94 } 95 96 if ( timeout

Page 417 of the ADIC 601355 Rev A user manual — Note
Page 417 · click to enlarge
Page 417

97 { 98 printf(“Timeout value reached\n” ); 99 done = VSE_TRUE; 100 } 101 } 102 103 /* destroy the notify handle */ 104 VS_Notify_Destroy ( h ); 105 } 106 else 107 { 108 rc = VSE_FALSE; 109 } 110 111 return ( rc ); 112}

void NotifyClientDispatch (VST_NOTIFY_HANDLE handle)

RPC information (protocol, program, procedure, and version) must be set to match the callback information for the MediaClass group the user wants to monitor.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 418 of the ADIC 601355 Rev A user manual — See Also
Page 418 · click to enlarge
Page 418

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Notify_Create(l),
  • VS_Notify_Destroy(l),
  • VS_Notify_GetFields(l),
  • VS_Notify_Listen(l)
Page 419 of the ADIC 601355 Rev A user manual — Synopsis VST_REQUEST_HANDLE VS_Request_Create (void)
Page 419 · click to enlarge
Page 419

VS_Request_ Create

VS_Request_Create allocates a VolServ API request handle. A request handle is used to pass request information to and from VolServ.

Synopsis VST_REQUEST_HANDLE VS_Request_Create (void)

Return Values VS_Request_Create returns:

  • A request handle, if one can be allocated.
  • NULL, if a request handle could not be allocated An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_request_handle 4 * 5 * PURPOSE: 6 * This function tests a request handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_request_handle(void) 14 #else 15 VST_BOOLEAN vst_request_handle() 16 #endif 17 {

Arguments None · Example 1 /****************************************

Page 420 of the ADIC 601355 Rev A user manual — VS_Request_ Create
Page 420 · click to enlarge
Page 420

18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_REQUEST_HANDLE h; 20 VST_REQUEST_ID RequestID; 21 VST_REQUEST_TYPE RequestType; 22 VST_REQUEST_STATE State; 23 VST_PRIORITY Priority; 24 25 /* create the handle */ 26 h = VS_Request_Create(); 27 if (h != (VST_REQUEST_HANDLE) NULL) 28 { 29 /* get values from user */ 30 printf(“*** Request Handle ***\n”); 31 printf(“Enter request id ==> “); 32 RequestID = atol(gets(input)); 33 printf(“Enter request type ==> “); 34 RequestType = atoi(gets(input)); 35 printf(“Enter request state ==> “); 36 State = atoi(gets(input)); 37 printf(“Enter Priority ==> “); 38 Priority = atoi(gets(input)); 39 /* set the fields */ 40 rc = VS_Request_SetFields(h, 41 VSID_REQUEST_ID, RequestID, 42 VSID_REQUEST_TYPE, RequestType, 43 VSID_REQUEST_STATE, State, 44 VSID_PRIORITY, Priority, 45 VSID_ENDFIELD); 46 if (rc) 47 { 48 vst_print_request(h); 49 } 50 VS_Request_Destroy(h); 51 } 52 return(rc); 53 }

Page 421 of the ADIC 601355 Rev A user manual — Notes
Page 421 · click to enlarge
Page 421

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Request_Destroy(l),
  • VS_Request_GetFields(l),
  • VS_Request_SetFields(l)
Page 422 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Request_Destroy (VST_REQUEST_HANDLE handle)
Page 422 · click to enlarge
Page 422

VS_Request_ Destroy

VS_Request_Destroy deallocates a VolServ API request handle that was allocated with VS_Request_Create. A request handle is used to pass request information to and from VolServ.

Synopsis VST_BOOLEAN VS_Request_Destroy (VST_REQUEST_HANDLE handle)

Arguments • handle = The request handle to be destroyed.

Return Values VS_Request_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a request handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_request_handle 4 * 5 * PURPOSE: 6 * This function tests a request handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 423 of the ADIC 601355 Rev A user manual — VS_Request_ Destroy
Page 423 · click to enlarge
Page 423

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_request_handle(void) 14 #else 15 VST_BOOLEAN vst_request_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_REQUEST_HANDLE h; 20 VST_REQUEST_ID RequestID; 21 VST_REQUEST_TYPE RequestType; 22 VST_REQUEST_STATE State; 23 VST_PRIORITY Priority; 24 25 /* create the handle */ 26 h = VS_Request_Create(); 27 if (h != (VST_REQUEST_HANDLE) NULL) 28 { 29 /* get values from user */ 30 printf(“*** Request Handle ***\n”); 31 printf(“Enter request id ==> “); 32 RequestID = atol(gets(input)); 33 printf(“Enter request type ==> “); 34 RequestType = atoi(gets(input)); 35 printf(“Enter request state ==> “); 36 State = atoi(gets(input)); 37 printf(“Enter Priority ==> “); 38 Priority = atoi(gets(input)); 39 /* set the fields */ 40 rc = VS_Request_SetFields(h, 41 VSID_REQUEST_ID, RequestID, 42 VSID_REQUEST_TYPE, RequestType, 43 VSID_REQUEST_STATE, State, 44 VSID_PRIORITY, Priority, 45 VSID_ENDFIELD);

Page 424 of the ADIC 601355 Rev A user manual — Notes
Page 424 · click to enlarge
Page 424

46 if (rc) 47 { 48 vst_print_request(h); 49 } 50 VS_Request_Destroy(h); 51 } 52 return(rc); 53 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Request_Create(l),
  • VS_Request_GetFields(l),
  • VS_Request_SetFields(l)
Page 425 of the ADIC 601355 Rev A user manual — VSID_REQUEST_STATE (VST_REQUEST_STATE *)
Page 425 · click to enlarge
Page 425

VS_Request_ GetFields

VS_Request_GetFields retrieves information associated with a request handle. A request handle is used to pass request information to and from VolServ.

Synopsis VST_BOOLEAN VS_Request_GetFields (VST_REQUEST_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The request handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_PRIORITY (VST_PRIORITY *) Pointer to the execution priority of this request.

VSID_REQUEST_ID (VST_REQUEST_ID *) Pointer to the request identifier associated with the indicated request handle.

VSID_REQUEST_STATE (VST_REQUEST_STATE *)

Pointer to the execution state of the request. Valid VSID_REQUEST_STATE values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 426 of the ADIC 601355 Rev A user manual — VSID_REQUEST_TYPE (VST_REQUEST_TYPE *)
Page 426 · click to enlarge
Page 426

VSID_REQUEST_TYPE (VST_REQUEST_TYPE *)

Pointer to the request type of the request. Valid VSID_REQUEST_TYPE values are enumerated in the vs_types.h file.

VSID_TIME (VST_TIME *) Pointer to the arrival time of the request.

Return Values VS_Request_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a request handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_print_request 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a request handle. 8 * 9 * PARAMETERS: 10 * h : the request handle to print 11 * 12 **************************************** *********/

Parameter Type Description · Example 1 /****************************************

Page 427 of the ADIC 601355 Rev A user manual — Return Values
Page 427 · click to enlarge
Page 427

13 #ifdef ANSI_C 14 void

vst_print_request(VST_REQUEST_HAN DLE h) 15 #else 16 void vst_print_request(h) 17 VST_REQUEST_HANDLE h; 18 #endif 19 { 20 VST_REQUEST_ID RequestID; 21 VST_REQUEST_TYPE RequestType; 22 VST_TIME InTime; 23 VST_REQUEST_STATE State; 24 VST_PRIORITY Priority; 25 26 VS_Request_GetFields(h, 27 VSID_REQUEST_ID, &RequestID, 28 VSID_REQUEST_TYPE, &RequestType, 29 VSID_TIME, &InTime, 30 VSID_REQUEST_STATE, &State, 31 VSID_PRIORITY, &Priority, 32 VSID_ENDFIELD); 33 printf(“******Request

Handle******\n”); 34 printf(“Request ID = %d\n”,

RequestID); 35 printf(“Request Type = %d\n”,

RequestType); 36 printf(“Time = %s”, ctime((time_t *)

&InTime)); 37 printf(“Request state = %d\n”,

State); 38 printf(“Priority = %d\n”, Priority); 39 }

Page 428 of the ADIC 601355 Rev A user manual — Note
Page 428 · click to enlarge
Page 428

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Request_Create(l),
  • VS_Request_Destroy(l),
  • VS_Request_SetFields(l),
  • VSCMD_RequestQuery(l)
Page 429 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Request_SetFields (VST_REQUEST_HANDLE handle, “…”, VSID_ENDFIELD)
Page 429 · click to enlarge
Page 429

VS_Request_ SetFields

VS_Request_SetFields sets the value of one or more fields in a request handle. A request handle is used to pass request information to and from VolServ.

Synopsis VST_BOOLEAN VS_Request_SetFields (VST_REQUEST_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The request handle where information is stored or updated.

  • “…” = Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 430 of the ADIC 601355 Rev A user manual — VSID_REQUEST_TYPE (VST_RQUEST_TYPE)
Page 430 · click to enlarge
Page 430

VSID_REQUEST_ID (VST_REQUEST_ID) Identifier of the request (assigned by VolServ) associated with the specified request handle.

A valid request identifier must be specified in the yyyyddmm format where yyyy represents the year, dd represents the day, and mm is a month.

VSID_REQUEST_STATE (VST_REQUEST_STATE)

The execution state of the request. Valid VSID_REQUEST_STATE values are enumerated in the vs_types.h file.

VSID_REQUEST_TYPE (VST_RQUEST_TYPE)

The request type to be associated with the request handle. Valid VSID_REQUEST_TYPE values are enumerated in the vs_types.h file.

VSID_TIME (VST_TIME) Arrival time of the request.

Return Values VS_Request_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_FIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a request handle.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Parameter Type Description

Page 431 of the ADIC 601355 Rev A user manual — Example
Page 431 · click to enlarge
Page 431

********* 2 * 3 * FUNCTION: vst_request_handle 4 * 5 * PURPOSE: 6 * This function tests a request handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_request_handle(void) 14 #else 15 VST_BOOLEAN vst_request_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_REQUEST_HANDLE h; 20 VST_REQUEST_ID RequestID; 21 VST_REQUEST_TYPE RequestType; 22 VST_REQUEST_STATE State; 23 VST_PRIORITY Priority; 24 25 /* create the handle */ 26 h = VS_Request_Create(); 27 if (h != (VST_REQUEST_HANDLE) NULL) 28 { 29 /* get values from user */ 30 printf(“*** Request Handle ***\n”); 31 printf(“Enter request id ==> “); 32 RequestID = atol(gets(input)); 33 printf(“Enter request type ==> “); 34 RequestType = atoi(gets(input)); 35 printf(“Enter request state ==> “); 36 State = atoi(gets(input)); 37 printf(“Enter Priority ==> “); 38 Priority = atoi(gets(input));

Example 1 /****************************************

Page 432 of the ADIC 601355 Rev A user manual — Note
Page 432 · click to enlarge
Page 432

39 /* set the fields */ 40 rc = VS_Request_SetFields(h, 41 VSID_REQUEST_ID, RequestID, 42 VSID_REQUEST_TYPE, RequestType, 43 VSID_REQUEST_STATE, State, 44 VSID_PRIORITY, Priority, 45 VSID_ENDFIELD); 46 if (rc) 47 { 48 vst_print_request(h); 49 } 50 VS_Request_Destroy(h); 51 } 52 return(rc); 53 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Request_Create(l),
  • S_Request_Destroy(l),
  • VS_Request_GetFields(l)
Page 433 of the ADIC 601355 Rev A user manual — Synopsis int VS_Select (void)
Page 433 · click to enlarge
Page 433

VS_Select VS_Select requests the VolServ API to wait for command status from VolServ when the API in operating in asynchronous mode.

In asynchronous mode, the client issues a VolServ command through the API, immediately receives initial status for the command, issues VS_Select to request that the API wait for intermediate and/or final status, and continues processing. When the API receives intermediate or final status from VolServ, it calls the specified client dispatch routine to process the status and the outstanding VS_Select function terminates. It is the client’s responsibility to issue the VS_Select for each intermediate and final status expected for a command.

Synopsis int VS_Select (void)

Return Values VS_Select returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_NONE - Successfully received and processed status.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_SELECT - An error occurred during a select system call.

Arguments None

Page 434 of the ADIC 601355 Rev A user manual — Example
Page 434 · click to enlarge
Page 434
  • VSE_ERR_SIGNAL - A select system call was interrupted by a signal.
  • VSE_ERR_TIMEOUT - The VolServ API timed out waiting for status from VolServ.

********* 2 * 3 * FUNCTION: vst_select 4 * 5 * PURPOSE: 6 * This function tests the VS_Select loop. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_select ( void ) 14 #else 15 VST_BOOLEAN vst_select () 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 int errcode; 20 21 errcode = VS_Select(); 22 switch (errcode) 23 { 24 case VSE_ERR_NONE: 25 printf(“*** No Error -- Successful Operation ***\n“); 26 rc = VSE_TRUE; 27 break; 28 case VSE_ERR_TIMEOUT: 29 printf(“*** Select Timed Out ***\n”); 30 break;

Example 1 /****************************************

Page 435 of the ADIC 601355 Rev A user manual — Notes
Page 435 · click to enlarge
Page 435

31 default: 32 printf(“*** A Select Error Occurred ***\n”); 33 break; 34 } 35 return(rc); 36 }

VS_Select is used only when the API is operating in asynchronous mode. Therefore, clients that use synchronous processing do not use the VS_Select routine.

The VolServ API uses the client dispatch routine identification information, set with the VS_Global_SetDefaults function or with the command default function, to determine which routine to notify when intermediate and final command status is received.

The total amount time the API waits for status is VSID_TIMEOUT_VALUE.

VS_Select returns error codes instead of the normal VST_BOOLEAN values (VSE_TRUE, VSE_FALSE). This simplifies client code when performing asynchronous processing. Client can use the “switch” statement on the return code directly from the routine without having to retrieve error codes.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetDefaults(l),
  • VS_Initialize(l)
Page 436 of the ADIC 601355 Rev A user manual — (VST_ACTION_CODE *)
Page 436 · click to enlarge
Page 436

VS_Status_ GetFields

VS_Status_GetFields retrieves information associated with a status handle. A status handle is used to pass status information to and from VolServ.

Synopsis VST_BOOLEAN VS_Status_GetFields (VST_STATUS_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The status handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ACTION_CODE

Pointer to the first entry in the action code table.

(VST_ACTION_CODE *)

VSID_ACTION_CODE_ENTRY (int) Index of the appropriate entry in the action code table.

(VST_ACTION_CODE *) Pointer to the appropriate entry in the action code table.

Parameters · Parameter Type Description

Page 437 of the ADIC 601355 Rev A user manual — VSID_COMPONENT_HANDLE (VST_COMPONENT_HANDLE *)
Page 437 · click to enlarge
Page 437

VSID_ACTION_CODE_TABLE (VST_TABLE_HANDLE *)

Pointer to the action code table associated with this status.

VSID_ARCHIVE_HANDLE (VST_ARCHIVE_HANDLE *)

Pointer to the first archive handle in the archive handle table.

VSID_ARCHIVE_HANDLE_ENTRY (int) Index of the appropriate archive handle in the archive handle table.

(VST_ARCHIVE_HANDLE *) Pointer to the appropriate archive handle in the archive handle table.

VSID_ARCHIVE_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the archive handle table associated with this status.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Pointer to the name of the archive associated with this status. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ARCHIVEMEDIACLASS_HANDLE (VST_ARCHIVE_MEDIACLAS_HANDLE *)

Pointer to the first archive media class handle in the archive media class table.

Index of the appropriate archive media class handle in the archive media class handle table.

(VST_ARCHIVEMEDIACLASS_HANDLE *) Pointer to the appropriate archive media class handle in the archive media class handle table.

VSID_ARCHIVEMEDIACLASS_HANDLE_TA BLE (VST_TABLE_HANDLE *)

Pointer to the archive media class handle table associated with this status.

VSID_COMPONENT_HANDLE (VST_COMPONENT_HANDLE *)

Pointer to the first component handle in the component handle table.

VSID_COMPONENT_HANDLE_ENTRY (int) Index of the appropriate component handle in the component handle table.

(VST_COMPONENT_HANDLE *) Pointer to the appropriate component handle in the component handle table.

Parameter Type Description · VSID_ARCHIVEMEDIACLASS_HANDLE_ ENTRY (int)

Page 438 of the ADIC 601355 Rev A user manual — VSID_DRIVE_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 438 · click to enlarge
Page 438

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the component handle table associated with this status.

VSID_COMP_ID (VST_COMPONENT_ID *) Pointer to the first component identifier in the component identifier table.

VSID_COMP_ID_ENTRY (int) Index of the appropriate component identifier in the component identifier table.

(VST_COMPONENT_ID *) Pointer to the appropriate component identifier in the component identifier table.

VSID_COMP_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the component identifier table associated with this status.

VSID_COMP_STATE (VST_COMPONENT_STATE *)

Pointer to the component state for this status. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_CONNECT_HANDLE (VST_CONNECT_HANDLE *)

Pointer to the first entry in the connect handle table.

VSID_CONNECT_HANDLE_ENTRY (int) Index of the appropriate connect handle in the connect handle table.

(VST_CONNECT_HANDLE *) Pointer to the appropriate connect handle in the connect handle table.

VSID_CONNECT_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the connect handle table associated with this status.

VSID_DRIVE_HANDLE (VST_DRIVE_HANDLE *)

Pointer to the first drive handle in the drive handle table.

VSID_DRIVE_HANDLE_ENTRY (int) Index the appropriate drive handle in the drive handle table.

(VST_DRIVE_HANDLE *) Pointer to the appropriate drive handle in the drive handle table.

VSID_DRIVE_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the drive handle table associated with this status.

Parameter Type Description

Page 439 of the ADIC 601355 Rev A user manual — VSID_ERROR_TABLE (VST_TABLE_HANDLE *)
Page 439 · click to enlarge
Page 439

VSID_DRIVE_ID (VST_DRIVE_ID *) Pointer to the first drive identifier in the drive identifier table.

VSID_DRIVE_ID_ENTRY (int) Index of the appropriate drive identifier in the drive identifier table.

(VST_DRIVE_ID *) Pointer to the appropriate drive identifier in the drive identifier table.

VSID_DRIVE_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the drive identifier table associated with this status.

VSID_DRIVEPOOL_HANDLE (VST_DRIVE_POOL_HANDLE *)

Pointer to the first drive pool handle in the drive pool handle table.

VSID_DRIVEPOOL_HANDLE_ENTRY (int) Index of the appropriate drive pool handle in the drive pool handle table.

(VST_DRIVEPOOL_HANDLE *) Pointer to the appropriate drive pool handle in the drive pool handle table.

VSID_DRIVEPOOL_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the drive pool handle table associated with this status.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Pointer to the name of the drive pool group.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the identifier of the enterprise, if any, to receive command status.

VSID_ERROR_CODE (VST_VOLERR_CODE *)

Pointer to the first error code in the error code table.

VSID_ERROR_CODE_ENTRY (int) Index of the appropriate error code in the error code table.

(VST_VOLERR_CODE *) Pointer to the appropriate error code in the error code table.

VSID_ERROR_TABLE (VST_TABLE_HANDLE *)

Pointer to the error code table associated with this status.

VSID_FIELD (int *) Pointer to the first field in the user-defined media statistics field table.

Parameter Type Description

Page 440 of the ADIC 601355 Rev A user manual — VSID_MEDIACLASS_HANDLE (VST_MEDIACLASS_HANDLE *)
Page 440 · click to enlarge
Page 440

VSID_FIELD_ENTRY (int) The index of the appropriate field in the user-defined media statistics field table.

(int *) Pointer to the appropriate field in the user-defined media statistics field table.

VSID_FIELD_TABLE (VST_TABLE_HANDLE *)

Pointer to the user-defined media statistics field table associated with this status.

VSID_LOCK_ID (VST_LOCK_ID *) Pointer to the lock identifier associated with this status.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Pointer to the MediaClass name associated with this status.

VSID_MEDIA_HANDLE (VST_MEDIA_HANDLE *)

Pointer to the first media handle in the media handle table.

VSID_MEDIA_HANDLE_ENTRY (int) The index of the appropriate media handle in the media handle table.

(VST_MEDIA_HANDLE *) Pointer to the appropriate media handle in the media handle table.

VSID_MEDIA_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the media handle table associated with this status.

VSID_MEDIA_ID (VST_MEDIA_ID) Pointer to the first media identifier in the media identifier table.

VSID_MEDIA_ID_ENTRY (int) The index of the appropriate entry in the media identifier table.

(VST_MEDIA_ID *) Pointer to the appropriate media identifier in the media identifier table.

VSID_MEDIA_ID_TABLE (VST_TABLE_HANDLE *)

Pointer to the media identifier table associated with this status.

VSID_MEDIACLASS_HANDLE (VST_MEDIACLASS_HANDLE *)

Pointer to the first MediaClass handle in the MediaClass handle table.

VSID_MEDIACLASS_HANDLE_ENTRY (int) The index of the appropriate MediaClass handle in the MediaClass handle table

Parameter Type Description

Page 441 of the ADIC 601355 Rev A user manual — VSID_MEDIATYPE_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 441 · click to enlarge
Page 441

(VST_MEDIACLASS_HANDLE *) Pointer to the appropriate MediaClass handle in the MediaClass handle table.

VSID_MEDIACLASS_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the MediaClass handle table associated with this status.

VSID_MEDIATYPE_HANDLE (VST_MEDIATYPE_HANDLE *)

Pointer to the first media type handle in the media type handle table.

VSID_MEDIATYPE_HANDLE_ENTRY (int) The index of the appropriate media type handle in the media type handle table.

(VST_MEDIATYPE_HANDLE *) Pointer to the appropriate media type handle in the media type handle table.

VSID_MEDIATYPE_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the media type handle table associated with this status.

VSID_NUMBER_ACTION_CODES (int *) Pointer to the number of action codes in the action code table.

VSID_NUMBER_ARCHIVE_HANDLES (int *) Pointer to the number of archive handles in the archive handle table.

VSID_NUMBER_COMP_IDS (int *) Pointer to the number of component ids in the component identifier table.

Pointer to the number of component handles in the component handle table.

VSID_NUMBER_CONNECT_HANDLES (int *) Pointer to the number of connect handles in the connect handle table.

VSID_NUMBER_DRIVE_HANDLES (int *) Pointer to the number of drive handles in the drive handle table.

VSID_NUMBER_DRIVE_IDS (int *) Pointer to the number of drive ids in the drive id table.

Pointer to the number of drive pool handles in the drive pool handle table.

VSID_NUMBER_ERROR_CODES (int *) Pointer to the number of error codes in the error code table.

Parameter Type Description · VSID_NUMBER_COMPONENT_HANDLES (int *) · VSID_NUMBER_DRIVEPOOL_HANDLES (int *)

Page 442 of the ADIC 601355 Rev A user manual — VSID_REQUEST_HANDLE_TABLE (VST_TABLE_HANDLE *)
Page 442 · click to enlarge
Page 442

VSID_NUMBER_FIELDS (int *) Pointer to the number of field ids in the field identifier table.

VSID_NUMBER_MEDIA_HANDLES (int *) Pointer to the number of media handles present in the media handle table.

VSID_NUMBER_MEDIA_IDS (int *) Pointer to the number of media ids in the media id table.

Pointer to the number of media class handles in the media class handle table.

Pointer to the number of media type handles in the media type handle table.

VSID_NUMBER_REQUEST_IDS (int *) Pointer to the number of request ids present in the request id table.

Pointer to the number of request handles in the request handle table.

VSID_PID (VST_PID *) Pointer to the VolServ identifier for the Ping status.

VSID_QRY_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the enterprise identifier, if any, for the Connect Query command.

VSID_QRY_OPTION (VST_QRY_OPTION *) Pointer to the query option for this status.

VSID_REQUEST_HANDLE (VST_REQUEST_HANDLE *)

Pointer to the first request handle in the request handle table.

VSID_REQUEST_HANDLE_ENTRY (int) The index of the appropriate request handle in the request handle table.

(VST_REQUEST_HANDLE *) Pointer to the appropriate request handle in the request handle table.

VSID_REQUEST_HANDLE_TABLE (VST_TABLE_HANDLE *)

Pointer to the request handle table associated with this status.

VSID_REQUEST_ID (VST_REQUEST_ID *) Pointer to the request identifier of the target command for a Cancel or Reprioritize request.

Show 4 more labels / short text on this page
Parameter Type Description · VSID_NUMBER_MEDIACLASS_HANDLES (int *) · VSID_NUMBER_MEDIATYPE_HANDLES (int *) · VSID_NUMBER_REQUEST_HANDLES (int *)
Page 443 of the ADIC 601355 Rev A user manual — VSID_WAIT_REASON (VST_WAIT_REASON *)
Page 443 · click to enlarge
Page 443

VSID_SEQUENCE_NUM (int *) Pointer to the sequence number of this status. Initial status for a command request is sequence number 0. Sequence numbers for subsequent statuses for the same command request are assigned as one-up numbers. For example, the first intermediate status (if there is an intermediate status) or the final status (if there is no intermediate status) is sequence number 1.

VSID_SEQUENCE_TABLE (VST_TABLE_HANDLE *)

Pointer to the sequence numbers (in table format) of the statuses received for this command.

VSID_STATUS_CODE (VST_STATUS_CODE *)

Pointer to the status code for this status. Indicates whether the command was successful or failed. Valid VSID_STATUS_CODE values are enumerated in the vs_types.h file.

VSID_STATUS_TYPE (VST_STATUS_TYPE *)

Pointer to the status type (intermediate or final) for this status. Valid VSID_STATUS_TYPE values are enumerated in the vs_types.h file.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID *)

Pointer to the enterprise identifier for a ConnectQuery or Disconnect command.

VSID_USER_FIELD (VST_USER_FIELD) Pointer to the user field contents for the associated command. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for each command. Neither the API software nor VolServ uses USER_FIELD.

VSID_WAIT_REASON (VST_WAIT_REASON *)

Pointer to the wait reason for an intermediate status. Valid VSID_WAIT_REASON values are enumerated in the vs_types.h file.

Parameter Type Description

Page 444 of the ADIC 601355 Rev A user manual — Return Values
Page 444 · click to enlarge
Page 444

Return Values VS_Status_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a request handle.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_mediaquery_execute_sync 4 * 5 * PURPOSE: 6 * This executes the VSCMD_MediaQuery API call in a 7 * synchronous mode. It shows how to process status 8 * in synchronous mode without using a dispatch 9 * routine. 10 * 11 * PARAMETERS: 12 * none 13 * 14 **************************************** *********/

Example 1 /****************************************

Page 445 of the ADIC 601355 Rev A user manual — Return Values
Page 445 · click to enlarge
Page 445

15 #ifdef ANSI_C 16 VST_BOOLEAN

vst_mediaquery_execute_sync(void) 17 #else 18 VST_BOOLEAN

vst_mediaquery_execute_sync() 19 #endif 20 { 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_QUERY_OPTION queryopt; 23 int i; 24 int count; 25 char * medialist[VST_MAX_ITEMS]; 26 VST_COMMAND_HANDLE cmd; 27 VST_STATUS_HANDLE status; 28 VST_TABLE_HANDLE

mediahandletable; 29 VST_MEDIA_HANDLE media; 30 31 /* get parameters from user */ 32 printf(“*** Media Query parameters

***\n” ); 33 printf(“0) Query by media list, 1)

Query all ==> “ ); 34 queryopt = atoi(gets(input)); 35 36 if (queryopt == 0) 37 { 38 count = vst_getmedialist(medialist, VST_MAX_ITEMS); 39 } 40 41 /* create the command handle */ 42 /* Note that the command handle is

not */ 43 /* destroyed in this routine, but in

*/ 44 /* vst_dispatch when final status is

*/ 45 /* received */

Page 446 of the ADIC 601355 Rev A user manual — Return Values
Page 446 · click to enlarge
Page 446

46 cmd = VS_Command_Create(); 47 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 48 { 49 /* Send the command to the VolServ software. */ 50 /* Note that status is not processed here. */ 51 /* Instead,it is processed in the */ 52 /* vst_dispatch routine. */ 53 /* Also, note that default values, such as */ 54 /* timeout, value retry limit, and priority */ 55 /* are set as default parameters. */ 56 rc = VSCMD_MediaQuery(cmd, 57 VSID_QRY_OPTION, queryopt, 58 VSID_MEDIA_ID_LIST, count, medialist, 59 VSID_CLIENT_DISPATCH, NULL, 60 /* no dispatch routine */ 61 VSID_STATUS_WAIT_FLAG, VSE_TRUE, 62 /* synchronous mode */ 63 VSID_ENDFIELD); 64 if (rc) 65 { 66 /* the command was successful */ 67 /* get the status */ 68 VS_Command_GetFields(cmd, 69 VSID_STATUS_HANDLE, &status, 70 VSID_ENDFIELD); 71 72 /* get the media handle table from the */ 73 /* status handle */ 74 VS_Status_GetFields(status,

Page 447 of the ADIC 601355 Rev A user manual — Notes
Page 447 · click to enlarge
Page 447

75 VSID_MEDIA_HANDLE_TABLE &mediahandletable, 76 VSID_ENDFIELD); 77 78 /* Get the number of entries in the table */ 79 VS_Table_GetFields(mediahandletab le, 80 VSID_NUMBER_ENTRIES, &count 81 VSID_ENDFIELD); 82 83 /* loop through the table and print out */ 84 /* the entries */ 85 for (i = 0; i < count; i++) 86 { 87 VS_Table_GetFields(mediahandletab le, 88 VSID_TABLE_ENTRY, i, &media, 89 VSID_ENDFIELD); 90 vst_print_media(media); 91 } 92 } 93 /* destroy the command */ 94 VS_Command_Destroy(cmd); 95 } 96 return ( rc ); 97 }

  • The first argument passed is the index of the entry in the appropriate table.
Page 448 of the ADIC 601355 Rev A user manual — - VSID_ACTION_CODE_ENTRY,
Page 448 · click to enlarge
Page 448
  • The second argument is a pointer to the location where the retrieved value is stored.

- VSID_ACTION_CODE_ENTRY,

- VSID_ARCHIVE_HANDLE_ENTRY,

- VSID_ARCHIVEMEDIACLASS_ENTRY,

- VSID_COMPONENT_ENTRY,

- VSID_COMP_ID_ENTRY,

- VSID_CONNECT_HANDLE_ENTRY,

- VSID_DRIVE_HANDLE_ENTRY,

- VSID_DRIVEPOOL_HANDLE_ENTRY,

- VSID_ERROR_CODE_ENTRY,

- VSID_FIELD_ENTRY ,

- VSID_MEDIA_HANDLE_ENTRY ,

- VSID_MEDIA_ID_ENTRY ,

- VSID_MEDIACLASS_HANDLE_ENTRY ,

- VSID_MEDIATYPE_HANDLE_ENTRY ,

- VSID_REQUEST_HANDLE_ENTRY

Table entries are zero-based (like arrays in C). The first entry in an empty table is stored in position 0, the second entry in a table is stored in position 1, and the nth entry in a table is stored in position n-1.

Page 449 of the ADIC 601355 Rev A user manual — Note
Page 449 · click to enlarge
Page 449

The status handle is associated with a command handle. To retrieve status information, the status handle must first be retrieved from the command handle using VS_Command_GetFields.

The VSID_STATUS_TYPE, VSID_STATUS_CODE, VSID_USER_FIELD and VSID_REQUEST_ID parameters are valid status handle fields for all VolServ requests.

The status fields that are valid for each command are identified in the “Notes” paragraph for that command. A matrix showing which status fields are valid for which commands is in Appendix A.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l)
Page 450 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Table_AddEntry (VST_TABLE_HANDLE handle, void * entry)
Page 450 · click to enlarge
Page 450

VS_Table_ AddEntry

VS_Table_AddEntry adds an entry to the specified table at the first available location.

When a client adds an entry to a table using VS_Table_AddEntry, the client is responsible for allocating and maintaining the space to contain the information maintained in the table.

Synopsis VST_BOOLEAN VS_Table_AddEntry (VST_TABLE_HANDLE handle, void * entry)

Arguments • handle = Handle of the table where an entry is added.

  • entry = Pointer to the data to be stored in the table.

Return Values VS_Table_AddEntry returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADENTRY - Pointer to store was null.
  • VSE_ERR_BADHANDLE - Specified handle was not a table handle.
  • VSE_ERR_FULL - The table is full and the entry could not be added.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
Page 451 of the ADIC 601355 Rev A user manual — Example
Page 451 · click to enlarge
Page 451

********* 2 * 3 * FUNCTION: vst_createarchivemediaclass_execu te 4 * 5 * PURPOSE: 6 * This executes the VSCMD_CreateArchiveMediaClass 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_createarchivemediaclass_execu te(void) 15 #else 16 VST_BOOLEAN

vst_createarchivemediaclass_execu te() 17 #endif 18 { 19 int i; 20 int count; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_ARCHIVE_NAME archive; 23 VST_MEDIA_CLASS_NAME

mediaclass; 24 VST_CAPACITY capacity; 25 VST_ARCHIVE_ACTION_OPTION action; 26 VST_HIGH_MARK highmark; 27 VST_LOW_MARK lowmark; 28 VST_PRIORITY migpri; 29 VST_ARCHIVE_NAME

Example 1 /**************************************** · targetarchive;

Page 452 of the ADIC 601355 Rev A user manual — 30 VST_TABLE_HANDLE
Page 452 · click to enlarge
Page 452

30 VST_TABLE_HANDLE

comphandle; 32 VST_COMP_TYPE CompType =

VSE_COMPTYPE_COLUMN; 33 ST_COMPONENT_ID CompID; 34 VST_COMMAND_HANDLE cmd; 35 36 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 37 /* get parameters from user */ 38 printf(“*** Create Archive Media

Class parameters ***\n” ); 39 printf(“Enter Archive Name ==> “ ); 40 gets( archive ); 41 printf(“Enter Media Class Name ==> “

); 42 gets( mediaclass ); 43 printf(“Enter Capacity Percent ==> “

); 44 capacity = atoi(gets(input)); 45 printf(“Enter Archive action option

(0-none/1-mig/2-notify) ==> “ ); 46 action = atoi(gets(input)); 47 printf(“Enter High Mark Percentage

==> “ ); 48 highmark = atoi(gets(input)); 49 printf(“Enter Low Mark Percentage ==>

“ ); 50 lowmark = atoi(gets(input)); 51 52 if ( action == VSE_ARCHIVE_ACTION_MIG

) 53 { 54 /* these parameters only need to be set */ 55 /* if the archivemediaclass is being */ 56 /* set up to support migration */ 57 printf(“Enter Target Archive ==> “ );

comphandletable; 31 VST_COMPONENT_HANDLE

Page 453 of the ADIC 601355 Rev A user manual — Example
Page 453 · click to enlarge
Page 453

58 gets( targetarchive ); 59 printf(“Enter Migration Priority == > “ ); 60 migpri = atoi(gets(input)); 61 VSCMD_CreateArchiveMediaClass_Set Defaults ( 62 VSID_TARGET_ARCHIVE_NAME, targetarchive, 63 VSID_MIGRATION_PRIORITY, migpri, 64 VSID_ENDFIELD ); 65 } 66 67 printf(“How many prefered placements

(0 to skip): “); 68 count = atoi(gets(input)); 69 if (count > 0) 70 { 71 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count); 72 if (comphandletable ==(VST_TABLE_HANDLE)NULL) 73 { 74 return(VSE_FALSE); 75 } 76 for (i = 0; i < count; i++) 77 { 78 printf(“Enter row #%d:”, i + 1); 79 CompID[0] = (short) atoi(gets(input)); 80 printf(“Enter column #%d:”, i + 1); 81 CompID[1] = (short) atoi(gets(input)); 82 CompID[2] = 0; 83 CompID[3] = 0; 84 comphandle = VS_Component_Create();

Page 454 of the ADIC 601355 Rev A user manual — Example
Page 454 · click to enlarge
Page 454

85 VS_Component_SetFields(comphandle , 86 VSID_COMP_TYPE, CompType, 87 VSID_COMP_ID, CompID, 88 VSID_ENDFIELD); 89 VS_Table_AddEntry(comphandletable ,comphandle); 90 } 91 /* This also only needs to be set if it is */ 92 /* actually being used. */ 93 /* It is not needed otherwise. */ 94 VSCMD_CreateArchiveMediaClass_Set Defaults( 95 VSID_COMPONENT_HANDLE_TABLE comphandletable, 96 VSID_ENDFIELD); 97 } 98 99 /* create the command handle */ 100 /* Note that the command handle is not

destroyed */ 101 /* in this routine, but in

vst_dispatch */ 102 /* when final status is received. */ 103 cmd = VS_Command_Create(); 104 if (cmd != (VST_COMMAND_HANDLE )NULL) 105 { 106 /* Send the command to the VolServ software. */ 107 /* Note that status is not processed here. */ 108 /* Instead, it is processed in the vst_dispatch */ 109 /* Also, note that default values such as */

Page 455 of the ADIC 601355 Rev A user manual — Notes
Page 455 · click to enlarge
Page 455

110 /* timeout value retry limit, and priority */ 111 /* are set as default parameters. */ 112 rc = VSCMD_CreateArchiveMediaClass(cmd , 113 VSID_ARCHIVE_NAME, archive, 114 VSID_MEDIA_CLASS_NAME, mediaclass, 115 VSID_HIGH_MARK, highmark, 116 VSID_LOW_MARK, lowmark, 117 VSID_CAPACITY, capacity, 118 VSID_ENDFIELD); 119 } 120 121 return ( rc ); 122}

VS_Table_AddEntry determines the position in the table to store the new entry using a first available algorithm.

Table entries are zero-based (like arrays in C). The first entry in an empty table is stored in position 0, the second entry in a table is stored in position 1, and the nth entry in a table is stored in position n-1.

Page 456 of the ADIC 601355 Rev A user manual — See Also
Page 456 · click to enlarge
Page 456

See Also • VS_Table_Create(l),

  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_SetFields(l),
  • VS_Table_CreateAddEntry(l),
  • VS_Table_RemoveEntry(l)
Page 457 of the ADIC 601355 Rev A user manual — Synopsis VST_TABLE_HANDLE VS_Table_Create (VST_HANDLE_TYPE type, int size)
Page 457 · click to enlarge
Page 457

VS_Table_ Create

VS_Table_Create allocates a VolServ API table handle. A table handle is used to pass table information to and from VolServ.

A table is used to store a group of pointers of the same type within a single construct (much like an array or a linked list).

Synopsis VST_TABLE_HANDLE VS_Table_Create (VST_HANDLE_TYPE type, int size)

Arguments • type = The type of the pointers to be stored in the table. Valid TableCreate value types are enumerated in the vs_types.h file.

  • size = The maximum number of entries to stored in the table.

Return Values VS_Table_Create returns:

  • A table handle, if one can be allocated.
  • NULL, if a table handle cannot be allocated. An appropriate error code is set in VSG_Error.
  • VSE_ERR_OUTOFMEM - Memory allocation error.
Page 458 of the ADIC 601355 Rev A user manual — Example
Page 458 · click to enlarge
Page 458

********* 2 * 3 * FUNCTION: vst_createarchivemediaclass_execu te 4 * 5 * PURPOSE: 6 * This executes the VSCMD_CreateArchiveMediaClass 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_createarchivemediaclass_execu te(void) 15 #else 16 VST_BOOLEAN

vst_createarchivemediaclass_execu te() 17 #endif 18 { 19 int i; 20 int count; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_ARCHIVE_NAME archive; 23 VST_MEDIA_CLASS_NAME

mediaclass; 24 VST_CAPACITY capacity; 25 VST_ARCHIVE_ACTION_OPTION action; 26 VST_HIGH_MARK highmark; 27 VST_LOW_MARK lowmark; 28 VST_PRIORITY migpri; 29 VST_ARCHIVE_NAME

Example 1 /**************************************** · targetarchive;

Page 459 of the ADIC 601355 Rev A user manual — 30 VST_TABLE_HANDLE
Page 459 · click to enlarge
Page 459

30 VST_TABLE_HANDLE

comphandle; 32 VST_COMP_TYPE CompType =

VSE_COMPTYPE_COLUMN; 33 ST_COMPONENT_ID CompID; 34 VST_COMMAND_HANDLE cmd; 35 36 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 37 /* get parameters from user */ 38 printf(“*** Create Archive Media

Class parameters ***\n” ); 39 printf(“Enter Archive Name ==> “ ); 40 gets( archive ); 41 printf(“Enter Media Class Name ==> “

); 42 gets( mediaclass ); 43 printf(“Enter Capacity Percent ==> “

); 44 capacity = atoi(gets(input)); 45 printf(“Enter Archive action option 46 (0-none/1-mig/2-notify) ==> “ ); 47 action = atoi(gets(input)); 48 printf(“Enter High Mark Percentage

==> “ ); 49 highmark = atoi(gets(input)); 50 printf(“Enter Low Mark Percentage ==>

“ ); 51 lowmark = atoi(gets(input)); 52 53 if ( action == VSE_ARCHIVE_ACTION_MIG

) 54 { 55 /* these parameters only need to be set */ 56 /* if the archivemediaclass is being */ 57 /* set up to support migration. */ 58 printf(“Enter Target Archive ==> “ );

comphandletable; 31 VST_COMPONENT_HANDLE

Page 460 of the ADIC 601355 Rev A user manual — Example
Page 460 · click to enlarge
Page 460

59 gets( targetarchive ); 60 printf(“Enter Migration Priority == > “ ); 61 migpri = atoi(gets(input)); 62 VSCMD_CreateArchiveMediaClass_Set Defaults ( 63 VSID_TARGET_ARCHIVE_NAME, targetarchive, 64 VSID_MIGRATION_PRIORITY, migpri, 65 VSID_ENDFIELD ); 66 } 67 68 printf(“How many prefered placements

(0 to skip): “); 69 count = atoi(gets(input)); 70 if (count > 0) 71 { 72 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count); 73 if (comphandletable == (VST_TABLE_HANDLE) NULL) 74 { 75 return(VSE_FALSE); 76 } 77 for (i = 0; i < count; i++) 78 { 79 printf(“Enter row #%d:”, i + 1); 80 CompID[0] = (short) atoi(gets(input)); 81 printf(“Enter column #%d:”, i + 1); 82 CompID[1] = (short) atoi(gets(input)); 83 CompID[2] = 0; 84 CompID[3] = 0; 85 comphandle = VS_Component_Create();

Page 461 of the ADIC 601355 Rev A user manual — Example
Page 461 · click to enlarge
Page 461

86 VS_Component_SetFields(comphandle , 87 VSID_COMP_TYPE, CompType, 88 VSID_COMP_ID, CompID, 89 VSID_ENDFIELD); 90 VS_Table_AddEntry(comphandletable ,comphandle); 91 } 92 /* This also only needs to be set if it is */ 93 /* actually being used. */ 94 /* It is not needed otherwise. */ 95 VSCMD_CreateArchiveMediaClass_Set Defaults( 96 VSID_COMPONENT_HANDLE_TABLE, comphandletable, 97 VSID_ENDFIELD); 98 } 99 100 /* create the command handle */ 101 /* Note that the command handle is not

destroyed*/ 102 /* in this routine, but in

vst_dispatch when */ 103 /* final status is received. */ 104 cmd = VS_Command_Create(); 105 if (cmd != (VST_COMMAND_HANDLE )NULL) 106 { 107 /* Send the command to the VolServ software. */ 108 /* Note that status is not processed here. */ 109 /* Instead, it is processed in the vst_dispatch */ 110 /* routine. Also, note that default values */

Page 462 of the ADIC 601355 Rev A user manual — Notes
Page 462 · click to enlarge
Page 462

111 /* such as timeout, value retry limit, and */ 112 /* priority are set as default parameters. */ 113 rc = VSCMD_CreateArchiveMediaClass(cmd , 114 VSID_ARCHIVE_NAME, archive, 115 VSID_MEDIA_CLASS_NAME, mediaclass, 116 VSID_HIGH_MARK, highmark, 117 VSID_LOW_MARK, lowmark, 118 VSID_CAPACITY, capacity, 119 VSID_ENDFIELD); 120 } 121 122 return ( rc ); 123}

When a client adds an entry to a table using the VS_Table_AddEntry or VS_Table_SetFields function, the client is responsible for allocating and maintaining the space to contain the information maintained in the table.

When a client adds an entry to a table using the VS_Table_CreateAddEntry function, the API allocates space for a table entry, copies the client’s data to the allocated space, and adds the entry to the specified table. After calling VS_Table_CreateAddEntry, a client is no longer required to maintain the space containing the information added to the table.

Page 463 of the ADIC 601355 Rev A user manual — See Also
Page 463 · click to enlarge
Page 463

Client deletes entries from a table with the VS_Table_RemoveEntry function. If the entry to be deleted from the table was added with either the VS_Table_AddEntry or the VS_Table_SetFields function, it is the client’s responsibility to free the space for the entry after it has been removed from the table. If the entry to be deleted from the table was added with the VS_Table_CreateAddEntry function, the API frees the space for the entry after it has been removed from the table.

See Also • VS_Table_Destroy(l),

  • VS_Table_GetFields(l),
  • VS_Table_SetFields(l),
  • VS_Table_AddEntry(l),
  • VS_Table_CreateAddEntry(l),
  • VS_Table_RemoveEntry(l)
Page 464 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Table_CreateAddEntry (VST_TABLE_HANDLE handle, void * entry, int size)
Page 464 · click to enlarge
Page 464

VS_Table_ CreateAddEntry

VS_Table_CreateAddEntry adds an entry to the specified table at the first available location.

When a client adds an entry to a table using VS_Table_CreateAddEntry, the VolServ API allocates space for a table entry, copies the client’s data to the allocated space, and adds an entry to the specified table for the copied data. After calling VS_Table_CreateAddEntry, a client is not required to maintain the information that has been stored in the table.

Synopsis VST_BOOLEAN VS_Table_CreateAddEntry (VST_TABLE_HANDLE handle, void * entry, int size)

Arguments • handle = Handle of the table where the specified entry is added.

  • entry = Pointer to the entry to be copied and added to the specified table.
  • size = The size, in bytes, of the entry to be copied and added to the specified table.

Return Values VS_Table_CreateAddEntry returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADENTRY - Pointer to the entry to be stored was null.
Page 465 of the ADIC 601355 Rev A user manual — Example
Page 465 · click to enlarge
Page 465
  • VSE_ERR_BADHANDLE - Specified handle was not a table handle.
  • VSE_ERR_FULL - The table is full and the entry could not be added
  • VSE_ERR_NULLHANDLE -Specified handle was a null pointer.
  • VSE_ERR_OUTOFMEM - The allocation request for space to copy the client’s data failed.

********* 2 * 3 * FUNCTION: vst_table_handle 4 * 5 * PURPOSE: 6 * This function tests the table handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_table_handle(void) 14 #else 15 VST_BOOLEAN vst_table_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_TRUE; 19 VST_TABLE_HANDLE tableh; 20 int numdrives; 21 int i; 22 VST_DRIVE_ID testdriveid = 9999; 23 int numentries; 24 VST_DRIVE_ID * ip; 25

Example 1 /****************************************

Page 466 of the ADIC 601355 Rev A user manual — Example
Page 466 · click to enlarge
Page 466

26 printf(“*** Table Handle test

***\n”); 27 printf(“How many drives? “); 28 numdrives = atoi(gets(input)); 29 30 /* create the table handle */ 31 tableh =

VS_Table_Create(VSE_INTEGER_PTR, numdrives); 32 33 /* generate drive ids */ 34 for (i = 0; i < numdrives; i++) 35 { 36 VS_Table_CreateAddEntry(tableh, &i, sizeof(VST_DRIVE_ID)); 37 } 38 /* get the number of entries in the

table */ 39 VS_Table_GetFields(tableh, 40 VSID_NUMBER_ENTRIES, &numentries, 41 VSID_ENDFIELD); 42 /* loop through the table and print

the entries */ 43 for (i = 0; i < numentries; i++) 44 { 45 VS_Table_GetFields(tableh, 46 VSID_TABLE_ENTRY, i, &ip, 47 VSID_ENDFIELD); 48 /* remove the entry from the table */ 49 VS_Table_RemoveEntry(tableh, ip); 50 /* set this entry to a NULL pointer */ 51 VS_Table_SetFields(tableh, 52 VSID_TABLE_ENTRY, i, NULL, 53 VSID_ENDFIELD); 54 /* print the value retrieved from the table */

Page 467 of the ADIC 601355 Rev A user manual — Notes
Page 467 · click to enlarge
Page 467

55 printf(“Drive ID #%d = %d\n”, i, *ip); 56 } 57 /* destroy the table */ 58 VS_Table_Destroy(tableh); 59 return(rc); 60 }

VS_Table_CreateAddEntry determines the location in the table to store the entry using a first available algorithm.

Table entries are zero-based (like arrays in C). The first entry in an empty table is stored in position 0, the second entry in a table is stored in position 1, and the nth entry in a table is stored in position n-1.

See Also • VS_Table_AddEntry(l),

  • VS_Table_Create(l),
  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_RemoveEntry(l),
  • VS_Table_SetFields(l)
Page 468 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Table_Destroy (VST_TABLE_HANDLE handle)
Page 468 · click to enlarge
Page 468

VS_Table_ Destroy

VS_Table_Destroy deallocates a VolServ API table handle that was allocated with the VS_Table_Create function. A table handle is used to pass table information to and from VolServ.

Synopsis VST_BOOLEAN VS_Table_Destroy (VST_TABLE_HANDLE handle)

Arguments • handle = The table handle to be destroyed.

Return Values VS_Table_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_BADHANDLE - Specified handle was not a table handle.

********* 2 * 3 * FUNCTION: vst_table_handle 4 * 5 * PURPOSE: 6 * This function tests the table handle. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 469 of the ADIC 601355 Rev A user manual — VS_Table_ Destroy
Page 469 · click to enlarge
Page 469

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_table_handle(void) 14 #else 15 VST_BOOLEAN vst_table_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_TRUE; 19 VST_TABLE_HANDLE tableh; 20 int numdrives; 21 int i; 22 VST_DRIVE_ID testdriveid = 9999; 23 int numentries; 24 VST_DRIVE_ID * ip; 25 26 printf(“*** Table Handle test

***\n”); 27 printf(“How many drives? “); 28 numdrives = atoi(gets(input)); 29 30 /* create the table handle */ 31 tableh =

VS_Table_Create(VSE_INTEGER_PTR, numdrives); 32 33 /* generate drive ids */ 34 for (i = 0; i < numdrives; i++) 35 { 36 VS_Table_CreateAddEntry(tableh, &i, sizeof(VST_DRIVE_ID)); 37 } 38 /* get the number of entries in the

table */ 39 VS_Table_GetFields(tableh, 40 VSID_NUMBER_ENTRIES, &numentries, 41 VSID_ENDFIELD); 42 /* loop through the table and print

the entries */

Page 470 of the ADIC 601355 Rev A user manual — Notes
Page 470 · click to enlarge
Page 470

43 for (i = 0; i < numentries; i++) 44 { 45 VS_Table_GetFields(tableh, 46 VSID_TABLE_ENTRY, i, &ip, 47 VSID_ENDFIELD); 48 /* remove the entry from the table */ 49 VS_Table_RemoveEntry(tableh, ip); 50 /* set this entry to a NULL pointer */ 51 VS_Table_SetFields(tableh, 52 VSID_TABLE_ENTRY, i, NULL, 53 VSID_ENDFIELD); 54 /* print the value retrieved from the table */ 55 printf(“Drive ID #%d = %d\n”, i, *ip); 56 } 57 /* destroy the table */ 58 VS_Table_Destroy(tableh); 59 return(rc); 60 }

If a client adds entries to a table using VS_Table_AddEntry or VS_Table_SetFields functions, it is the client’s responsibility to maintain the data after it is stored in the table. It is also the client’s responsibility to deallocate the space containing the data after the entry has been deleted from the table and is no longer needed.

Page 471 of the ADIC 601355 Rev A user manual — See Also
Page 471 · click to enlarge
Page 471

If a client adds entries to a table using VS_Table_CreateAddEntry, the VolServ API maintains the data that is stored in the table and frees the space allocated for all table entries when the VS_Table_Destroy function is called.

See Also • VS_Table_AddEntry(l),

  • VS_Table_Create(l),
  • VS_Table_CreateAddEntry(l),
  • VS_Table_GetFields(l),
  • VS_Table_RemoveEntry(l),
  • VS_Table_SetFields(l)
Page 472 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Table_GetFields (VST_TABLE_HANDLE handle, “…”, VSID_ENDFIELD)
Page 472 · click to enlarge
Page 472

VS_Table_Get Fields

VS_Table_GetFields retrieves information associated with a table handle. A table handle is used to pass table information to and from VolServ.

Synopsis VST_BOOLEAN VS_Table_GetFields (VST_TABLE_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = Table handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_NUMBER_ENTRIES (int *) Pointer to the number of entries in the table.

VSID_TABLE_ENTRY (int) Index of a specific entry in the table.

(void **) Pointer to a specific entry in the table.

Parameters · Parameter Type Description

Page 473 of the ADIC 601355 Rev A user manual — Return Values
Page 473 · click to enlarge
Page 473

Return Values VS_Table_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a request handle.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_OUTOFRANGE - Specified entry does not exist in the table’s range of values.

********* 2 * 3 * FUNCTION: vst_print_drivepool 4 * 5 * PURPOSE: 6 * This function prints out the information stored in 7 * a drive pool handle. 8 * 9 * PARAMETERS: 10 * h : the drive pool handle to print 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C

Example 1 /****************************************

Page 474 of the ADIC 601355 Rev A user manual — Return Values
Page 474 · click to enlarge
Page 474

vst_print_drivepool(VST_DRIVEPOOL _HANDLE h) 15 #else 16 void vst_print_drivepool(h) 17 VST_DRIVEPOOL_HANDLE h; 18 #endif 19 { 20 VST_DRIVE_POOL_NAME DrivePoolName; 21 VST_TABLE_HANDLE

DriveHandleTable; 22 VST_DRIVE_HANDLE DriveHandle; 23 int i; 24 int n; 25 26 VS_DrivePool_GetFields(h, 27 VSID_DRIVEPOOL_NAME, DrivePoolName, 28 VSID_DRIVE_HANDLE_TABLE, &DriveHandleTable, 29 VSID_ENDFIELD); 30 printf(“DrivePoolName =

%s\n”,DrivePoolName); 31 /* Get # of entries */ 32 if ( DriveHandleTable !=

(VST_TABLE_HANDLE) NULL ) 33 { 34 VS_Table_GetFields(DriveHandleTab le, 35 VSID_NUMBER_ENTRIES, &n, 36 VSID_ENDFIELD); 37 for ( i = 0; i < n; i++) 38 { 39 VS_Table_GetFields(DriveHandleTab le, 40 VSID_TABLE_ENTRY, i, &DriveHandle, 41 VSID_ENDFIELD); 42 vst_print_drive(DriveHandle);

14 void

Page 475 of the ADIC 601355 Rev A user manual — Note
Page 475 · click to enlarge
Page 475

43 } 44 } 45 }

Notes A table is a VolServ API structure that holds a group of like pointers. Table handles are used to return lists of information to the client software. VS_Table_GetFields allows the user to access the entries in the table. The VSID_TABLE_ENTRY parameter requires that two arguments be passed instead of one. The first argument is the index of the entry in the appropriate table. The second argument is a pointer to a location where the value is stored.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

  • See Also
  • vsapi(l),
  • VS_Archive_GetFields(l),
  • VS_Criteria_GetFields(l),
  • VS_CriteriaGroup_GetFields(l),
  • VS_Drive_GetFields(l),
  • VS_DrivePool_GetFields(l),
  • VS_Notify_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Table_AddEntry(l),
  • VS_Table_Create(l),
  • VS_Table_CreateAddEntry(l),
  • VS_Table_Destroy(l),
  • VS_Table_RemoveEntry(l),
  • VS_Table_SetFields(l)
Page 476 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Table_RemoveEntry (VST_TABLE_HANDLE handle, void * entry)
Page 476 · click to enlarge
Page 476

VS_Table_ RemoveEntry

VS_Table_RemoveEntry removes an entry from the specified VolServ API table. A table handle is used to pass table information to and from VolServ.

Synopsis VST_BOOLEAN VS_Table_RemoveEntry (VST_TABLE_HANDLE handle, void * entry)

Arguments • handle = Handle of the table where the entry is removed.

  • entry = Pointer to the entry to be removed from the table.

Return Values VS_Table_RemoveEntry returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADENTRY - Pointer to the entry to be removed was null
  • VSE_ERR_BADHANDLE - Specified handle was not a table handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
Page 477 of the ADIC 601355 Rev A user manual — Example
Page 477 · click to enlarge
Page 477

********* 2 * 3 * FUNCTION: vst_table_handle 4 * 5 * PURPOSE: 6 * This function tests the table handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_table_handle(void) 14 #else 15 VST_BOOLEAN vst_table_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_TRUE; 19 VST_TABLE_HANDLE tableh; 20 int numdrives; 21 int i; 22 VST_DRIVE_ID testdriveid = 9999; 23 int numentries; 24 VST_DRIVE_ID * ip; 25 26 printf(“*** Table Handle test

***\n”); 27 printf(“How many drives? “); 28 numdrives = atoi(gets(input)); 29 30 /* create the table handle */ 31 tableh =

VS_Table_Create(VSE_INTEGER_PTR, numdrives); 32 33 /* generate drive ids */ 34 for (i = 0; i < numdrives; i++) 35 {

Example 1 /****************************************

Page 478 of the ADIC 601355 Rev A user manual — Example
Page 478 · click to enlarge
Page 478

36 VS_Table_CreateAddEntry(tableh, &i, sizeof(VST_DRIVE_ID)); 37 } 38 /* get the number of entries in the

table */ 39 VS_Table_GetFields(tableh, 40 VSID_NUMBER_ENTRIES, &numentries, 41 VSID_ENDFIELD); 42 /* loop through the table and print

the entries */ 43 for (i = 0; i < numentries; i++) 44 { 45 VS_Table_GetFields(tableh, 46 VSID_TABLE_ENTRY, i, &ip, 47 VSID_ENDFIELD); 48 /* remove the entry from the table */ 49 VS_Table_RemoveEntry(tableh, ip); 50 /* set this entry to a NULL pointer */ 51 VS_Table_SetFields(tableh, 52 VSID_TABLE_ENTRY, i, NULL, 53 VSID_ENDFIELD); 54 /* print the value retrieved from the table */ 55 printf(“Drive ID #%d = %d\n”, i, *ip); 56 } 57 /* destroy the table */ 58 VS_Table_Destroy(tableh); 59 return(rc); 60 }

Page 479 of the ADIC 601355 Rev A user manual — Notes
Page 479 · click to enlarge
Page 479

If a client adds entries to a table using VS_Table_AddEntry or VS_Table_SetFields functions, it is the client’s responsibility to maintain the data after it is stored in the table. It is also the client’s responsibility to deallocate the space containing the data after the entry has been deleted from the table and is no longer needed.

If a client adds entries to a table using VS_Table_CreateAddEntry, the VolServ API maintains the data that is stored in the table and frees the space allocated for all table entries when the VS_Table_Destroy function is called.

See Also • VS_Table_AddEntry(l),

  • VS_Table_Create(l),
  • VS_Table_CreateAddEntry(l),
  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_SetFields(l)
Page 480 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Table_GetFields (VST_TABLE_HANDLE handle, “…”, VSID_ENDFIELD)
Page 480 · click to enlarge
Page 480

VS_Table_Set Fields

VS_Table_SetFields adds an entry to the specified table at the specified location.

When a client adds an entry to a table using VS_Table_SetFields, the client is responsible for allocating and maintaining the space to contain the information maintained in the table.

Synopsis VST_BOOLEAN VS_Table_GetFields (VST_TABLE_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = Handle of the table where an entry is added.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

SID_NUMBER_ENTRIES (int) Number of entries in the table.

VSID_TABLE_ENTRY (int) Position where the specified entry is added to the table.

(void *) Pointer to the entry to be stored in the table.

Parameters · Parameter Type Description

Page 481 of the ADIC 601355 Rev A user manual — Return Values
Page 481 · click to enlarge
Page 481

Return Values VS_Table_GetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a request handle.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_OUTOFRANGE - Specified entry does not exist in the table’s range of values.

********* 2 * 3 * FUNCTION: vst_table_handle 4 * 5 * PURPOSE: 6 * This function tests the table handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_table_handle(void) 14 #else

Example 1 /****************************************

Page 482 of the ADIC 601355 Rev A user manual — Return Values
Page 482 · click to enlarge
Page 482

15 VST_BOOLEAN vst_table_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_TRUE; 19 VST_TABLE_HANDLE tableh; 20 int numdrives; 21 int i; 22 VST_DRIVE_ID testdriveid = 9999; 23 int numentries; 24 VST_DRIVE_ID * ip; 25 26 printf(“*** Table Handle test

***\n”); 27 printf(“How many drives? “); 28 numdrives = atoi(gets(input)); 29 30 /* create the table handle */ 31 tableh =

VS_Table_Create(VSE_INTEGER_PTR, numdrives); 32 33 /* generate drive ids */ 34 for (i = 0; i < numdrives; i++) 35 { 36 VS_Table_CreateAddEntry(tableh, &i, sizeof(VST_DRIVE_ID)); 37 } 38 /* get the number of entries in the

table */ 39 VS_Table_GetFields(tableh, 40 VSID_NUMBER_ENTRIES, &numentries, 41 VSID_ENDFIELD); 42 /* loop through the table and print

the entries */ 43 for (i = 0; i < numentries; i++) 44 { 45 VS_Table_GetFields(tableh, 46 VSID_TABLE_ENTRY, i, &ip,

Page 483 of the ADIC 601355 Rev A user manual — Note
Page 483 · click to enlarge
Page 483

47 VSID_ENDFIELD); 48 /* remove the entry from the table */ 49 VS_Table_RemoveEntry(tableh, ip); 50 /* set this entry to a NULL pointer */ 51 VS_Table_SetFields(tableh, 52 VSID_TABLE_ENTRY, i, NULL, 53 VSID_ENDFIELD); 54 /* print the value retrieved from the table */ 55 printf(“Drive ID #%d = %d\n”, i, *ip); 56 } 57 /* destroy the table */ 58 VS_Table_Destroy(tableh); 59 return(rc); 60 }

Table entries are zero-based (like arrays in C). The first entry in an empty table is stored in position 0, the second entry in a table is stored in position 1, and the nth entry in a table is stored in position n-1.

The VSID_TABLE_ENTRY parameter requires that two arguments be passed instead of one. The first argument is the position where the specified entry is added to the table. The second argument is the entry to be added to the table.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 484 of the ADIC 601355 Rev A user manual — See Also
Page 484 · click to enlarge
Page 484

See Also • vsapi(l),

  • VS_Archive_GetFields(l),
  • VS_DrivePool_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_MediaClass_Getfields(l),
  • VS_Table_AddEntry(l),
  • VS_Table_Create(l),
  • VS_Table_CreateAddEntry(l),
  • VS_Table_Destroy(l),
  • VS_Table_GetFields(l),
  • VS_Table_RemoveEntry(l)
Page 485 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_Terminate (void)
Page 485 · click to enlarge
Page 485

VS_Terminate VS_Terminate terminates the VolServ API software. VS_Terminate releases all memory allocated by the API and deregisters and frees all RPC transports.

Synopsis VST_BOOLEAN VS_Terminate (void)

Return Values VS_Terminate returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_SYSTEMCALL - A system call failed (usually from RPC). This generic error code covers an error that stems from a system call. The API sets this when encountering a failure during RPC setup.

********* 2 * 3 * FUNCTION: vst_terminate 4 * 5 * PURPOSE: 6 * This function shuts down the VolServ API. 7 * 8 * PARAMETERS: 9 * none 10 *

Arguments None · Example 1 /****************************************

Page 486 of the ADIC 601355 Rev A user manual — Notes
Page 486 · click to enlarge
Page 486

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_terminate ( void ) 14 #else 15 VST_BOOLEAN vst_terminate () 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 20 rc = VS_Terminate(); 21 return(rc); 22 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Initialize(l)
Page 487 of the ADIC 601355 Rev A user manual — Synopsis VST_TYPECAPACITY_HANDLE VS_TypeCapacity_Create (void)
Page 487 · click to enlarge
Page 487

VS_ TypeCapacity _Create

VS_TypeCapacity_Create allocates a VolServ API archive type capacity handle. A type capacity handle is used to pass archive type capacity information from VolServ in response to an Archive Query command request with the type capacity option specified.

Synopsis VST_TYPECAPACITY_HANDLE VS_TypeCapacity_Create (void)

Return Values VS_TypeCapacity_Create returns:

  • A type capacity handle, if one can be allocated.
  • NULL, if a type capacity handle could not be allocated. An appropriate error code is set in VSG_Error .
  • VSE_ERR_OUTOFMEM - Memory allocation error.

********* 2 * 3 * FUNCTION: vst_typecapacity_handle 4 * 5 * PURPOSE: 6 * This function tests a typecapacity handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** **********/ 12 #ifdef ANSI_C

Arguments · None · Example 1 /****************************************

Page 488 of the ADIC 601355 Rev A user manual — 13 VST_BOOLEAN
Page 488 · click to enlarge
Page 488

13 VST_BOOLEAN

vst_typecapacity_handle(void) 14 #else 15 VST_BOOLEAN

vst_typecapacity_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_TYPECAPACITY_HANDLE h; 20 VST_MEDIA_TYPE_NAME

MediaType; 21 VST_CAPACITY Capacity; 22 VST_HIGH_MARK

FillLevel; 25 int AssignedBins; 26 VST_ARCHIVE_ACTION_OPTION

ImportClass; 32 33 /* create the handle */ 34 h = vS_TypeCapacity_Create(); 35 if (h != (VST_TYPECAPACITY_HANDLE)

NULL) 36 { 37 /* get values from user */ 38 printf(“Enter media type name ==> “); 39 gets(MediaType);

Show 7 more labels / short text on this page
HighMarkPercent; 23 VST_LOW_MARK · LowMarkPercent; 24 VST_FILL_LEVEL · ActionOpt; 27 VST_BOOLEAN · AutoCheckinFlag; 28 VST_BOOLEAN · AutoImportFlag; 29 VST_BATCH_NAME · ImportBatch; 30 VST_MANUFACTURER_NAME · ImportManufacturer; 31 VST_MEDIA_CLASS_NAME
Page 489 of the ADIC 601355 Rev A user manual — VS_ TypeCapacity _Create
Page 489 · click to enlarge
Page 489

40 printf(“Enter import class ==> “); 41 gets(ImportClass); 42 printf(“Enter import batch ==> “); 43 gets(ImportBatch); 44 printf(“Enter import manufacturer ==> “); 45 gets(ImportManufacturer); 46 printf(“Enter capacity ==> “); 47 Capacity = atoi(gets(input)); 48 printf(“Enter high mark percent ==> “); 49 HighMarkPercent = atoi(gets(input)); 50 printf(“Enter low mark percent ==> “); 51 LowMarkPercent = atoi(gets(input)); 52 printf(“Enter fill level ==> “); 53 FillLevel = atoi(gets(input)); 54 printf(“Enter number of assigned bins ==> “); 55 AssignedBins = atoi(gets(input)); 56 printf(“Enter archive action option ==> “); 57 ActionOpt = atoi(gets(input)); 58 printf(“Enter auto import flag ==> “); 59 AutoImportFlag = atoi(gets(input)); 60 printf(“Enter auto checkin flag ==> “); 61 AutoCheckinFlag = atoi(gets(input)); 62 /* set the fields */ 63 rc = VS_TypeCapacity_SetFields(h, 64 VSID_MEDIA_TYPE_NAME, MediaType, 65 VSID_MEDIA_CLASS_NAME, ImportClass, 66 VSID_BATCH_NAME, ImportBatch,

Page 490 of the ADIC 601355 Rev A user manual — Notes
Page 490 · click to enlarge
Page 490

67 VSID_MANUFACTURER, ImportManufacturer, 68 VSID_CAPACITY, Capacity, 69 VSID_HIGH_MARK, HighMarkPercent, 70 VSID_LOW_MARK, LowMarkPercent, 71 VSID_FILL_LEVEL, FillLevel, 72 VSID_ASSIGNED_BINS, AssignedBins, 73 VSID_ARCHIVE_ACTION, ActionOpt, 74 VSID_AUTOIMPORT_FLAG, AutoImportFlag, 75 VSID_AUTOCHECKIN_FLAG, AutoCheckinFlag, 76 VSID_ENDFIELD); 77 if (rc) 78 { 79 vst_print_typecapacity(h); 80 } 81 VS_TypeCapacity_Destroy(h); 82 } 83 return(rc); 84 }

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_TypeCapacity_Destroy(l),
  • VS_TypeCapacity_GetFields(l),
  • VS_TypeCapacity_SetFields(l)
Page 491 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VS_TypeCapacity_Destroy (VST_TYPECAPACITY_HANDLE handle)
Page 491 · click to enlarge
Page 491

VS_ TypeCapacity _Destroy

VS_TypeCapacity_Destroy deallocates a type capacity handle that was allocated by VS_TypeCapacity_Create. A type capacity handle is used to pass archive type capacity information from VolServ in response to an Archive Query command request with the type capacity option specified.

Synopsis VST_BOOLEAN VS_TypeCapacity_Destroy (VST_TYPECAPACITY_HANDLE handle)

Arguments • handle = The type capacity handle to be destroyed.

Return Values VS_TypeCapacity_Destroy returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADHANDLE - Specified handle was not a type capacity handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

********* 2 * 3 * FUNCTION: vst_typecapacity_handle 4 * 5 * PURPOSE: 6 * This function tests a typecapacity handle. 7 * 8 * PARAMETERS: 9 * none

Example 1 /****************************************

Page 492 of the ADIC 601355 Rev A user manual — NULL) 36 {
Page 492 · click to enlarge
Page 492

10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_typecapacity_handle(void) 14 #else 15 VST_BOOLEAN

vst_typecapacity_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_TYPECAPACITY_HANDLE h; 20 VST_MEDIA_TYPE_NAME

MediaType; 21 VST_CAPACITY Capacity; 22 VST_HIGH_MARK

FillLevel; 25 int AssignedBins; 26 VST_ARCHIVE_ACTION_OPTION

ImportClass; 32 33 /* create the handle */ 34 h = vS_TypeCapacity_Create(); 35 if (h != (VST_TYPECAPACITY_HANDLE)

NULL) 36 {

Show 7 more labels / short text on this page
HighMarkPercent; 23 VST_LOW_MARK · LowMarkPercent; 24 VST_FILL_LEVEL · ActionOpt; 27 VST_BOOLEAN · AutoCheckinFlag; 28 VST_BOOLEAN · AutoImportFlag; 29 VST_BATCH_NAME · ImportBatch; 30 VST_MANUFACTURER_NAME · ImportManufacturer; 31 VST_MEDIA_CLASS_NAME
Page 493 of the ADIC 601355 Rev A user manual — VS_ TypeCapacity _Destroy
Page 493 · click to enlarge
Page 493

37 /* get values from user */ 38 printf(“Enter media type name ==> “); 39 gets(MediaType); 40 printf(“Enter import class ==> “); 41 gets(ImportClass); 42 printf(“Enter import batch ==> “); 43 gets(ImportBatch); 44 printf(“Enter import manufacturer ==> “); 45 gets(ImportManufacturer); 46 printf(“Enter capacity ==> “); 47 Capacity = atoi(gets(input)); 48 printf(“Enter high mark percent ==> “); 49 HighMarkPercent = atoi(gets(input)); 50 printf(“Enter low mark percent ==> “); 51 LowMarkPercent = atoi(gets(input)); 52 printf(“Enter fill level ==> “); 53 FillLevel = atoi(gets(input)); 54 printf(“Enter number of assigned bins ==> “); 55 AssignedBins = atoi(gets(input)); 56 printf(“Enter archive action option ==> “); 57 ActionOpt = atoi(gets(input)); 58 printf(“Enter auto import flag ==> “); 59 AutoImportFlag = atoi(gets(input)); 60 printf(“Enter auto checkin flag ==> “); 61 AutoCheckinFlag = atoi(gets(input)); 62 /* set the fields */ 63 rc = VS_TypeCapacity_SetFields(h, 64 VSID_MEDIA_TYPE_NAME, MediaType,

Page 494 of the ADIC 601355 Rev A user manual — Notes
Page 494 · click to enlarge
Page 494

65 VSID_MEDIA_CLASS_NAME, ImportClass, 66 VSID_BATCH_NAME, ImportBatch, 67 VSID_MANUFACTURER, ImportManufacturer, 68 VSID_CAPACITY, Capacity, 69 VSID_HIGH_MARK, HighMarkPercent, 70 VSID_LOW_MARK, LowMarkPercent, 71 VSID_FILL_LEVEL, FillLevel, 72 VSID_ASSIGNED_BINS, AssignedBins, 73 VSID_ARCHIVE_ACTION, ActionOpt, 74 VSID_AUTOIMPORT_FLAG, AutoImportFlag, 75 VSID_AUTOCHECKIN_FLAG, AutoCheckinFlag, 76 VSID_ENDFIELD); 77 if (rc) 78 { 79 vst_print_typecapacity(h); 80 } 81 VS_TypeCapacity_Destroy(h); 82 } 83 return(rc); 84 }

Page 495 of the ADIC 601355 Rev A user manual — See Also
Page 495 · click to enlarge
Page 495

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_TypeCapacity_Create(l),
  • VS_TypeCapacity_GetFields(l),
  • VS_TypeCapacity_SetFields(l)
Page 496 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_OPTION*)
Page 496 · click to enlarge
Page 496

VS_ TypeCapacity _GetFields

VS_TypeCapacity_GetFields retrieves information from a type capacity handle. A type capacity handle is used to pass archive type capacity information from VolServ in response to an Archive Query command request with the type capacity option specified.

Synopsis VST_BOOLEAN VS_TypeCapacity_GetFields (VST_TYPECAPACITY_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The type capacity handle where information is retrieved.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by a pointer to a location where the value of the parameter may be stored. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_OPTION*)

Pointer to the action taken by VolServ when the number of media of this media type classification reaches the high mark threshold (migrate, notify, or none) in the archive. Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 497 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS)
Page 497 · click to enlarge
Page 497

VSID_ASSIGNED_BINS (VST_COUNT *) Pointer to the number of bins to be assigned to this media type classification within the archive.

VSID_AUTOIMPORT_FLAG (VST_BOOLEAN *)

Pointer to a flag indicating whether automatic import is allowable for the archive.

VSID_AUTOCHECKIN_FLAG (VST_BOOLEAN *)

Pointer to a flag indicating whether automatic checkin is active for the archive.

VSID_BATCH_NAME (VST_BATCH_NAME) Pointer to the batch name to be assigned to automatically imported/checked in media. Valid batch names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY *) Pointer to the maximum number of media of this media type classification that can be in this archive.

VSID_FILL_LEVEL (VST_FILL_LEVEL *) Pointer to the current number of media of this media type classification in this archive.

VSID_HIGH_MARK (VST_HIGH_MARK *) Pointer to the percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated.

VSID_LOW_MARK (VST_LOW_MARK *) Pointer to the percentage of VSID_CAPACITY below which the specified migration policy option is performed or terminated.

VSID_MANUFACTURER (VST_MANUFACTURER_NAME)

Pointer to the manufacturer to be assigned to automatically imported/checked in media. Valid manufacturer names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS)

Pointer to the MediaClass classification where automatically imported/checked in media are assigned.

Parameter Type Description

Page 498 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 498 · click to enlarge
Page 498

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Pointer to the name of this media type classification. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Return Values VS_TypeCapacity_GetField returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_print_typecapacity 4 * 5 * PURPOSE: 6 * This function prints out the information stored 7 * in a type capacity handle. 8 * 9 * PARAMETERS: 10 * h : the type capacity handle to print 11 * 12 **************************************** *********/

Parameter Type Description · Example 1 /****************************************

Page 499 of the ADIC 601355 Rev A user manual — Return Values
Page 499 · click to enlarge
Page 499

13 #ifdef ANSI_C 14 void

vst_print_typecapacity(VST_TYPECA PACITY_HANDLEh) 15 #else 16 void vst_print_typecapacity(h) 17 VST_TYPECAPACITY_HANDLE h; 18 #endif 19 { 20 VST_MEDIA_TYPE_NAME

MediaType; 21 VST_CAPACITY Capacity; 22 VST_HIGH_MARK

ImportClass; 32 33 VS_TypeCapacity_GetFields(h, 34 VSID_MEDIA_TYPE_NAME, MediaType, 35 VSID_MEDIA_CLASS_NAME, ImportClass, 36 VSID_BATCH_NAME, ImportBatch, 37 VSID_MANUFACTURER, ImportManufacturer,

Show 9 more labels / short text on this page
HighMarkPercent; 23 VST_LOW_MARK · LowMarkPercent; 24 VST_FILL_LEVEL · FillLevel; 25 int · AssignedBins; 26 VST_ARCHIVE_ACTION_OPTION · ActionOpt; 27 VST_BOOLEAN · AutoCheckinFlag; 28 VST_BOOLEAN · AutoImportFlag; 29 VST_BATCH_NAME · ImportBatch; 30 VST_MANUFACTURER_NAME · ImportManufacturer; 31 VST_MEDIA_CLASS_NAME
Page 500 of the ADIC 601355 Rev A user manual — Return Values
Page 500 · click to enlarge
Page 500

38 VSID_CAPACITY, &Capacity, 39 VSID_HIGH_MARK, &HighMarkPercent, 40 VSID_LOW_MARK, &LowMarkPercent, 41 VSID_FILL_LEVEL, &FillLevel, 42 VSID_ASSIGNED_BINS, &AssignedBins, 43 VSID_ARCHIVE_ACTION, &ActionOpt, 44 VSID_AUTOIMPORT_FLAG, &AutoImportFlag, 45 VSID_AUTOCHECKIN_FLAG, &AutoCheckinFlag, 46 VSID_ENDFIELD); 47 printf(“******* Type Capacity Handle

*******\n”); 48 printf(“Media type = %s\n”,

MediaType); 49 printf(“Capacity = %d\n”, Capacity); 50 printf(“High Mark Percent = %d\n”,

HighMarkPercent); 51 printf(“Low Mark Percent = %d\n”,

LowMarkPercent); 52 printf(“Fill Level = %d\n”,

FillLevel); 53 printf(“Assigned Bins = %d\n”,

AssignedBins); 54 printf(“Archive Action Option =

%d\n”, ActionOpt); 55 printf(“Auto Checkin = %d\n”,

AutoCheckinFlag); 56 printf(“Auto Import = %d\n”,

AutoImportFlag); 57 printf(“Import Class = %s\n”,

ImportClass); 58 printf(“Import Batch = %s\n”,

ImportBatch); 59 printf(“Import Manufacturer = %s\n”,

ImportManufacturer);

Page 501 of the ADIC 601355 Rev A user manual — Note
Page 501 · click to enlarge
Page 501

When the number of media in a media type classification reaches the high mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy option is set to notify.
  • Initiates automatic migration of media if the migration policy is set to migrate.

When the number of media in a media type classification drops to the low mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy is set to notify.
  • Terminates automatic migration of media if the migration policy is set to migrate.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

60 }

Page 502 of the ADIC 601355 Rev A user manual — See Also
Page 502 · click to enlarge
Page 502

See Also • vsapi(l),

  • VS_Archive_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_TypeCapacity_Create(l),
  • VS_TypeCapacity_Destroy(l),
  • VS_TypeCapacity_SetFields(l),
  • VSCMD_ArchiveQuery(l)
Page 503 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_OPTION)
Page 503 · click to enlarge
Page 503

VS_ TypeCapacity _SetFields

VS_TypeCapacity_SetFields sets the value of one or more fields in a type capacity handle. A type capacity handle is used to pass archive type capacity information to and from VolServ.

Synopsis VST_BOOLEAN VS_TypeCapacity_SetFields (VST_TYPECAPACITY_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The type capacity handle where information is stored or updated.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to store. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_OPTION)

Action taken by VolServ when the number of media of this media type classification reaches the high mark threshold (migrate, notify, or none). Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

VSID_ASSIGNED_BINS (VST_COUNT) Number of bins to be assigned to the media type classification within the archive.

Parameters · Parameter Type Description

Page 504 of the ADIC 601355 Rev A user manual — VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)
Page 504 · click to enlarge
Page 504

VSID_AUTOCHECKIN_FLAG (VST_BOOLEAN)

Flag indicating whether automatic checkin is active for the archive.

VSID_AUTOIMPORT_FLAG (VST_BOOLEAN)

Flag indicating whether automatic import is active for the archive.

VSID_BATCH_NAME (VST_BATCH_NAME) Batch name to be assigned to automatically imported/checked in media. Valid batch names may contain 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY) Maximum number of media of this media type classification that can be in this archive.

VSID_FILL_LEVEL (VST_FILL_LEVEL) Current number of media of this media type classification in this archive.

VSID_HIGH_MARK (VST_HIGH_MARK) Percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated.

VSID_LOW_MARK (VST_LOW_MARK) Percentage of VSID_CAPACITY below which the specified migration policy option is performed or terminated.

VSID_MANUFACTURER (VST_MANUFACTURER_NAME)

Manufacturer to be assigned to automatically imported/checked in media. Valid manufacturer names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS)

MediaClass group where automatically imported/checked in media are assigned.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Name of this media type classification. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Parameter Type Description

Page 505 of the ADIC 601355 Rev A user manual — Return Values
Page 505 · click to enlarge
Page 505

Return Values VS_TypeCapacity_SetFields returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADHANDLE - Specified handle was not a type capacity handle.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_typecapacity_handle 4 * 5 * PURPOSE: 6 * This function tests a typecapacity handle. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Example 1 /**************************************** · vst_typecapacity_handle(void) 14 #else

Page 506 of the ADIC 601355 Rev A user manual — 15 VST_BOOLEAN
Page 506 · click to enlarge
Page 506

15 VST_BOOLEAN

vst_typecapacity_handle() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_TYPECAPACITY_HANDLE h; 20 VST_MEDIA_TYPE_NAME

MediaType; 21 VST_CAPACITY Capacity; 22 VST_HIGH_MARK

FillLevel; 25 int AssignedBins; 26 VST_ARCHIVE_ACTION_OPTION

ImportClass; 32 33 /* create the handle */ 34 h = vS_TypeCapacity_Create(); 35 if (h != (VST_TYPECAPACITY_HANDLE)

NULL) 36 { 37 /* get values from user */ 38 printf(“Enter media type name ==> “); 39 gets(MediaType); 40 printf(“Enter import class ==> “); 41 gets(ImportClass); 42 printf(“Enter import batch ==> “);

Show 7 more labels / short text on this page
HighMarkPercent; 23 VST_LOW_MARK · LowMarkPercent; 24 VST_FILL_LEVEL · ActionOpt; 27 VST_BOOLEAN · AutoCheckinFlag; 28 VST_BOOLEAN · AutoImportFlag; 29 VST_BATCH_NAME · ImportBatch; 30 VST_MANUFACTURER_NAME · ImportManufacturer; 31 VST_MEDIA_CLASS_NAME
Page 507 of the ADIC 601355 Rev A user manual — Return Values
Page 507 · click to enlarge
Page 507

43 gets(ImportBatch); 44 printf(“Enter import manufacturer ==> “); 45 gets(ImportManufacturer); 46 printf(“Enter capacity ==> “); 47 Capacity = atoi(gets(input)); 48 printf(“Enter high mark percent ==> “); 49 HighMarkPercent = atoi(gets(input)); 50 printf(“Enter low mark percent ==> “); 51 LowMarkPercent = atoi(gets(input)); 52 printf(“Enter fill level ==> “); 53 FillLevel = atoi(gets(input)); 54 printf(“Enter number of assigned bins ==> “); 55 AssignedBins = atoi(gets(input)); 56 printf(“Enter archive action option ==> “); 57 ActionOpt = atoi(gets(input)); 58 printf(“Enter auto import flag ==> “); 59 AutoImportFlag = atoi(gets(input)); 60 printf(“Enter auto checkin flag ==> “); 61 AutoCheckinFlag = atoi(gets(input)); 62 /* set the fields */ 63 rc = VS_TypeCapacity_SetFields(h, 64 VSID_MEDIA_TYPE_NAME, MediaType, 65 VSID_MEDIA_CLASS_NAME, ImportClass, 66 VSID_BATCH_NAME, ImportBatch, 67 VSID_MANUFACTURER, ImportManufacturer, 68 VSID_CAPACITY, Capacity,

Page 508 of the ADIC 601355 Rev A user manual — Notes
Page 508 · click to enlarge
Page 508

69 VSID_HIGH_MARK, HighMarkPercent, 70 VSID_LOW_MARK, LowMarkPercent, 71 VSID_FILL_LEVEL, FillLevel, 72 VSID_ASSIGNED_BINS, AssignedBins, 73 VSID_ARCHIVE_ACTION, ActionOpt, 74 VSID_AUTOIMPORT_FLAG, AutoImportFlag, 75 VSID_AUTOCHECKIN_FLAG, AutoCheckinFlag, 76 VSID_ENDFIELD); 77 if (rc) 78 { 79 vst_print_typecapacity(h); 80 } 81 VS_TypeCapacity_Destroy(h); 82 } 83 return(rc); 84 }

When the number of media in a media type classification reaches the high mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy option is set to notify.
  • Initiates automatic migration of media if the migration policy is set to migrate.

When the number of media in a media type classification drops to the low mark threshold, VolServ:

Page 509 of the ADIC 601355 Rev A user manual — Note
Page 509 · click to enlarge
Page 509
  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy is set to notify.
  • Terminates automatic migration of media if the migration policy is set to migrate.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_TypeCapacity_Create(l),
  • VS_TypeCapacity_Destroy(l),
  • VS_TypeCapacity_GetFields(l)
Page 510 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 510 · click to enlarge
Page 510

VSCMD_ ArchiveQuery

VSCMD_ArchiveQuery queries for information associated with a VolServ archive.

Upon receipt of an Archive Query command, VolServ obtains information about the specified archive. This information is returned to the client in the status of the command.

Synopsis VST_BOOLEAN VSCMD_ArchiveQuery (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Archive Query command.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this command. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to be queried. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Parameters · Parameter Type Description

Page 511 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 511 · click to enlarge
Page 511

VSID_ARCHIVE_QUERY_OPTION (VST_ARCHIVE_QUERY_OPTION)

Specifies the type (or types) of archive information being requested. Valid VSID_ARCHIVE_QUERY_OPTION values are defined in the vs_defs.h file. Multiple values can be specified by connecting them with the “|” operator.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for a single archive or for all archives. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software is to wait for final status) and VSE_FALSE (API software is not to wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE).

Parameter Type Description

Page 512 of the ADIC 601355 Rev A user manual — Return Values
Page 512 · click to enlarge
Page 512

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this ArchiveQuery command request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ArchiveQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 513 of the ADIC 601355 Rev A user manual — Return Values
Page 513 · click to enlarge
Page 513
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 514 of the ADIC 601355 Rev A user manual — Example
Page 514 · click to enlarge
Page 514

********* 2 * 3 * FUNCTION: vst_archivequery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ArchiveQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_archivequery_execute(void) 14 #else 15 VST_BOOLEAN

vst_archivequery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 int ok; 20 VST_QUERY_OPTION queryopt; 21 VST_ARCHIVE_QUERY_OPTION

arcqueryopt; 22 VST_ARCHIVE_NAME archive; 23 VST_COMMAND_HANDLE cmd; 24 25 /* get parameters from user */ 26 printf( “*** Archive Query parameters

***\n” ); 27 printf(“Query all archives? (1) yes,

(0) no“); 28 queryopt = (VST_QUERY_OPTION)

atoi(gets(input)); 29 30 if (queryopt == 0) 31 {

Example 1 /****************************************

Page 515 of the ADIC 601355 Rev A user manual — Example
Page 515 · click to enlarge
Page 515

32 printf( “\nEnter Archive Name ==>”); 33 gets(archive); 34 } 35 else 36 { 37 strcpy(archive, VSD_STRING_INIT); 38 } 39 /* Initialize the Archive Query

Option */ 40 arcqueryopt =

VSD_ARCQRY_OPTION_NONE; 41 printf( “query drive information? (1)

yes, (0) no: “); 42 ok = atoi(gets(input)); 43 if (ok) 44 { 45 /* Add the option to query for */ 46 /* drive information */ 47 arcqueryopt += VSD_ARCQRY_OPTION_DRIVE; 48 } 49 50 printf( “query media information? (1)

yes, (0) no: “); 51 ok = atoi(gets(input)); 52 if (ok) 53 { 54 /* add the option to query for media */ 55 /* information */ 56 arcqueryopt += VSD_ARCQRY_OPTION_MEDIA; 57 } 58 59 printf( “query media class

information? (1) yes, (0) no: “); 60 ok = atoi(gets(input)); 61 if (ok) 62 { 63 /* add the option to query media class */

Page 516 of the ADIC 601355 Rev A user manual — Example
Page 516 · click to enlarge
Page 516

64 /* information */ 65 arcqueryopt += VSD_ARCQRY_OPTION_CLASS; 66 } 67 68 printf( “query media type

information? (1) yes, (0) no: “); 69 ok = atoi(gets(input)); 70 if (ok) 71 { 72 /* add the option to query media type */ 73 /* information */ 74 arcqueryopt += VSD_ARCQRY_OPTION_TYPE; 75 } 76 /* create the command handle */ 77 /* Note that the command handle is

not destroyed in */ 78 /* this routine, but in vst_dispatch

when final */ 79 /* status is received. */ 80 cmd = VS_Command_Create(); 81 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 82 { 83 /* Send the command to the VolServ. */ 84 /* Note that status is not processed here. */ 85 /* Instead, it is processed in the */ 86 /* vst_dispatch routine. Also, note that */ 87 /* default values such as timeout, value */ 88 /* retry limit parameters and priority are */ 89 /* set as default parameters. */ 90 if (queryopt == VSE_QUERY_OPTION_ALL) 91 {

Page 517 of the ADIC 601355 Rev A user manual — Notes
Page 517 · click to enlarge
Page 517

92 /* query all archives */ 93 rc = VSCMD_ArchiveQuery(cmd, 94 VSID_QRY_OPTION, queryopt, 95 VSID_ARCHIVE_QRY_OPTION, arcqueryopt, 96 VSID_ENDFIELD); 97 } 98 else 99 { 100 /* query a specific archive */ 101 rc = VSCMD_ArchiveQuery(cmd, 102 VSID_QRY_OPTION, queryopt, 103 VSID_ARCHIVE_QRY_OPTION, arcqueryopt, 104 VSID_ARCHIVE_NAME, archive, 105 VSID_ENDFIELD); 106 } 107 } 108 return ( rc ); 109}

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the API cannot receive status for this request.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

VolServ generates intermediate status in response to an Archive Query request if:

Page 518 of the ADIC 601355 Rev A user manual — Tip
Page 518 · click to enlarge
Page 518
  • Information is being requested for more than one archive.
  • Any archive query option is specified.

Archive Query statuses are cumulative. Each status is added to the previous status; therefore, after the final status, the status handle contains all needed information.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Archive Query command are set with VSCMD_ArchiveQuery_SetDefaults . If command-specific defaults are set for the Archive Query command, they override the global defaults for all Archive Query requests.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Archive Query request, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

The following fields can be retrieved from the status handle after a successful Archive Query request:

  • VSID_ARCHIVE_HANDLE ,
  • VSID_ARCHIVE_HANDLE_ENTRY ,
  • VSID_ARCHIVE_HANDLE_TABLE ,
  • VSID_QUERY_OPTION , VSID_SEQUENCE_NUM ,
Page 519 of the ADIC 601355 Rev A user manual — Note
Page 519 · click to enlarge
Page 519
  • VSID_SEQUENCE_TABLE , VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

VSCMD_ArchiveQuery does not trigger any MediaClass callbacks from VolServ.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Archive_GetFields(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Global_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_ArchiveQuery_SetDefaults(l)
Page 520 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ArchiveQuery_SetDefaults ( “…”, VSID_ENDFIELD)
Page 520 · click to enlarge
Page 520

VSCMD_ ArchiveQuery _SetDefaults

VSCMD_ArchiveQuery_SetDefaults sets the command-level default parameters for Archive Query command requests.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Archive Query command are set with VSCMD_ArchiveQuery_SetDefaults . If command-specific defaults are set for the Archive Query command, they override the global defaults for all Archive Query requests.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Archive Query request, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

Synopsis VST_BOOLEAN VSCMD_ArchiveQuery_SetDefaults ( “…”, VSID_ENDFIELD)

Page 521 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 521 · click to enlarge
Page 521

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to be queried on all Archive Query requests. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ARCHIVE_QUERY_OPTION (VST_ARCHIVE_QUERY_OPTION)

Type (or types) of information being requested on Archive Query requests. Valid VSID_ARCHIVE_QUERY_OPTION values are defined in the vs_defs.h file. Multiple values may be specified by connecting them with the “|” operator.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Archive Query requests.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Archive Query requests.

VSID_PRIORITY (VST_PRIORITY) Execution priority for Archive Query requests. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 522 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 522 · click to enlarge
Page 522

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for a single specified archive or for all archives. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Archive Query requests. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software is to wait for final status from VolServ (or to time-out) for Archive Query requests. Valid options are VSE_TRUE (API software is to wait for final status) and VSE_FALSE (API software is not to wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE).

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for every Archive Query command request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Archive Query requests. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 523 of the ADIC 601355 Rev A user manual — Return Values
Page 523 · click to enlarge
Page 523

Return Values VSCMD_ArchiveQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_archivequery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_ArchiveQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_archivequery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_archivequery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE;

Example 1 /****************************************

Page 524 of the ADIC 601355 Rev A user manual — Note
Page 524 · click to enlarge
Page 524

20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Archive Query default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_ArchiveQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 525 of the ADIC 601355 Rev A user manual — See Also
Page 525 · click to enlarge
Page 525

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ArchiveQuery(l)
Page 526 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ArchiveVary (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 526 · click to enlarge
Page 526

VSCMD_ ArchiveVary

VSCMD_ArchiveVary changes the state of a VolServ configured archive. Name of the archive and the target state must be specified.

Upon receipt of a VSCMD_ArchiveVary command, VolServ attempts to change the state of the specified archive. The return code presented to the client indicates the success or failure of the command.

Synopsis VST_BOOLEAN VSCMD_ArchiveVary (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Archive Vary command.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to apply to this command. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 527 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 527 · click to enlarge
Page 527

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to be varied. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on this command.

VSID_COMP_STATE (VST_COMP_STATE) State where the archive is varied. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Valid options are VSE_TRUE (API software is to wait for final status) and VSE_FALSE (API software is not to wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE).

Parameters · Parameter Type Description

Page 528 of the ADIC 601355 Rev A user manual — Return Values
Page 528 · click to enlarge
Page 528

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in the USER_FIELD for this command. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ArchiveVary returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 529 of the ADIC 601355 Rev A user manual — Return Values
Page 529 · click to enlarge
Page 529
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 530 of the ADIC 601355 Rev A user manual — Example
Page 530 · click to enlarge
Page 530

********* 2 * 3 * FUNCTION: vst_archivevary_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ArchiveVary API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_archivevary_execute(void) 14 #else 15 VST_BOOLEAN

vst_archivevary_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_ARCHIVE_NAME archive; 20 VST_COMP_STATE state; 21 VST_COMMAND_HANDLE cmd; 22 23 /* get parameters from user */ 24 printf(“*** Archive Vary parameters

***\n” ); 25 printf(“\nEnter Archive “); 26 gets(archive); 27 printf(“\nEnter Archive State (1)

ONLINE (2) OFFLINE (3) DIAG“); 28 state = (VST_COMP_STATE)

atoi(gets(input)); 29 30 /* create the command handle */ 31 /* Note that the command handle is

not */ 32 /* destroyed in this routine, but in

Example 1 /**************************************** · */

Page 531 of the ADIC 601355 Rev A user manual — Notes
Page 531 · click to enlarge
Page 531

33 /* vst_dispatch when final status is

received. */ 34 cmd = VS_Command_Create(); 35 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 36 { 37 /* Send the command to the VolServ. */ 38 /* Note that status is not processed here. */ 39 /* Instead, it is processed in the */ 40 /* vst_dispatch routine. Also, note that */ 41 /* default values such as timeout, value */ 42 /* retry limit and priority are set as */ 43 /* default parameters.*/ 44 rc = VSCMD_ArchiveVary(cmd, 45 VSID_COMP_STATE, state, 46 VSID_ARCHIVE_NAME, archive, 47 VSID_ENDFIELD); 48 } 49 return ( rc ); 50 }

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the API is not able to receive status for this request.

Page 532 of the ADIC 601355 Rev A user manual — Tip
Page 532 · click to enlarge
Page 532

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Archive Vary command are set with VSCMD_ArchiveVary_SetDefaults . If command-specific defaults are set for the Archive Vary command, they override the global defaults for all Archive Vary requests.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Archive Vary request, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

The following fields can be retrieved from the status handle after a successful reprioritize request:

  • VSID_ARCHIVE_NAME ,
  • VSID_COMP_STATE ,
  • VSID_SEQUENCE_NUMBER ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
Page 533 of the ADIC 601355 Rev A user manual — Note
Page 533 · click to enlarge
Page 533
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

VolServ does not generate intermediate status in response to an Archive Vary request.

VSCMD_ArchiveVary does not trigger any MediaClass callbacks from VolServ.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Status_GetFields(l),
  • VSCMD_ArchiveVary_SetDefaults(l)
Page 534 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ArchiveVary_SetDefaults ( “…”, VSID_ENDFIELD)
Page 534 · click to enlarge
Page 534

VSCMD_ ArchiveVary_ SetDefaults

VSCMD_ArchiveVary_SetDefaults sets the command-level default parameters for Archive Vary command requests.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Archive Vary command are set with VSCMD_ArchiveVary_SetDefaults . If command-specific defaults are set for the Archive Vary command, they override the global defaults for all Archive Vary requests.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Archive Vary request, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

Synopsis VST_BOOLEAN VSCMD_ArchiveVary_SetDefaults ( “…”, VSID_ENDFIELD)

Page 535 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 535 · click to enlarge
Page 535

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to be varied on Archive Vary requests. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Archive Vary requests.

VSID_COMP_STATE (VST_COMP_STATE) State where the archive is varied on Archive Vary requests. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on Archive Vary requests.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Archive Vary requests. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 536 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 536 · click to enlarge
Page 536

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Archive Vary requests. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software is to wait for final status from VolServ (or to timeout) for a command. Valid options are VSE_TRUE (API is to wait for final status) and VSE_FALSE (API is not to wait for final status). Valid options are VSE_TRUE (API software is to wait for final status) and VSE_FALSE (API software is not to wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE).

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for every Archive Vary command request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 537 of the ADIC 601355 Rev A user manual — Return Values
Page 537 · click to enlarge
Page 537

Return Values VSCMD_ArchiveVary_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_archivevary_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_ArchiveVary API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_archivevary_defaults(void) 15 #else 16 VST_BOOLEAN

vst_archivevary_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority;

Example 1 /****************************************

Page 538 of the ADIC 601355 Rev A user manual — Note
Page 538 · click to enlarge
Page 538

21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Archive Vary default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_ArchiveVary_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 539 of the ADIC 601355 Rev A user manual — See Also
Page 539 · click to enlarge
Page 539

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ArchiveVary(l)
Page 540 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Audit (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 540 · click to enlarge
Page 540

VSCMD_Audit VSCMD_Audit performs archive inventory verification of the specified archive.

  • If the specified archive is robotically controlled, the robot scans each physical bin location and verifies that the database is consistent with the actual location of media. Any detected inconsistencies are returned to the client, logged in a system log file, and VolServ take appropriate action based on the circumstances of the discrepancy.
  • On the other hand, if the specified archive is a manual archive, the archive operator is directed to generate the audit report. The operator may then request the report be printed or verify the information on-line. Either way, the operator must actually perform the inventory and then correct any reported discrepancies. Discrepancies are resolved by issuing appropriate media management commands (for example, Move and Eject commands) to relocate media to the reported locations. Inconsistencies detected in a manual archive are not reported to the client.

Audit requests are for full archive audits only; no subset audits are permitted from the API. Subset audits are conducted from the system operator GUI. Full archive audits can be lengthy and must be requested with discretion.

Synopsis VST_BOOLEAN VSCMD_Audit (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Page 541 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 541 · click to enlarge
Page 541
  • Arguments
  • handle = Handle of the Audit command.
  • “…” =Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The parameter identifiers and types this function accepts are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to audit. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Client dispatch routine for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 542 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 542 · click to enlarge
Page 542

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software is to wait for final status) and VSE_FALSE (API software is not to wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE).

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this Audit request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Audit returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode. - Good initial status received if the API is operating in asynchronous mode. • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

Parameter Type Description

Page 543 of the ADIC 601355 Rev A user manual — Return Values
Page 543 · click to enlarge
Page 543

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code. - If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred. • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.

  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error. - If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error. • VSE_ERR_BADFIELD - An invalid parameter was specified.

  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 544 of the ADIC 601355 Rev A user manual — Example
Page 544 · click to enlarge
Page 544

********* 2 * 3 * FUNCTION: vst_audit_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Audit API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_audit_execute(void) 14 #else 15 VST_BOOLEAN vst_audit_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_ARCHIVE_NAME archive; 20 VST_COMMAND_HANDLE cmd; 21 22 /* get parameters from user */ 23 printf(“*** Audit parameters ***\n”

); 24 printf(“Enter Archive Name ==> “ ); 25 gets(archive); 26 27 /* create the command handle */ 28 /* Note that the command handle is

not */ 29 /* destroyed in this routine, but in

*/ 30 /* vst_dispatch when finalstatus is

received. */ 31 cmd = VS_Command_Create(); 32 if (cmd != (VST_COMMAND_HANDLE )NULL) 33 { 34 /* Send the command to the VolServ software. */

Example 1 /****************************************

Page 545 of the ADIC 601355 Rev A user manual — Notes
Page 545 · click to enlarge
Page 545

35 /* Note that status is not processed here. */ 36 /* Instead, it is processed in the */ 37 /* vst_dispatch routine. Also, note that */ 38 /* default values such as timeout, value */ 39 /* retry limit and priority are set as*/ 40 /* default parameters. */ 41 rc = VSCMD_Audit(cmd, 42 VSID_ARCHIVE_NAME, archive, 43 VSID_ENDFIELD); 44 } 45 return ( rc ); 46 }

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE. Because of the time required for robotic audits, the time-out value or retries may need to be increased from the API default values.

VolServ can generate intermediate status in response to an Audit request.

VSCMD_Audit can trigger MediaClass callbacks from VolServ.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the API is not able to receive status for this request.

Page 546 of the ADIC 601355 Rev A user manual — Tip
Page 546 · click to enlarge
Page 546

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system. With the exceptions of the manual archives, a pending or executing Audit command can be cancelled using the VolServ Cancel command.

A pending or executing Audit command can be reprioritized using the VolServ Reprioritize command.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Audit command are set with VSCMD_Audit_SetDefaults . If command-specific defaults are set for the Audit command, they override the global defaults for all Audit requests.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Audit request, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

The following fields can be retrieved from the status handle after a successful Audit:

  • VSID_ACTION_CODE ,
  • VSID_ACTION_CODE_ENTRY ,
  • VSID_ACTION_CODE_TABLE ,
  • VSID_COMP_ID ,
Page 547 of the ADIC 601355 Rev A user manual — Note
Page 547 · click to enlarge
Page 547
  • VSID_COMP_ID_ENTRY ,
  • VSID_COMP_ID_TABLE ,
  • VSID_ERROR ,
  • VSID_ERROR_ENTRY ,
  • VSID_ERROR_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD ,
  • VSID_WAIT_REASON .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 548 of the ADIC 601355 Rev A user manual — See Also
Page 548 · click to enlarge
Page 548
  • See Also
  • vsapi(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Initialize(l),
  • VS_Media_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_Audit_SetDefaults(l)
Page 549 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Audit_SetDefaults ( “…”, VSID_ENDFIELD)
Page 549 · click to enlarge
Page 549

VSCMD_Audit _SetDefaults

VSCMD_Audit_SetDefaults sets command-level default parameters for Audit commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Audit commands are set with VSCMD_Audit_SetDefaults . If command-specific defaults are set for Audit commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Audit command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Audit_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 550 of the ADIC 601355 Rev A user manual — VSCMD_Audit _SetDefaults
Page 550 · click to enlarge
Page 550
Page 550 of the ADIC 601355 Rev A user manual — VSCMD_Audit _SetDefaults
Page 551 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 551 · click to enlarge
Page 551
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to audit. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive intermediate and final status for Audit commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for Audit commands.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Audit commands.Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Audit commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameters · Parameter Type Description

Page 552 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 552 · click to enlarge
Page 552

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Audit commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to be put in USER_FIELD for Audit commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Audit commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Audit_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 553 of the ADIC 601355 Rev A user manual — Example
Page 553 · click to enlarge
Page 553
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_audit_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Audit API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_audit_defaults(void) 15 #else 16 VST_BOOLEAN vst_audit_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Audit default parameters

***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */

Example 1 /****************************************

Page 554 of the ADIC 601355 Rev A user manual — Note
Page 554 · click to enlarge
Page 554

31 rc = VSCMD_Audit_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Audit(l)
Page 555 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Cancel (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 555 · click to enlarge
Page 555

VSCMD_ Cancel

VSCMD_Cancel stops a pending request from executing or aborts an executing Audit request.

Upon receipt of a Cancel request, VolServ returns final status to the client that requested the cancellation. If the specified request is capable of being cancelled, a good status is returned. Otherwise, a status that indicates why the request cannot be cancelled is returned.

If the specified request is pending execution, the request is directed to terminate after any allocated resources are released. A final status that indicates “failure due to cancellation” is sent to the original issuer of the cancelled request.

Upon receipt of a Cancel request of an executing Audit request, the processing is directed to abort, and the remainder of the Audit request is cancelled. A final status that indicates “failure due to cancellation” is sent to the original issuer of the cancelled request.

To issue a valid Cancel request, the client must supply the request identifier and request type of the request to be canceled. The VSCMD_Cancel function can either take these parameters separately or retrieve them from a command handle.

Synopsis VST_BOOLEAN VSCMD_Cancel (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Page 556 of the ADIC 601355 Rev A user manual — VSID_REQUEST_TYPE (VST_REQUEST_TYPE)
Page 556 · click to enlarge
Page 556

Arguments • handle = The command handle for this Cancel request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMMAND_HANDLE (VST_COMMAND_HANDLE)

The command handle of the request to cancel.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_REQUEST_ID (VST_REQUEST_ID) The request identifier of the request to cancel.

VSID_REQUEST_TYPE (VST_REQUEST_TYPE)

The request type of the request to cancel. Valid VSID_REQUEST_TYPE values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 557 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 557 · click to enlarge
Page 557

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 558 of the ADIC 601355 Rev A user manual — Return Values
Page 558 · click to enlarge
Page 558

Return Values VSCMD_Cancel returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 559 of the ADIC 601355 Rev A user manual — Example
Page 559 · click to enlarge
Page 559
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_cancel_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Cancel API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_cancel_execute(void) 14 #else 15 VST_BOOLEAN vst_cancel_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_REQUEST_ID req; 20 VST_REQUEST_TYPE c; 21 VST_COMMAND_HANDLE cmd;

Example 1 /****************************************

Page 560 of the ADIC 601355 Rev A user manual — Example
Page 560 · click to enlarge
Page 560

22 23 /* get parameters from user */ 24 printf(“*** Cancel parameters ***\n”

); 25 printf(“Enter Request ID ==> “ ); 26 req = (VST_REQUEST_ID)

atol(gets(input)); 27 printf(“Enter Command Request Type

==> “ ); 28 c = (VST_REQUEST_TYPE)

atol(gets(input)); 29 30 /* create the command handle */ 31 /* Note that the command handle is

not */ 32 /* destroyed in this routine, but in

*/ 33 /* vst_dispatch when final status is

received. */ 34 cmd = VS_Command_Create(); 35 if (cmd != (VST_COMMAND_HANDLE )NULL) 36 { 37 /* Send the command to the VolServ software. */ 38 /* Note that status is not processed here. */ 39 /* Instead, it is processed in the */ 40 /* vst_dispatch routine. Also, note that */ 41 /* default values such as timeout, value */ 42 /* retry limit and priority are set as */ 43 /* default parameters. */ 44 rc = VSCMD_Cancel(cmd, 45 VSID_REQUEST_ID, req, 46 VSID_REQUEST_TYPE, c, 47 VSID_ENDFIELD); 48 }

Page 561 of the ADIC 601355 Rev A user manual — Notes
Page 561 · click to enlarge
Page 561

49 return ( rc ); 50 }

VolServ generates no intermediate status in response to a Cancel request.

VSCMD_Cancel does not trigger any MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Cancel request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
Page 562 of the ADIC 601355 Rev A user manual — Note
Page 562 · click to enlarge
Page 562
  • Command-specific parameter defaults for Cancel commands are set with VSCMD_Cancel_SetDefaults . If command-specific defaults are set for Cancel commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Cancel command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

The following fields can be retrieved from the status handle after a successful Cancel request:

  • VSID_REQUEST_ID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 563 of the ADIC 601355 Rev A user manual — See Also
Page 563 · click to enlarge
Page 563

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Cancel_SetDefaults(l)
Page 564 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Cancel_SetDefaults ( “…”, VSID_ENDFIELD)
Page 564 · click to enlarge
Page 564

VSCMD_ Cancel_ SetDefaults

VSCMD_Cancel_SetDefaults sets command-level default parameters for Cancel commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Cancel commands are set with VSCMD_Cancel_SetDefaults . If command-specific defaults are set for Cancel commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Cancel command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

Synopsis VST_BOOLEAN VSCMD_Cancel_SetDefaults ( “…”, VSID_ENDFIELD)

Page 565 of the ADIC 601355 Rev A user manual — VSID_REQUEST_TYPE (VST_REQUEST_TYPE)
Page 565 · click to enlarge
Page 565

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Cancel commands.

VSID_COMMAND_HANDLE (VST_COMMAND_HANDLE)

The command handle of the request to cancel.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on Cancel commands.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Cancel commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_REQUEST_ID (VST_REQUEST_ID) The request identifier of the request to cancel.

VSID_REQUEST_TYPE (VST_REQUEST_TYPE)

The request type of the request to cancel. Valid VSID_REQUEST_TYPE values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Cancel commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 566 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 566 · click to enlarge
Page 566

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Indicates whether the API software waits for final status from VolServ (or times-out) for Cancel commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The total wait time for a command is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to be put in USER_FIELD for Cancel commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Cancel commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 567 of the ADIC 601355 Rev A user manual — Return Values
Page 567 · click to enlarge
Page 567

Return Values VSCMD_Cancel_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_cancel_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Cancel API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_cancel_defaults(void) 15 #else 16 VST_BOOLEAN vst_cancel_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority;

Example 1 /****************************************

Page 568 of the ADIC 601355 Rev A user manual — Note
Page 568 · click to enlarge
Page 568

21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Cancel default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Cancel_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 569 of the ADIC 601355 Rev A user manual — See Also
Page 569 · click to enlarge
Page 569

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Cancel(l)
Page 570 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Checkin (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 570 · click to enlarge
Page 570

VSCMD_ Checkin

VSCMD_Checkin checks media into the VolServ system. Only media that have been previously checked out can be checked in.

Checkin is a logical operation. After a medium is logically checked into the VolServ system, the medium must be physically entered into an archive before becoming available for client use (mounting,…).

A medium is physically entered into the VolServ system via the Enter functionality available from the appropriate archive's console display. The Enter functionality is not available through the API interface.

If a destination archive is not specified on a VSCMD_Checkin request, the media are returned to the archive where they were checked-out.

Synopsis VST_BOOLEAN VSCMD_Checkin (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Checkin request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 571 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 571 · click to enlarge
Page 571

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive where the specified media are to be checked-in. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_MEDIA_ID_LIST (int) Number of media to check-in.

(char **) An array of the identifiers of the media to check-in.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 572 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 572 · click to enlarge
Page 572

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_CheckIn returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The request failed.A return code of VSE_FALSE (which is 0) means the request failed.

Parameter Type Description

Page 573 of the ADIC 601355 Rev A user manual — Return Values
Page 573 · click to enlarge
Page 573

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
Page 574 of the ADIC 601355 Rev A user manual — Example
Page 574 · click to enlarge
Page 574
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_checkin_execute 4 * 5 * PURPOSE: 6 * This function sends a checkin command to the 7 * VolServ software, prompting for all values needed. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_checkin_execute(void) 15 #else 16 VST_BOOLEAN vst_checkin_execute() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 int count; 21 char * medialist[VST_MAX_ITEMS]; 22 VST_ARCHIVE_NAME archive; 23 VST_COMMAND_HANDLE cmd; 24 25 /* get parameters from user */ 26 printf(“*** Check-in parameters

***\n” ); 27 printf(“\nEnter Archive name (return

Example 1 /**************************************** · for default) “);

Page 575 of the ADIC 601355 Rev A user manual — Example
Page 575 · click to enlarge
Page 575

28 gets( archive); 29 count = vst_getmedialist(medialist,

VST_MAX_ITEMS); 30 /* create the command handle Note

that the */ 31 /* command handle is not destroyed in

this*/ 32 /* routine, but in vst_dispatch when

final */ 33 /* status is received. */ 34 cmd = VS_Command_Create(); 35 /* validate the command handle */ 36 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 37 { 38 /* Send the command to the VolServ software. */ 39 /* Note that status is not processed here. */ 40 /* Instead, it is processed in the */ 41 /* vst_dispatch routine. *Also, note that */ 42 /* default values such as timeout, value */ 43 /* retry limit and priority are set as */ 44 /* default parameters. */ 45 rc = VSCMD_Checkin(cmd, 46 VSID_ARCHIVE_NAME, archive, 47 VSID_MEDIA_ID_LIST, count, medialist, 48 VSID_ENDFIELD); 49 } 50 51 return ( rc ); 52 }

Page 576 of the ADIC 601355 Rev A user manual — Notes
Page 576 · click to enlarge
Page 576

VolServ does not generate intermediate status messages for a Checkin request.

VSCMD_Checkin can trigger MediaClass callbacks from VolServ.

Media must be checked-out before they can be specified on a Checkin request.

Media checked-out of one archive can be checked into another archive, as long as the MediaClass group where the media belong are associated with archive media class(es) in the receiving archive.

Failure of a Checkin request for one medium does not fail the request for all specified media.

Media checked out from more than one archive can be checked in as a single group into a single new archive (assuming necessary archive media class associations are defined.)

Media that are checked out from more than one archive and are checked in as a single group without a target archive specified (the archive name is set to the empty string, “ “) are returned to their respective check-out archives.

The total length of time the API software waits for a command status from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

Page 577 of the ADIC 601355 Rev A user manual — Tip
Page 577 · click to enlarge
Page 577

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on a Checkin request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Checkin commands are set with VSCMD_Checkin_SetDefaults . If command-specific defaults are set for Checkin commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Checkin command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

The following fields can be retrieved from the status handle after a successful Checkin command:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY, VSID_ERROR_CODE_TABLE,
  • VSID_MEDIA_ID , V
  • SID_MEDIA_ID_ENTRY,
  • VSID_MEDIA_ID_TABLE,
Page 578 of the ADIC 601355 Rev A user manual — Note
Page 578 · click to enlarge
Page 578
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Checkin_SetDefaults(l)
Page 579 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Checkin_SetDefaults ( “…”, VSID_ENDFIELD)
Page 579 · click to enlarge
Page 579

VSCMD_ Checkin_ SetDefaults

VSCMD_Checkin_SetDefaults sets command-level default parameters for Checkin commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Checkin commands are set with VSCMD_Checkin_SetDefaults . If command-specific defaults are set for Checkin commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Checkin command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Checkin_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 580 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 580 · click to enlarge
Page 580
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive inwhere the specified media are to be checked-in. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive intermediate and final status for Checkin commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for Checkin commands.

VSID_MEDIA_ID_LIST (int) Number of media to check-in.

(char **) An array of the identifiers of the media to check-in.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Checkin commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Checkin commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 581 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 581 · click to enlarge
Page 581

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Checkin commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The total wait time for a command is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Checkin commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this Checkin command. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Checkin_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 582 of the ADIC 601355 Rev A user manual — Example
Page 582 · click to enlarge
Page 582
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_checkin_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Checkin API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** **********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_checkin_defaults(void) 15 #else 16 VST_BOOLEAN vst_checkin_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 int count; 21 VST_PRIORITY priority; 22 VST_USER_FIELD user_field; 23 VST_TIME_OUT timeout; 24 VST_RETRY_LIMIT retries; 25 VST_STATUS_WAIT_FLAG wait_flag; 26 VST_ENTERPRISE_ID enterprise_id; 27 char

archive[VSD_ARCHIVE_NAME_LEN]; 28 29 /* get parameters from user */ 30 printf(“*** Check-in default

Example 1 /**************************************** · parameters ***\n” );

Page 583 of the ADIC 601355 Rev A user manual — Note
Page 583 · click to enlarge
Page 583

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 32 printf(“\nEnter Archive “); 33 gets( archive); 34 /* set the default parameters */ 35 rc = VSCMD_Checkin_SetDefaults( 36 VSID_PRIORITY, priority, 37 VSID_USER_FIELD, user_field, 38 VSID_TIMEOUT_VALUE, timeout, 39 VSID_RETRY_LIMIT, retries, 40 VSID_STATUS_WAIT_FLAG, wait_flag, 41 VSID_ENTERPRISE_ID, enterprise_id, 42 VSID_ARCHIVE_NAME, archive, 43 VSID_ENDFIELD); 44 45 return ( rc ); 46 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Checkin(l)

31 vst_promptforglobals(&priority,

Page 584 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Checkout (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 584 · click to enlarge
Page 584

VSCMD_ Checkout

VSCMD_Checkout checks media out of the VolServ system. Media that are checked out are still known by VolServ, but are unavailable for client allocation.

Upon receipt of a Checkout request, VolServ marks the specified media for check out. If the specified media are contained in archives, VolServ adds the media to the eject candidate list of the containing archive. An operator must select the Eject functionality from the appropriate archive’s console display to physically remove the checked-out media from the containing archive. The VolServ Eject functionality is not available over the API interface.

The client may specify a comment on the VSCMD_Checkout command. This comment is displayed on the applicable archive console eject list for each medium being checked out.

Synopsis VST_BOOLEAN VSCMD_Checkout (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Checkout request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 585 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 585 · click to enlarge
Page 585

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMMENT (VST_COMMENT) The text information (comment) to appear on the appropriate archive console eject list for each medium specified for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_MEDIA_ID_LIST (int) Number of media to check-out.

(char **) An array of the identifiers of the media to check-out.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameters · Parameter Type Description

Page 586 of the ADIC 601355 Rev A user manual — Return Values
Page 586 · click to enlarge
Page 586

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Checkout returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 587 of the ADIC 601355 Rev A user manual — Return Values
Page 587 · click to enlarge
Page 587
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 588 of the ADIC 601355 Rev A user manual — Example
Page 588 · click to enlarge
Page 588

********* 2 * 3 * FUNCTION: vst_checkout_execute 4 * 5 * PURPOSE: 6 * This function sends a checkout command to the 7 * VolServ software, prompting for all values needed. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_checkout_execute(void) 15 #else 16 VST_BOOLEAN vst_checkout_execute() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 int count; 21 char * medialist[VST_MAX_ITEMS]; 22 VST_COMMENT comment; 23 VST_COMMAND_HANDLE cmd; 24 25 /* get parameters from user */ 26 printf(“*** Check-out Parameters

***\n” ); 27 printf(“\nEnter Checkout Comment “); 28 gets( comment); 29 count = vst_getmedialist(medialist,

VST_MAX_ITEMS); 30 /* create the command handle */ 31 /* Note that the command handle is

not */ 32 /* destroyed in this routine, but in

Example 1 /**************************************** · */

Page 589 of the ADIC 601355 Rev A user manual — Example
Page 589 · click to enlarge
Page 589

33 /* vst_dispatch when finalstatus is

received. */ 34 cmd = VS_Command_Create(); 35 /* validate the command handle */ 36 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 37 { 38 /* Send the command to the VolServ */ 39 /* software. Note that status is not */ 40 /* processed here. Instead, it is */ 41 /* processed it the vst_dispatch */ 42 /* routine. Also, note that default */ 43 /* values such as timeout, value retry */ 44 /* limit and priority are set as default */ 45 /* parameters. */ 46 rc = VSCMD_Checkout(cmd, 47 VSID_COMMENT, comment, 48 VSID_MEDIA_ID_LIST, count, medialist, 49 VSID_ENDFIELD); 50 } 51 52 return ( rc ); 53 }

Page 590 of the ADIC 601355 Rev A user manual — Notes
Page 590 · click to enlarge
Page 590

VolServ does not generate intermediate status messages in response to a Checkout request.

A Checkout request can trigger unsolicited status messages from VolServ.

Checked-out media are unavailable for use by VolServ clients.

Failure of a Checkout request for one medium does not fail the request for all specified media.

A medium can be checked out even if it is currently allocated. Attempts to physically eject an allocated medium fail until the medium is no longer is use.

The Checkout request only marks a specified medium for logical check out and places the medium on the appropriate archive’s Eject list. The medium is physically removed from the archive when the operator ejects the medium from the archive.

A medium marked for check out can be unmarked (removed from the Eject list) by the ClearEject request. An operator can also remove a medium from the Eject list by performing an Eject Fail operation from an archive console. The Eject Fail functionality is available over the API interface via the ClearEject request.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

Page 591 of the ADIC 601355 Rev A user manual — Tip
Page 591 · click to enlarge
Page 591

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on a Checkout request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Checkin commands are set with VSCMD_Checkout_SetDefaults . If command-specific defaults are set for Checkout commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Checkout command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Checkout request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_CODE_TABLE,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY,
  • VSID_MEDIA_ID_TABLE,
Page 592 of the ADIC 601355 Rev A user manual — Note
Page 592 · click to enlarge
Page 592
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Checkout_SetDefaults(l
Page 593 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Checkout_SetDefaults ( “…”, VSID_ENDFIELD)
Page 593 · click to enlarge
Page 593

VSCMD_ Checkout_Set Defaults

VSCMD_Checkout_SetDefaults sets the command-level default parameters for Checkout commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Checkout commands are set with VSCMD_Checkout_SetDefaults . If command-specific defaults are set for Checkout commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Checkout command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

Synopsis VST_BOOLEAN VSCMD_Checkout_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 594 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 594 · click to enlarge
Page 594
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

Name of the client dispatch routine to receive status for Checkout commands.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH )

VSID_COMMENT (VST_COMMENT) The text information (comment) to appear on the appropriate archive console Eject list for each medium specified for Checkout commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for Checkout commands.

VSID_MEDIA_ID_LIST (int) Number of media to check out with Checkout commands.

(char **) An array of the identifiers of the media to check out with Checkout commands.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Checkout commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Checkout commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 595 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 595 · click to enlarge
Page 595

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Checkout commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Checkout commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Checkout commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Checkout_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 596 of the ADIC 601355 Rev A user manual — Example
Page 596 · click to enlarge
Page 596
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_checkout_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Checkout API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_checkout_defaults(void) 15 #else 16 VST_BOOLEAN vst_checkout_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 VST_COMMENT comment; 27 28 /* get parameters from user */ 29 printf(“*** Check-out Default

Example 1 /**************************************** · Parameters ***\n” );

Page 597 of the ADIC 601355 Rev A user manual — Note
Page 597 · click to enlarge
Page 597

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 31 printf(“\nEnter Checkout Comment “); 32 gets( comment); 33 /* set the default parameters */ 34 rc = VSCMD_Checkout_SetDefaults( 35 VSID_PRIORITY, priority, 36 VSID_USER_FIELD, user_field, 37 VSID_TIMEOUT_VALUE, timeout, 38 VSID_RETRY_LIMIT, retries, 39 VSID_STATUS_WAIT_FLAG, wait_flag, 40 VSID_ENTERPRISE_ID, enterprise_id, 41 VSID_COMMENT, comment, 42 VSID_ENDFIELD); 43 44 return ( rc ); 45 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Checkout(l)

30 vst_promptforglobals(&priority,

Page 598 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ClearEject (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 598 · click to enlarge
Page 598

VSCMD_Clear Eject

VSCMD_ClearEject reverses the scheduled ejection of one or more media from an archive.

Ejects can be generated during processing of the VolServ Checkout, Export, Mount, and Move commands. Ejects can also be generated during automatic migration of media.

The ClearEject command essentially undoes the completion of these commands. Media are removed from the Eject list and returned to the available state.

For example, if a client issues an Export request for a specific medium, the specified medium is scheduled for removal by adding the medium to the Eject list for the archive associated with the medium. If the client decides the medium should not be removed from its associated archive, the client can issue a ClearEject request, and VolServ removes the medium from the Eject list.

Synopsis VST_BOOLEAN VSCMD_ClearEject (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this ClearEject request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
Page 599 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 599 · click to enlarge
Page 599
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for ClearEject commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for ClearEject commands.

VSID_MEDIA_ID_LIST (int) Number of media to remove from the Eject list.

(char **) An array of the identifiers of the media to remove from the Eject list.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for ClearEject commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software ClearEject commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 600 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 600 · click to enlarge
Page 600

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for ClearEject commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The total wait time for a command is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for ClearEject commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for ClearEject commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ClearEject returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

Parameter Type Description

Page 601 of the ADIC 601355 Rev A user manual — Return Values
Page 601 · click to enlarge
Page 601
  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
Page 602 of the ADIC 601355 Rev A user manual — Example
Page 602 · click to enlarge
Page 602
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_cleareject_execute 4 * 5 * PURPOSE: 6 * This function sends an cleareject command to the 7 * VolServ software, prompting for all values needed. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_cleareject_execute(void) 15 #else 16 VST_BOOLEAN vst_cleareject_execute() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 int count; 21 char * medialist[VST_MAX_ITEMS]; 22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** ClearEject Parameters

***\n” ); 26 count = vst_getmedialist(medialist,

VST_MAX_ITEMS); 27 /* create the command handle */

Example 1 /****************************************

Page 603 of the ADIC 601355 Rev A user manual — Notes
Page 603 · click to enlarge
Page 603

28 /* Note that the command handle is

not */ 29 /* destroyed in this routine, but in

*/ 30 /* vst_dispatch when final status is

received. */ 31 cmd = VS_Command_Create(); 32 /* validate the command handle */ 33 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 34 { 35 /* Send the command to the VolServ software. */ 36 /* Note that status is not processed here. */ 37 /* Instead, it is processed in the */ 38 /* vst_dispatch routine. Also, note that */ 39 /* default values such as timeout, value */ 40 /* retry limit and priority are set as */ 41 /* default parameters. */ 42 rc = VSCMD_ClearEject(cmd, 43 VSID_MEDIA_ID_LIST, count, medialist, 44 VSID_ENDFIELD); 45 } 46 47 return ( rc ); 48 }

VolServ does not generate intermediate status messages in response to a ClearEject request.

Page 604 of the ADIC 601355 Rev A user manual — Notes
Page 604 · click to enlarge
Page 604

A ClearEject request can trigger MediaClass callbacks from VolServ.

Failure of a ClearEject request for one medium does not fail the request for all media.

An operator can also remove a medium from the Eject list by performing an Eject Fail from the appropriate archive console. The Eject Fail functionality is not available over the API interface.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on a ClearEject request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for ClearEject commands are set with VSCMD_ClearEject_SetDefaults . If
Page 605 of the ADIC 601355 Rev A user manual — Note
Page 605 · click to enlarge
Page 605

command-specific defaults are set for ClearEject commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a ClearEject command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Checkout request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_CODE_TABLE,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY,
  • VSID_MEDIA_ID_TABLE,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 606 of the ADIC 601355 Rev A user manual — See Also
Page 606 · click to enlarge
Page 606

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_ClearEject_SetDefaults(l)
Page 607 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ClearEject_SetDefaults ( “…”, VSID_ENDFIELD)
Page 607 · click to enlarge
Page 607

VSCMD_Clear Eject_ SetDefaults

VSCMD_ClearEject_SetDefaults sets command-level default parameters for ClearEject commands.

Two levels of default parameter settings are used in the API software— global defaults and command-specific parameter defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for ClearEject commands are set with VSCMD_ClearEject_SetDefaults . If command-specific defaults are set for the ClearEject command, they override the global defaults for all ClearEject commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a ClearEject command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

Synopsis VST_BOOLEAN VSCMD_ClearEject_SetDefaults ( “…”, VSID_ENDFIELD)

Page 608 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH )
Page 608 · click to enlarge
Page 608

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

Name of the client dispatch routine to receive status for ClearEject commands.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH )

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for ClearEject commands.

VSID_MEDIA_ID_LIST (int) Number of media to remove from the Eject list with ClearEject commands.

(char **) An array of the identifiers of the media to remove from the Eject list with ClearEject commands.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for ClearEject commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT Number of times the API software retries for command status from VolServ before returning a time-out to the client software for ClearEject commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 609 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 609 · click to enlarge
Page 609

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for ClearEject commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for ClearEject commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for ClearEject commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 610 of the ADIC 601355 Rev A user manual — Return Values
Page 610 · click to enlarge
Page 610

Return Values VSCMD_ClearEject_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_cleareject_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_ClearEject API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_cleareject_defaults(void) 15 #else 16 VST_BOOLEAN

vst_cleareject_defaults() 17 #endif 18 {

Example 1 /****************************************

Page 611 of the ADIC 601355 Rev A user manual — Note
Page 611 · click to enlarge
Page 611

19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** ClearEject Default

Parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_ClearEject_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 40 return ( rc ); 41 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 612 of the ADIC 601355 Rev A user manual — See Also
Page 612 · click to enlarge
Page 612

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ClearEject(l)
Page 613 of the ADIC 601355 Rev A user manual — VSCMD_ Connect
Page 613 · click to enlarge
Page 613

VSCMD_ Connect

VSCMD_Connect associates a specified Internet address with a specified enterprise identifier. After this association is established, the client can listen for MediaClass callbacks and VolServ statuses that are generated for that enterprise.

Any Internet address can be associated with more than one enterprise identifier. In addition, there is no limit to the number of Internet addresses that can be associated with any given enterprise identifier.

When sending intermediate or final status to the client associated with an enterprise, VolServ uses the enterprise identifier to determine the address to use for the status. This is done by matching the enterprise identifier passed in the request with those in the internal table and using the associated address information.

If an enterprise has multiple clients, each client is kept on a receiving queue. If the first enterprise client cannot receive status or MediaClass callback (because of an RPC error), the next client in the queue is tried. This continues until a client successfully receives the status/callback or until the receiving queue is exhausted. If no client successfully receives the status, it is logged and VolServ invokes its retry scheme. If no client successfully receives a MediaClass callback, it is logged and discarded.

There are two methods for scheduling status/callbacks to enterprise clients:

  • Round Robin
Page 614 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Connect (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 614 · click to enlarge
Page 614

The statuses and callbacks are distributed evenly among the connected clients. After a status or callback is received by a client, that client is placed at the end of the receiving queue. This method is used by distributed processing systems that want to distribute the work among clients.

  • First Received/First Scheduled

The statuses and callbacks are issued to the client that successfully received the previous status or callback. The only time a different client is tried is when the first client fails (at which time the failed client is placed at the end of the queue).

The scheduling method selected by VolServ is dictated by the ENTERPRISE_ROUND_SCHEDULING environmental variable. If this variable is set to ‘Y’, the Round Robin scheduling method is used. Otherwise, the First Received/First Scheduled method is used. (The ENTERPRISE_ROUND_SCHEDULING environmental variable is in the envvar.config configuration file.)

Synopsis VST_BOOLEAN VSCMD_Connect (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Connect request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this command. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
Page 615 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 615 · click to enlarge
Page 615
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_CONNECT_HANDLE (VST_CONNECT_HANDLE)

The connect handle that contains the enterprise callback address information to be used by VolServ when returning status and MediaClass callbacks to an enterprise. VSID_CONNECT_HANDLE is not applicable if VSID_PROCEDURE_NUMBER, VSID_PROGRAM_NUMBER, VSID_PROTOCOL, and VSID_VERSION_NUMBER are specified.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

RPC procedure number of the client process to receive status messages and MediaClass callbacks from VolServ. VSID_PROCEDURE_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number of the client process to receive status messages and MediaClass callbacks from VolServ. VSID_PROGRAM_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

Parameters · Parameter Type Description

Page 616 of the ADIC 601355 Rev A user manual — VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 616 · click to enlarge
Page 616

VSID_PROTOCOL (VST_PROTOCOL) Internet protocol VolServ uses to return status messages and MediaClass callbacks to this client. The default VSID_PROTOCOL is VSE_PROT_UDP. VSID_PROTOCOL is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_SOCKADDR_IN (VST_SOCKADDR_IN)

Internet socket address for this client.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The enterprise identifier of the enterprise with which a connection is desired.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

Parameter Type Description

Page 617 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 617 · click to enlarge
Page 617

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

RPC version number of the client process to receive status messages and MediaClass callbacks from VolServ. VSID_VERSION_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

Return Values VSCMD_Connect returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 618 of the ADIC 601355 Rev A user manual — Example
Page 618 · click to enlarge
Page 618
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_connect_execute 4 * 5 * PURPOSE:

Example 1 /****************************************

Page 619 of the ADIC 601355 Rev A user manual — Example
Page 619 · click to enlarge
Page 619

6 * This executes the VSCMD_Connect API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_connect_execute(void) 14 #else 15 VST_BOOLEAN vst_connect_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_ENTERPRISE_ID

socketaddress; 21 VST_PROGRAM_NUMBER prognum; 22 VST_COMMAND_HANDLE cmd; 23 VST_VERSION_NUMBER versnum; 24 VST_PROCEDURE_NUMBER procnum; 25 int temp; 26 27 /* get parameters from user */ 28 printf(“*** Connect parameters

***\n” ); 29 printf(“Enter Enterprise ID ==> “ ); 30 TargetEnterpriseID =

(VST_ENTERPRISE_ID) atoi(gets(input)); 31 printf(“Enter program number ==>”); 32 prognum = (VST_PROGRAM_NUMBER)

atol(gets(input)); 33 printf(“Enter Version Number ==> “ ); 34 versnum = (VST_VERSION_NUMBER)

atol(gets(input)); 35 printf(“Enter Procedure Number ==> “

TargetEnterpriseID; 20 VST_SOCKADDR_IN · );

Page 620 of the ADIC 601355 Rev A user manual — Example
Page 620 · click to enlarge
Page 620

36 procnum = (VST_PROCEDURE_NUMBER)

atoi(gets(input)); 37 printf(“Enter Socket sin family ==> “

); 38 temp = atoi(gets(input)); 39 socketaddress.sin_family = (short)

temp; 40 printf(“Enter Socket sin port ==> “

); 41 temp = atoi(gets(input)); 42 socketaddress.sin_port = (u_short)

temp; 43 printf(“Enter Socket sin address ==>

“ ); 44 temp = atoi(gets(input)); 45 socketaddress.sin_addr = (u_long)

temp; 46 47 /* create the command handle */ 48 /* Note that the command handle is

not */ 49 /* destroyed in this routine, but in

*/ 50 /* vst_dispatch when final status is

received. */ 51 cmd = VS_Command_Create(); 52 if (cmd != (VST_COMMAND_HANDLE )NULL) 53 { 54 /* Send the command to the VolServ software. */ 55 /* Note that status is not processed here. */ 56 /* Instead, it is processed in the */ 57 /* vst_dispatch routine. Also, note that */ 58 /* default values such as timeout, value */ 59 /* retry limit and priority are set as */ 60 /* default parameters. */ 61 rc = VSCMD_Connect(cmd,

Page 621 of the ADIC 601355 Rev A user manual — Notes
Page 621 · click to enlarge
Page 621

62 VSID_TARGET_ENTERPRISE_ID,TargetE nterpriseID 63 VSID_PROGRAM_NUMBER, prognum, 64 VSID_VERSION_NUMBER, versnum, 65 VSID_PROCEDURE_NUMBER, procnum, 66 VSID_PROTOCOL, VSE_PROT_TCP, 67 VSID_SOCKADDR_IN, socketaddress, 68 VSID_ENDFIELD); 69 } 70 return ( rc ); 71 }

VolServ generates no intermediate status in response to a Connect command.

The Connect command cannot trigger MediaClass callbacks from VolServ.

The VSID_CONNECT_HANDLE parameter may be used after a Connect Query command to reconnect an enterprise after the client has gone down.

The Connect command cannot be cancelled. The client may remove an enterprise/address association by issuing a VSCMD_Disconnect command to the VolServ system.

A client may use the VSCMD_ConnectQuery command to determine if an enterprise is already registered and, if so, under what address.

Page 622 of the ADIC 601355 Rev A user manual — Notes
Page 622 · click to enlarge
Page 622

If a client sends a VSCMD_Connect command for an enterprise that already exists, future status messages may be returned to a different client. When a client specifies “enterprise” in the client header message, the resultant status messages may be returned to any client associated with the same enterprise identifier.

The MediaClass callback receiving queue is kept separate from the command status receiving queue. Each of these queues is scheduled separately. Therefore, a client for an enterprise that receives both statuses and callbacks may receive a command status and a MediaClass callback before another client receives either message.

The VSCMD_Connect command can be issued only through the client interface. The association between an enterprise and its client cannot be established via the GUI.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, final status for this command is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Connect command submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

A client can issue the Connect Query command to determine if an enterprise is already registered and, if so, under what address.

Page 623 of the ADIC 601355 Rev A user manual — Note
Page 623 · click to enlarge
Page 623
  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Connect command are set with VSCMD_Connect_SetDefaults . If command-specific defaults are set for the Connect command, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Connect command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

The following fields can be retrieved from the status handle after a successful Connect command:

  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_TARGET_ENTERPRISE_ID ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 624 of the ADIC 601355 Rev A user manual — See Also
Page 624 · click to enlarge
Page 624

See Also • vsapi(l),

  • VS_Connect_Create(l),
  • VS_Connect_Destroy(l),
  • VS_Connect_GetFields(l),
  • VS_Connect_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_ConnectQuery(l),
  • VSCMD_Connect_SetDefaults(l)
Page 625 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Connect_SetDefaults ( “…”, VSID_ENDFIELD)
Page 625 · click to enlarge
Page 625

VSCMD_ Connect_Set Defaults

VSCMD_Connect_SetDefaults sets command-level default parameters for Connect commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Archive Media Class commands are set with VSCMD_CreateArchiveMediaClass_SetDefaults . If command-specific defaults are set for Create Archive Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Archive Media Class command, the parameter identifier and the value to be used for

Synopsis VST_BOOLEAN VSCMD_Connect_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 626 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 626 · click to enlarge
Page 626
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Connect commands.

VSID_CONNECT_HANDLE (VST_CONNECT_HANDLE)

The connect handle that contains the enterprise callback address information to be used by VolServ when returning status and MediaClass callbacks to an enterprise. VSID_CONNECT_HANDLE is not applicable if VSID_PROCEDURE_NUMBER, VSID_PROGRAM_NUMBER, VSID_PROTOCOL, and VSID_VERSION_NUMBER are specified.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Connect requests.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Connect commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

RPC procedure number of the client process to receive status messages and MediaClass callbacks from VolServ. VSID_PROCEDURE_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number of the client process to receive status messages and MediaClass callbacks from VolServ. VSID_PROGRAM_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

Parameters · Parameter Type Description

Page 627 of the ADIC 601355 Rev A user manual — VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 627 · click to enlarge
Page 627

VSID_PROTOCOL (VST_PROTOCOL) Internet protocol VolServ uses to return status messages and MediaClass callbacks to this client. The default VSID_PROTOCOL is VSE_PROT_TCP. VSID_PROTOCOL is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Connect commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_SOCKADDR_IN (VST_SOCKADDR_IN)

Internet socket address for this client.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Connect commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The enterprise identifier of the enterprise with which a connection is desired.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

Parameter Type Description

Page 628 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 628 · click to enlarge
Page 628

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Connect commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Connect commands. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

RPC version number of the client process to receive status messages and MediaClass callbacks from VolServ. VSID_VERSION_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

Return Values VSCMD_Connect_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_connect_defaults 4 * 5 * PURPOSE:

Parameter Type Description · Example 1 /****************************************

Page 629 of the ADIC 601355 Rev A user manual — Return Values
Page 629 · click to enlarge
Page 629

6 * This function sets the default parameters for the 7 * VSCMD_Connect API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_connect_defaults(void) 15 #else 16 VST_BOOLEAN vst_connect_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Connect default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Connect_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries,

Page 630 of the ADIC 601355 Rev A user manual — Note
Page 630 · click to enlarge
Page 630

36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Connect(l)
Page 631 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ConnectQuery (VST_COMMAND_HANDLE handle “…”, VSID_ENDFIELD)
Page 631 · click to enlarge
Page 631

VSCMD_ ConnectQuery

VSCMD_ConnectQuery returns a list of all client Internet addresses currently associated with the specified enterprise identifier.

The Connect Query command can be issued through either the client interface or the GUI. However, only from the GUI can “query all” be specified to list all enterprises. From the client interface, only one enterprise can be specified within a single command. This restriction prevents any client from listing the clients of other enterprises being serviced by VolServ.

Synopsis VST_BOOLEAN VSCMD_ConnectQuery (VST_COMMAND_HANDLE handle “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Connect Query command.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 632 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 632 · click to enlarge
Page 632

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_ENTERPRISE_ID (VST_REQUEST_ID)

Identifier of the enterprise to be queried.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this command. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

Parameters · Parameter Type Description

Page 633 of the ADIC 601355 Rev A user manual — Return Values
Page 633 · click to enlarge
Page 633

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ConnectQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 634 of the ADIC 601355 Rev A user manual — Return Values
Page 634 · click to enlarge
Page 634

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 635 of the ADIC 601355 Rev A user manual — Example
Page 635 · click to enlarge
Page 635

********* 2 * 3 * FUNCTION: vst_connectquery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ConnectQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_connectquery_execute(void) 14 #else 15 VST_BOOLEAN

vst_connectquery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_ENTERPRISE_ID enterprise; 20 VST_COMMAND_HANDLE cmd; 21 22 /* get parameters from user */ 23 printf(“*** Connect Query parameters

***\n” ); 24 printf(“\nEnter Enterprise ID ==>”); 25 enterprise = (VST_ENTERPRISE_ID)

atoi(gets(input)); 26 27 /* create the command handle */ 28 /* Note that the command handle is

not */ 29 /* destroyed in this routine, but in

*/ 30 /* vst_dispatch when final status is

received. */ 31 cmd = VS_Command_Create();

Example 1 /****************************************

Page 636 of the ADIC 601355 Rev A user manual — Notes
Page 636 · click to enlarge
Page 636

32 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 33 { 34 /* Send the command to the VolServ software. */ 35 /* Note that status is not processed here. */ 36 /* Instead, it is processed in the */ 37 /* vst_dispatch routine. Also, note that */ 38 /* default values such as timeout, value */ 39 /* retry limit and priority are set as */ 40 /* default parameters. */ 41 rc = VSCMD_ConnectQuery(cmd, 42 VSID_QRY_ENTERPRISE_ID, enterprise, 43 VSID_ENDFIELD); 44 } 45 return ( rc ); 46 }

VolServ generates no intermediate status in response to a Connect Query request.

The Connect Query command does not trigger unsolicited MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

Page 637 of the ADIC 601355 Rev A user manual — Tip
Page 637 · click to enlarge
Page 637

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this command is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Connect Query command submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

A client can issue the Connect Query command to determine if an enterprise is already registered. If it is registered, its address is also reported.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Connect Query command are set with VSCMD_ConnectQuery_SetDefaults . If command-specific defaults are set for the Connect Query command, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Connect Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

The following fields can be retrieved from the status handle after a successful Connect Query command:

Page 638 of the ADIC 601355 Rev A user manual — Note
Page 638 · click to enlarge
Page 638
  • VSID_CONNECT_HANDLE ,
  • VSID_CONNECT_HANDLE_ENTRY,
  • VSID_CONNECT_HANDLE_TABLE,
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_CODE_TABLE,
  • VSID_QUERY_ENTERPRISE_ID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_Table(l),
  • VS_Command_GetFields(l),
  • VS_Connect_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Connect_Handle_Table(l),
Page 639 of the ADIC 601355 Rev A user manual — See Also
Page 639 · click to enlarge
Page 639
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
Page 640 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ConnectQuery_SetDefaults ( “…”, VSID_ENDFIELD)
Page 640 · click to enlarge
Page 640

VSCMD_ ConnectQuery_ Set-Defaults

VSCMD_ConnectQuery_SetDefaults sets command-level default parameters for Connect Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Archive Media Class commands are set with VSCMD_CreateArchiveMediaClass_SetDefaults . If command-specific defaults are set for Create Archive Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_ConnectQuery_SetDefaults ( “…”, VSID_ENDFIELD)

Page 641 of the ADIC 601355 Rev A user manual — VSID_QUERY_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 641 · click to enlarge
Page 641

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Connect Query commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Connect Query commands.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Connect Query commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise whose connection is queried.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Connect Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 642 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 642 · click to enlarge
Page 642

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Connect Query commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The total wait time for a command is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Connect Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Connect Query commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ConnectQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 643 of the ADIC 601355 Rev A user manual — Example
Page 643 · click to enlarge
Page 643
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_connectquery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_ConnectQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_connectquery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_connectquery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Connect Query default

Example 1 /**************************************** · parameters ***\n” );

Page 644 of the ADIC 601355 Rev A user manual — Note
Page 644 · click to enlarge
Page 644

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_ConnectQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ConnectQuery(l)

29 vst_promptforglobals(&priority,

Page 645 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_CreateArchiveMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 645 · click to enlarge
Page 645

VSCMD_ CreateArchiv eMediaClass

VSCMD_CreateArchiveMediaClass creates an archive media class association. An archive media class association is the association of a MediaClass group with a defined archive.

A MediaClass group establishes common characteristics for the media it contains; no inherent restrictions are placed on where those media can reside within an archive.

Archive media class associations provide the ability to:

  • Restrict which archives can contain specific classes/types of media.
  • Constrain the number of specific media classes/types that can be associated with any given archive.
  • Preclude the erroneous assignment of media into an archive that is incompatible with that media type.
  • Ensure an archive has a desired mix of classes of media.
  • If needed, preclude media of a known data format from being assigned into an archive that does not have access to a drive compatible with that media type.

Synopsis VST_BOOLEAN VSCMD_CreateArchiveMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Page 646 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 646 · click to enlarge
Page 646

Arguments • handle = The command handle for this Create Archive Media Class command.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_MODE)

Specifies what action VolServ takes when the number of media in the archive media class exceeds the specified high mark threshold. Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to be associated with the archive media class relationship. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY) Percentage of the total MediaClass capacity that can be stored in this archive.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE)

Preferred locations (in table format) for media assigned to this archive media class.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

Parameters · Parameter Type Description

Page 647 of the ADIC 601355 Rev A user manual — VSID_MIGRATION_PRIORITY (VST_PRIORITY)
Page 647 · click to enlarge
Page 647

VSID_HIGH_MARK (VST_HIGH_MARK) Percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_LOW_MARK (VST_LOW_MARK) Percentage of VSID_CAPACITY below which the specified migration policy option is performed or terminated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

MediaClass group associated with the archive media class relationship. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MIGRATION_PRIORITY (VST_PRIORITY)

The migration priority to be applied to this archive media class.

VSID_PERCENT (VST_PERCENT) Percentage of the MediaClass capacity allowed in the archive associated with the archive media class relationship.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 648 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 648 · click to enlarge
Page 648

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive for media automatically migrated out of this archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 649 of the ADIC 601355 Rev A user manual — Return Values
Page 649 · click to enlarge
Page 649

Return Values VSCMD_CreateArchiveMediaClass returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 650 of the ADIC 601355 Rev A user manual — Example
Page 650 · click to enlarge
Page 650
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_createarchivemediaclass_execu te 4 * 5 * PURPOSE: 6 * This executes the VSCMD_CreateArchiveMediaClass 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_createarchivemediaclass_execu te(void) 15 #else 16 VST_BOOLEAN

Example 1 /**************************************** · vst_createarchivemediaclass_execu te()

Page 651 of the ADIC 601355 Rev A user manual — Example
Page 651 · click to enlarge
Page 651

17 #endif 18 { 19 int i; 20 int count; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_ARCHIVE_NAME archive; 23 VST_MEDIA_CLASS_NAME

mediaclass; 24 VST_CAPACITY capacity; 25 VST_ARCHIVE_ACTION_OPTION action; 26 VST_HIGH_MARK highmark; 27 VST_LOW_MARK lowmark; 28 VST_PRIORITY migpri; 29 VST_ARCHIVE_NAME

comphandle; 32 VST_COMP_TYPE CompType =

VSE_COMPTYPE_COLUMN; 33 VST_COMPONENT_ID CompID; 34 VST_COMMAND_HANDLE cmd; 35 36 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 37 /* get parameters from user */ 38 printf(“*** Create Archive Media

Class parameters ***\n” ); 39 printf(“Enter Archive Name ==> “ ); 40 gets( archive ); 41 printf(“Enter Media Class Name ==> “

); 42 gets( mediaclass ); 43 printf(“Enter Capacity Percent ==> “

); 44 capacity = atoi(gets(input)); 45 printf(“Enter Archive action option

(0-none/1-mig/2-notify) ==> “ ); 46 action = atoi(gets(input));

targetarchive; 30 VST_TABLE_HANDLE · comphandletable; 31 VST_COMPONENT_HANDLE

Page 652 of the ADIC 601355 Rev A user manual — Example
Page 652 · click to enlarge
Page 652

47 printf(“Enter High Mark Percentage

==> “ ); 48 highmark = atoi(gets(input)); 49 printf(“Enter Low Mark Percentage ==>

“ ); 50 lowmark = atoi(gets(input)); 51 52 if ( action == VSE_ARCHIVE_ACTION_MIG

) 53 { 54 /* these parameters only need to be set if */ 55 /* the archivemediaclass is being set up to */ 56 /* support migration. */ 57 printf(“Enter Target Archive ==> “ ); 58 gets( targetarchive ); 59 printf(“Enter Migration Priority == > “ ); 60 migpri = atoi(gets(input)); 61 VSCMD_CreateArchiveMediaClass_Set Defaults ( 62 VSID_TARGET_ARCHIVE_NAME, targetarchive, 63 VSID_MIGRATION_PRIORITY, migpri, 64 VSID_ENDFIELD ); 65 } 66 67 printf(“How many prefered placements

(0 to skip): “); 68 count = atoi(gets(input)); 69 if (count > 0) 70 { 71 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count); 72 if (comphandletable == (VST_TABLE_HANDLE) NULL) 73 {

Page 653 of the ADIC 601355 Rev A user manual — Example
Page 653 · click to enlarge
Page 653

74 return(VSE_FALSE); 75 } 76 for (i = 0; i < count; i++) 77 { 78 printf(“Enter row #%d:”, i + 1); 79 CompID[0] = (short) atoi(gets(input)); 80 printf(“Enter column #%d:”, i + 1); 81 CompID[1] = (short) atoi(gets(input)); 82 CompID[2] = 0; 83 CompID[3] = 0; 84 comphandle = VS_Component_Create(); 85 VS_Component_SetFields(comphandle , 86 VSID_COMP_TYPE, CompType, 87 VSID_COMP_ID, CompID, 88 VSID_ENDFIELD); 89 VS_Table_AddEntry(comphandletable ,comphandle); 90 } 91 /* This also only needs to be set if it is */ 92 /* actually being used. It is not needed */ 93 /* otherwise. */ 94 VSCMD_CreateArchiveMediaClass_Set Defaults( 95 VSID_COMPONENT_HANDLE_TABLE,comph andletable, 96 VSID_ENDFIELD); 97 } 98 99 /* create the command handle */

Page 654 of the ADIC 601355 Rev A user manual — Example
Page 654 · click to enlarge
Page 654

100 /* Note that the command handle is

not */ 101 /* destroyed in this routine, but in

*/ 102 /* vst_dispatch when final status is

received. */ 103 cmd = VS_Command_Create(); 104 if (cmd != (VST_COMMAND_HANDLE )NULL) 105 { 106 /* Send the command to the VolServ software. */ 107 /* Note that status is not processed here. */ 108 /* Instead, it is processed in the */ 109 /* vst_dispatch routine. Also, note that */ 110 /* default values such as timeout, value */ 111 /* retry limit and priority are set as */ 112 /* default parameters. */ 113 rc = VSCMD_CreateArchiveMediaClass(cmd , 114 VSID_ARCHIVE_NAME, archive, 115 VSID_MEDIA_CLASS_NAME, mediaclass, 116 VSID_HIGH_MARK, highmark, 117 VSID_LOW_MARK, lowmark, 118 VSID_CAPACITY, capacity, 119 VSID_ENDFIELD); 120 } 121 122 return ( rc ); 123}

Page 655 of the ADIC 601355 Rev A user manual — Notes
Page 655 · click to enlarge
Page 655

VolServ generates no intermediate status in response to a Create Archive Media Class command.

VSCMD_CreateArchiveMediaClass does not trigger unsolicited MediaClass callbacks from VolServ.

The migration policy options for are no action, operator notification, and automatic migration.

When the number of media in an archive media class reaches the high mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy option is set to notify.
  • Initiates automatic migration of media if the migration policy is set to migrate.

When the number of media in an archive media class drops to the low mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy is set to notify.
  • Terminates automatic migration of media if the migration policy is set to migrate.

The capacity value of an archive media class is relative to the MediaClass group specified overall capacity. Consideration should be given to all MediaClass groups that are able to share this archive to ensure that reasonably comparable capacity limitations and high/low marks are set for each archive media class.

Page 656 of the ADIC 601355 Rev A user manual — Notes
Page 656 · click to enlarge
Page 656

Archive media class computed capacity limits are “soft”, that is, they can be exceeded when media are imported or moved in from another archive. If automigration is specified, media of this MediaClass group is then marked for movement to their target archive. The media type capacity designates the “hard” limit when entering media into an archive.

Media can only reside in an archive if their associated MediaClass group has an archive media class assignment in that archive.

An archive media class computed capacity is refigured if the capacity of a MediaClass group changes.

Checks to determine if the high mark has been reached or exceeded or the low mark has been reached or passed occur:

  • After any Eject, Enter, Reclassify, or Modify Archive Media Class command executes.
  • After the MediaClass group or archive media class association are redefined.

The sum of all archive media class capacities can exceed the archive’s physical ability to house media. If VSID_CAPACITY values are set unrealistically high and VSID_HIGH_MARK is similarly high, the archive may physically completely fill before any automigration procedure is triggered.

Components listed as preferred for storage of media of this MediaClass group do not have exclusive ownership of those components.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

Page 657 of the ADIC 601355 Rev A user manual — Tip
Page 657 · click to enlarge
Page 657

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Create Archive Media Class request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Archive Media Class commands are set with VSCMD_CreateArchiveMediaClass_SetDefaults . If command-specific defaults are set for Create Archive Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Create Archive Media Class request:

  • VSID_ARCHIVE_NAME ,
  • VSID_COMPONENT_HANDLE ,
  • VSID_COMPONENT_HANDLE_ENTRY,
Page 658 of the ADIC 601355 Rev A user manual — Note
Page 658 · click to enlarge
Page 658
  • VSID_COMPONENT_HANDLE_TABLE,
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_MEDIA_CLASS_NAME ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreateArchiveMediaClass_SetDefaults(l),
  • VSCMD_DeleteArchiveMediaClass(l),
  • VSCMD_ModifyArchiveMediaClass(l)
Page 659 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_CreateArchive MediaClass_SetDefaults ( “…”, VSID_ENDFIELD)
Page 659 · click to enlarge
Page 659

VSCMD_ CreateArchiv eMediaClass_ SetDefaults

VSCMD_CreateArchvieMediaClass_SetDefaults sets the command-level default parameters for Create Archive Media Class commands.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Media Class commands are set with VSCMD_CreateMediaClass_SetDefaults . If command-specific defaults are set for Create Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_CreateArchive MediaClass_SetDefaults ( “…”, VSID_ENDFIELD)

Page 660 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 660 · click to enlarge
Page 660

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_MODE)

Specifies what action VolServ takes when the number of media in the archive media class exceeds the specified high mark threshold. Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive to be associated with the archive media class relationship. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY) Percentage of the total MediaClass capacity that can be stored in this archive.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Create Archive Media Class commands.

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE)

Preferred locations (in table format) for media assigned to this archive media class.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Create Archive Media Class commands.

Parameters · Parameter Type Description

Page 661 of the ADIC 601355 Rev A user manual — VSID_MIGRATION_PRIORITY (VST_PRIORITY)
Page 661 · click to enlarge
Page 661

VSID_HIGH_MARK (VST_HIGH_MARK) Percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_LOW_MARK (VST_LOW_MARK) Percentage of VSID_CAPACITY below which the specified migration policy option is performed or terminated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

MediaClass group associated with the archive media class relationship. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MIGRATION_PRIORITY (VST_PRIORITY)

The migration priority to be applied to this archive media class.

VSID_PERCENT (VST_PERCENT) Percentage of the MediaClass group capacity allowed in the archive associated with the archive media class relationship.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Create Archive Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 662 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 662 · click to enlarge
Page 662

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Create Archive Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive for media automatically migrated out of this archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The total wait time for a command is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Create Archive Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Create Archive Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 663 of the ADIC 601355 Rev A user manual — Return Values
Page 663 · click to enlarge
Page 663

Return Values VSCMD_CreateArchiveMediaClass_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

********* 2 * 3 * FUNCTION: vst_createarchivemediaclass_execu te 4 * 5 * PURPOSE: 6 * This executes the VSCMD_CreateArchiveMediaClass 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_createarchivemediaclass_execu te(void) 15 #else

Example 1 /****************************************

Page 664 of the ADIC 601355 Rev A user manual — 16 VST_BOOLEAN
Page 664 · click to enlarge
Page 664

16 VST_BOOLEAN

vst_createarchivemediaclass_execu te() 17 #endif 18 { 19 int i; 20 int count; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_ARCHIVE_NAME archive; 23 VST_MEDIA_CLASS_NAME

mediaclass; 24 VST_CAPACITY capacity; 25 VST_ARCHIVE_ACTION_OPTION action; 26 VST_HIGH_MARK highmark; 27 VST_LOW_MARK lowmark; 28 VST_PRIORITY migpri; 29 VST_ARCHIVE_NAME

comphandle; 32 VST_COMP_TYPE CompType =

VSE_COMPTYPE_COLUMN; 33 VST_COMPONENT_ID CompID; 34 VST_COMMAND_HANDLE cmd; 35 36 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 37 /* get parameters from user */ 38 printf(“*** Create Archive Media

Class parameters ***\n” ); 39 printf(“Enter Archive Name ==> “ ); 40 gets( archive ); 41 printf(“Enter Media Class Name ==> “

); 42 gets( mediaclass ); 43 printf(“Enter Capacity Percent ==> “

); 44 capacity = atoi(gets(input));

targetarchive; 30 VST_TABLE_HANDLE · comphandletable; 31 VST_COMPONENT_HANDLE

Page 665 of the ADIC 601355 Rev A user manual — Return Values
Page 665 · click to enlarge
Page 665

45 printf(“Enter Archive action option

(0-none/1-mig/2-notify) ==> “ ); 46 action = atoi(gets(input)); 47 printf(“Enter High Mark Percentage

==> “ ); 48 highmark = atoi(gets(input)); 49 printf(“Enter Low Mark Percentage ==>

“ ); 50 lowmark = atoi(gets(input)); 51 52 if ( action == VSE_ARCHIVE_ACTION_MIG

) 53 { 54 /* these parameters only need to be set if */ 55 /* the archivemediaclass is being set up to */ 56 /* support migration. */ 57 printf(“Enter Target Archive ==> “ ); 58 gets( targetarchive ); 59 printf(“Enter Migration Priority == > “ ); 60 migpri = atoi(gets(input)); 61 VSCMD_CreateArchiveMediaClass_Set Defaults ( 62 VSID_TARGET_ARCHIVE_NAME, targetarchive, 63 VSID_MIGRATION_PRIORITY, migpri, 64 VSID_ENDFIELD ); 65 } 66 67 printf(“How many prefered placements

(0 to skip): “); 68 count = atoi(gets(input)); 69 if (count > 0) 70 { 71 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count);

Page 666 of the ADIC 601355 Rev A user manual — Return Values
Page 666 · click to enlarge
Page 666

72 if (comphandletable == (VST_TABLE_HANDLE) NULL) 73 { 74 return(VSE_FALSE); 75 } 76 for (i = 0; i < count; i++) 77 { 78 printf(“Enter row #%d:”, i + 1); 79 CompID[0] = (short) atoi(gets(input)); 80 printf(“Enter column #%d:”, i + 1); 81 CompID[1] = (short) atoi(gets(input)); 82 CompID[2] = 0; 83 CompID[3] = 0; 84 comphandle = VS_Component_Create(); 85 VS_Component_SetFields(comphandle , 86 VSID_COMP_TYPE, CompType, 87 VSID_COMP_ID, CompID, 88 VSID_ENDFIELD); 89 VS_Table_AddEntry(comphandletable ,comphandle); 90 } 91 /* This also only needs to be set if it is */ 92 /* actually being used. It is not needed */ 93 /* otherwise. */ 94 VSCMD_CreateArchiveMediaClass_Set Defaults( 95 VSID_COMPONENT_HANDLE_TABLE, comphandletable, 96 VSID_ENDFIELD); 97 }

Page 667 of the ADIC 601355 Rev A user manual — Return Values
Page 667 · click to enlarge
Page 667

98 99 /* create the command handle */ 100 /* Note that the command handle is

not */ 101 /* destroyed in this routine, but in

*/ 102 /* vst_dispatch when final status is

received. */ 103 cmd = VS_Command_Create(); 104 if (cmd != (VST_COMMAND_HANDLE )NULL) 105 { 106 /* Send the command to the VolServ software. */ 107 /* Note that status is not processed here. */ 108 /* Instead, it is processed in the */ 109 /* vst_dispatch routine. Also, note that */ 110 /* default values such as timeout, value */ 111 /* retry limit and priority are set as */ 112 /* default parameters. */ 113 rc = VSCMD_CreateArchiveMediaClass(cmd , 114 VSID_ARCHIVE_NAME, archive, 115 VSID_MEDIA_CLASS_NAME, mediaclass, 116 VSID_HIGH_MARK, highmark, 117 VSID_LOW_MARK, lowmark, 118 VSID_CAPACITY, capacity, 119 VSID_ENDFIELD); 120 } 121 122 return ( rc ); 123}

Page 668 of the ADIC 601355 Rev A user manual — Note
Page 668 · click to enlarge
Page 668

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_CreateArchiveMediaClass(l)
Page 669 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_CreateMediaClass ( VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 669 · click to enlarge
Page 669

VSCMD_ CreateMediaClass

VSCMD_CreateMediaClass creates a new MediaClass group.

A MediaClass group establishes common characteristics for the media it contains.

Synopsis VST_BOOLEAN VSCMD_CreateMediaClass ( VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Create Media Class request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 670 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 670 · click to enlarge
Page 670

VSID_CAPACITY (VST_CAPACITY) Maximum number of media allowed in this MediaClass group.

VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE)

Indicates whether this MediaClass group supports the “mount by MediaClass” functionality. Valid VSID_CLASS_MOUNT_STATE values are enumerated in the vs_types.h file.

VSID_CLASS_RPC_OPTION (VST_CLASS_RPC_OPTION)

Indicates whether callbacks are activated for this MediaClass group, and if they are, which callback scheme is used. Valid VSID_CLASS_RPC_OPTION values are enumerated in the vs_types.h file.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_HIGH_MARK (VST_HIGH_MARK) Percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_HOST_NAME (VST_HOST_NAME) Network-assigned name of the computer where the task that “listens” for MediaClass callbacks executes. Applicable only if VSID_CLASS_RPB_OPTION is set to VSE_CLASS_RPC_STANDARD.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Unique name assigned to the new MediaClass group.

Parameters · Parameter Type Description

Page 671 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 671 · click to enlarge
Page 671

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Media type supported by this MediaClass group. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)

User-specified comment included in a system log message when the number of media in the MediaClass group exceeds the high mark threshold. MediaClass name, fill level, high mark threshold, and capacity values are automatically included in the system log message and need not be included in VSID_NOTIFY_COMMENT.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

RPC procedure number of the client process to receive callbacks generated for this MediaClass group. VSID_PROCEDURE_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROCEDURE_NUMBER is not applicable.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number of the client process to receive callbacks generated for this MediaClass group. VSID_PROGRAM_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROGRAM_NUMBER is not applicable.

Parameter Type Description

Page 672 of the ADIC 601355 Rev A user manual — VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 672 · click to enlarge
Page 672

VSID_PROTOCOL (VST_PROTOCOL) Internet protocol VolServ uses to send callbacks for this MediaClass group. The default VSID_PROTOCOL is VSE_PROT_TCP. VSID_PROTOCOL is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROTOCOL is not applicable.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise to receive callbacks for this MediaClass group.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

Parameter Type Description

Page 673 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 673 · click to enlarge
Page 673

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

RPC version number of the client process to receive callbacks generated for this MediaClass group. VSID_VERSION_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_VERSION_NUMBER is not applicable.

Return Values VSCMD_CreateMediaClass returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 674 of the ADIC 601355 Rev A user manual — Return Values
Page 674 · click to enlarge
Page 674
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 675 of the ADIC 601355 Rev A user manual — Example
Page 675 · click to enlarge
Page 675

********* 2 * 3 * FUNCTION: vst_createmediaclass_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_CreateMediaClass API call. 7 * 8 * PARAMETERS: 9 * none 10 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_createmediaclass_execute(void ) 14 #else 15 VST_BOOLEAN

vst_createmediaclass_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_CLASS_NAME mediaclass; 20 VST_MEDIA_TYPE_NAME

MediaTypeName; 21 VST_CAPACITY capacity; 22 VST_CLASS_MOUNT_STATE mountstate; 23 VST_HIGH_MARK highmark; 24 VST_COMMAND_HANDLE cmd; 25 VST_NOTIFY_COMMENT comment; 26 VST_CLASS_RPC_OPTION rpc_option; 27 VST_HOSTNAME

rpc_hostname; 28 VST_PROGRAM_NUMBER rpc_prognum; 29 VST_VERSION_NUMBER rpc_versnum; 30 VST_PROCEDURE_NUMBER rpc_procnum; 31 VST_PROTOCOL

Example 1 /**************************************** · rpc_protocol;

Page 676 of the ADIC 601355 Rev A user manual — 32 VST_ENTERPRISE_ID
Page 676 · click to enlarge
Page 676

32 VST_ENTERPRISE_ID

enterpriseid; 33 34 /* get parameters from user */ 35 printf(“*** Create Media Class

parameters ***\n” ); 36 printf(“\nEnter Media Class Name

==>”); 37 gets( mediaclass); 38 printf(“\nEnter Media Type Name ==>

“); 39 gets( MediaTypeName); 40 printf(“\nEnter capacity==>”); 41 capacity = atoi(gets(input)); 42 printf(“\nEnter class mount state (0)

no, (1) ok: “); 43 mountstate = atoi(gets(input)); 44 printf(“\nEnter high mark ==>”); 45 highmark = atoi(gets(input)); 46 printf(“\nEnter notify comment

==>”); 47 gets(comment); 48 printf(“\nEnter Option (0) no

callbacks, (1) standard, (2) Enterprise==>”); 49 rpc_option = (VST_CLASS_RPC_OPTION)

atoi(gets(input)); 50 if (rpc_option ==

VSE_CLASS_RPC_NONE) 51 { 52 VSCMD_CreateMediaClass_SetDefault s( 53 VSID_CLASS_RPC_OPTION, rpc_option, 54 VSID_ENDFIELD); 55 } 56 else if (rpc_option ==

VSE_CLASS_RPC_STANDARD) 57 { 58 printf(“\nEnter RPC Host Name ==>”);

Page 677 of the ADIC 601355 Rev A user manual — Example
Page 677 · click to enlarge
Page 677

59 gets(rpc_hostname); 60 printf(“\nEnter program number ==>”); 61 rpc_prognum = (VST_PROGRAM_NUMBER) atol(gets(input)); 62 printf(“\nEnter version number ==>”); 63 rpc_versnum = (VST_PROGRAM_NUMBER) atol(gets(input)); 64 printf(“\nEnter procedure number ==>”); 65 rpc_procnum = (VST_PROGRAM_NUMBER) atol(gets(input)); 66 printf(“\nEnter Protocol (6) TCP or (17) UDP ==>”); 67 rpc_protocol = (VST_PROTOCOL) atoi(gets(input)); 68 VSCMD_CreateMediaClass_SetDefault s( 69 VSID_HOST_NAME, rpc_hostname, 70 VSID_CLASS_RPC_OPTION, rpc_option, 71 VSID_PROGRAM_NUMBER, rpc_prognum, 72 VSID_VERSION_NUMBER, rpc_versnum, 73 VSID_PROCEDURE_NUMBER, rpc_procnum, 74 VSID_PROTOCOL, rpc_protocol, 75 VSID_ENDFIELD); 76 } 77 else if (rpc_option ==

VSE_CLASS_RPC_ENTERPRISE) 78 { 79 printf(“\nEnter enterprise id ==>”);

Page 678 of the ADIC 601355 Rev A user manual — Example
Page 678 · click to enlarge
Page 678

80 enterpriseid = (VST_ENTERPRISE_ID) atol(gets(input)); 81 VSCMD_CreateMediaClass_SetDefault s( 82 VSID_CLASS_RPC_OPTION, rpc_option, 83 VSID_TARGET_ENTERPRISE_ID, enterpriseid, 84 VSID_ENDFIELD); 85 } 86 87 /* create the command handle */ 88 /* Note that the command handle is

not */ 89 /* destroyed in this routine, but in

*/ 90 /* vst_dispatch when final status is

received. */ 91 cmd = VS_Command_Create(); 92 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 93 { 94 /* Send the command to the VolServ software. */ 95 /* Note that status is not processed here. */ 96 /* Instead, it is processed in the */ 97 /* vst_dispatch routine. Also, note that */ 98 /* default values such as timeout, value */ 99 /* retry limit and priority are set as */ 100 /* default parameters. */ 101 rc = VSCMD_CreateMediaClass(cmd, 102 VSID_MEDIA_CLASS_NAME, mediaclass, 103 VSID_MEDIA_TYPE_NAME, MediaTypeName,

Page 679 of the ADIC 601355 Rev A user manual — Notes
Page 679 · click to enlarge
Page 679

104 VSID_CAPACITY, capacity, 105 VSID_CLASS_MOUNT_STATE, mountstate, 106 VSID_HIGH_MARK, highmark, 107 VSID_NOTIFY_COMMENT, comment, 108 VSID_ENDFIELD); 109 } 110 return ( rc ); 111}

VolServ generates no intermediate status in response to a Create Media Class request.

The Create Media Class command does not trigger unsolicited MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

Name specified for the MediaClass group must be unique. Any requests to create non-unique MediaClass names fail.

MediaClass groups can span archives.

MediaClass groups may contain only one type of media.

Checks to determine if VSID_HIGH_MARK has been reached or exceeded occur after any Reclassify, Import, or Modify Media Class command.

Page 680 of the ADIC 601355 Rev A user manual — Tip
Page 680 · click to enlarge
Page 680

VSID_CAPACITY is a “hard” limit. VolServ does not permit the number of media assigned to a MediaClass group to exceed the VSID_CAPACITY for that MediaClass group.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Create Media Class request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Media Class commands are set with VSCMD_CreateMediaClass_SetDefaults . If command-specific defaults are set for Create Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Create Media Class command:

  • VSID_MEDIA_CLASS_NAME ,
Page 681 of the ADIC 601355 Rev A user manual — Note
Page 681 · click to enlarge
Page 681
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreateMediaClass_SetDefaults(l),
  • VSCMD_DeleteMediaClass(l),
  • VSCMD_ModifyMediaClass(l)
Page 682 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_CreateMediaClass ( “…”, VSID_ENDFIELD)
Page 682 · click to enlarge
Page 682

VSCMD_ CreateMediaClass_ SetDefaults

VSCMD_CreateMediaClass_SetDefaults sets the command-level default parameters for Create Media Class commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Media Class commands are set with VSCMD_CreateMediaClass_SetDefaults . If command-specific defaults are set for Create Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_CreateMediaClass ( “…”, VSID_ENDFIELD)

Page 683 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 683 · click to enlarge
Page 683

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CAPACITY (VST_CAPACITY) Maximum number of media allowed in this MediaClass group.

VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE)

Indicates whether this MediaClass group supports the “mount by MediaClass” functionality. Valid VSID_CLASS_MOUNT_STATE values are enumerated in the vs_types.h file.

VSID_CLASS_RPC_OPTION (VST_CLASS_RPC_OPTION)

Indicates whether callbacks are to be activated for this MediaClass group, and if they are, which callback scheme is used. Valid VSID_CLASS_RPC_OPTION values are enumerated in the vs_types.h file.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Create Media Class commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on Create Media Class commands.

Parameters · Parameter Type Description

Page 684 of the ADIC 601355 Rev A user manual — VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)
Page 684 · click to enlarge
Page 684

VSID_HIGH_MARK (VST_HIGH_MARK) Percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_HOST_NAME (VST_HOST_NAME) Network-assigned name of the computer where the task that “listens” for MediaClass callbacks executes. Applicable only if VSID_CLASS_RPB_OPTION is set to VSE_CLASS_RPC_STANDARD.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Unique name to be assigned to the new MediaClass group.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

Media type supported by this MediaClass group. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)

User-specified comment to be included in a system log message when the number of media in the MediaClass group exceeds the high mark threshold. MediaClass name, fill level, high mark threshold, and capacity values are automatically included in the system log message and need not be included in VSID_NOTIFY_COMMENT.

VSID_PRIORITY (VST_PRIORITY) Requested execution priority for Create Media Class commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameter Type Description

Page 685 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 685 · click to enlarge
Page 685

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

RPC procedure number of the client process to receive callbacks generated for this MediaClass group. VSID_PROCEDURE_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROCEDURE_NUMBER is not applicable.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

RPC program number of the client process to receive callbacks generated for this MediaClass group. VSID_PROGRAM_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROGRAM_NUMBER is not applicable.

VSID_PROTOCOL (VST_PROTOCOL) Internet protocol VolServ uses to send callbacks for this MediaClass group. The default VSID_PROTOCOL is VSE_PROT_TCP. VSID_PROTOCOL is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROTOCOL is not applicable.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Create Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 686 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 686 · click to enlarge
Page 686

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Create Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise to receive callbacks for this MediaClass group.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a timeout to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Create Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Create Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

RPC version number of the client process to receive callbacks generated for this MediaClass group. VSID_VERSION_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_VERSION_NUMBER is not applicable.

Parameter Type Description

Page 687 of the ADIC 601355 Rev A user manual — Return Values
Page 687 · click to enlarge
Page 687

Return Values VSCMD_CreateMediaClass_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

********* 2 * 3 * FUNCTION: vst_createmediaclass_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_CreateMediaClass API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_createmediaclass_defaults(voi d) 15 #else 16 VST_BOOLEAN

Example 1 /**************************************** · vst_createmediaclass_defaults()

Page 688 of the ADIC 601355 Rev A user manual — Return Values
Page 688 · click to enlarge
Page 688

17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Create Archive Media

Class default parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_CreateMediaClass_SetDefault s( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Page 689 of the ADIC 601355 Rev A user manual — Note
Page 689 · click to enlarge
Page 689

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_CreateMediaClass(l),
  • VSCMD_DeleteMediaClass(l),
  • VSCMD_ModifyMediaClass(l)
Page 690 of the ADIC 601355 Rev A user manual — Notes
Page 690 · click to enlarge
Page 690
Page 690 of the ADIC 601355 Rev A user manual — Notes
Page 691 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DriveVary ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )
Page 691 · click to enlarge
Page 691

VSCMD_Drive Vary

VSCMD_DriveVary is issued to execute VolServ Drive Vary requests and to change the operational availability of a drive.

The drive and target state (VSE_COMP_ONLINE, VSE_COMP_OFFLINE, or VSE_COMP_DIAGNOSTIC) must be specified.

A drive in the off-line, unavailable, or diagnostic state is excluded from VolServ's drive selection algorithm.

A Mount or Lock request for an off-line, unavailable, or diagnostic drive fails.

Conversely, varying a drive to the on-line state makes it available for selection for Mount or Lock requests.

Upon receipt of a Drive Vary request, VolServ attempts to change the state of the specified drive. The return code presented to the client indicates the success or failure of the command.

Synopsis VST_BOOLEAN VSCMD_DriveVary ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )

Arguments • handle = The command handle for this Drive Vary request.

  • " … " = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
Page 692 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 692 · click to enlarge
Page 692
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMP_STATE (VST_COMP_STATE) The target state for the individual drive specified in VSID_DRIVE_ID or drive pool group given in VSID_DRIVEPOOL_NAME. Used when varying all drives to the same state. Valid VSID_COMP_STATE values are enumerated in the vs.types.h file.

VSID_COMP_STATE_LIST (int) Number of states contained in this list.

(VST_COMP_STATE *) Pointer to the list of one or more target states for the drives specified in VSID_DRIVE_ID_LIST. Used when varying the drives to different states. Valid VSID_COMP_STATE_LIST values are enumerated in the vs_types.h file.

VSID_DRIVE_ID (VST_DRIVE_ID) An individual drive whose state is varied. Not necessary when specifying a drive list or drive pool.

VSID_DRIVE_ID_LIST (int) Number of drives contained in this list used with VSID_COMP_STATE_LIST.

(VST_DRIVE_ID *) Pointer to a list of one or more drives whose states are to be varied. Not necessary when specifying a drive list or drive identifier.

Parameters · Parameter Type Description

Page 693 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 693 · click to enlarge
Page 693

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Name of a drive pool group to vary the state of all drives associated with the drive pool group. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted. Not necessary when specifying a drive list or drive identifier.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this command. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software is to retry for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The default time-out value is 120 seconds.

Parameter Type Description

Page 694 of the ADIC 601355 Rev A user manual — Return Values
Page 694 · click to enlarge
Page 694

Return Values VSCMD_DriveVary returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 695 of the ADIC 601355 Rev A user manual — Example
Page 695 · click to enlarge
Page 695
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_drivevary_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DriveVary API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_drivevary_execute(void) 14 #else 15 VST_BOOLEAN vst_drivevary_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 int count; 20 VST_DRIVE_ID

drivelist[VST_MAX_ITEMS]; 21 VST_DRIVE_ID temp_drive_id; 22 VST_COMP_STATE temp_state;

Example 1 /****************************************

Page 696 of the ADIC 601355 Rev A user manual — 23 VST_COMP_STATE
Page 696 · click to enlarge
Page 696

23 VST_COMP_STATE

statelist[VST_MAX_ITEMS]; 24 VST_DRIVE_POOL_NAME poolname; 25 int i; 26 VST_COMMAND_HANDLE cmd; 27 int varyopt; 28 int stateopt; 29 30 /* get parameters from user */ 31 printf(“*** Drive Vary parameters

***\n” ); 32 printf(“0) Vary by drive list , 1)

Vary by drive pool 2) Vary by drive ID ==> “ ); 33 varyopt = atoi(gets(input)); 34 35 if (varyopt == 0) 36 { 37 /* vary by drive list */ 38 /* get the list */ 39 count = vst_getdrivelist(drivelist, VST_MAX_ITEMS); 40 VSCMD_DriveVary_SetDefaults( 41 VSID_DRIVE_ID_LIST, count,drivelist, 42 VSID_ENDFIELD); 43 } 44 else if (varyopt == 1) 45 { 46 /* vary by drive pool */ 47 return(vst_drivevary_pool_execute ()); 48 } 49 else 50 { 51 /* vary a single drive */ 52 printf(“\nEnter Drive ID ==> “); 53 temp_drive_id = atoi(gets(input)); 54 VSCMD_DriveVary_SetDefaults(

Page 697 of the ADIC 601355 Rev A user manual — Example
Page 697 · click to enlarge
Page 697

55 VSID_DRIVE_ID, temp_drive_id, 56 VSID_ENDFIELD); 57 } 58 59 printf(“0) Vary by state list , 1)

Vary single state ==> “ ); 60 stateopt = atoi(gets(input)); 61 if (stateopt == 0) 62 { 63 /* vary by using a list of component states */ 64 printf(“\nEnter New States (1)ONLINE (2)OFFLINE (3) DIAG”); 65 for (i = 0; i < count; i++) 66 { 67 printf(“State #%d: “, count+1); 68 statelist[i] = atoi(gets(input)); 69 } 70 71 VSCMD_DriveVary_SetDefaults( 72 VSID_COMP_STATE_LIST, count,statelist, 73 VSID_ENDFIELD); 74 } 75 else 76 { 77 /* vary everyting to a single state */ 78 printf(“\nEnter New State (1) ONLINE (2) OFFLINE (3) DIAG ==>”); 79 temp_state = atoi(gets(input)); 80 VSCMD_DriveVary_SetDefaults( 81 VSID_COMP_STATE, temp_state, 82 VSID_ENDFIELD); 83 } 84 85 /* create the command handle */

Page 698 of the ADIC 601355 Rev A user manual — Notes
Page 698 · click to enlarge
Page 698

86 /* Note that the command handle is

not */ 87 /* destoyed in this routine, but in

*/ 88 /* vst_dispatch when final status is

received. */ 89 cmd = VS_Command_Create(); 90 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 91 { 92 /* Send the command to the VolServ software. */ 93 /* Note that status is not processed here. */ 94 /* Instead, it is processed in the */ 95 /* vst_dispatch routine. Also, note that */ 96 /* default values such as timeout, value */ 97 /* retry limit and priority are set as */ 98 /* default parameters. */ 99 rc = VSCMD_DriveVary(cmd, 100 VSID_ENDFIELD); 101 } 102 return ( rc ); 103}

VolServ can generate intermediate status in response to a Drive Vary request.

VSCMD_DriveVary does not trigger any MediaClass callbacks from VolServ.

If a list of media specified in a Drive Vary request contains media of more than one type, the request fails.

Page 699 of the ADIC 601355 Rev A user manual — Notes
Page 699 · click to enlarge
Page 699

Mounted drives that have their state changed remain in-use; varying a drive has no impact on client data transfer operations in progress, and the client receives no automatic notification of a drive state change.

Drives can be varied regardless of whether or not they are associated with an archive.

Drives can be varied regardless of whether or not they are allocated; however, allocated drives that are not on-line cannot be dismounted.

Drives can be varied by an operator and over the client interface into the off-line, on-line, and diagnostic states only.

The unavailable state is only assignable by VolServ when a higher level component in the archive system is no longer on-line. For example, varying a CLM off-line causes the associated drive to be viewed as unavailable.

The VSID_DRIVE_ID_LIST and VSID_COMP_STATE_LIST parameters require that two arguments be passed instead of one.

All parameters can be set for the specific request being sent by passing them to this function, or they can be set for all Drive Vary requests using the VSCMD_DriveVary_SetDefaults command.

It is possible to vary drives to different states with one request. To do this, use the VSID_DRIVE_ID_LIST and VSID_COMP_STATE_LIST parameters.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

Page 700 of the ADIC 601355 Rev A user manual — Tip
Page 700 · click to enlarge
Page 700

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Drive Vary command are set with VSCMD_DriveVary_SetDefaults . If command-specific defaults are set for the Drive Vary command, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Drive Vary command, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

The following fields can be retrieved from the status handle after a successful DriveVary request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_DRIVE_ID ,
Page 701 of the ADIC 601355 Rev A user manual — Note
Page 701 · click to enlarge
Page 701
  • VSID_DRIVE_ID_ENTRY ,
  • VSID_DRIVE_ID_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE , VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_DriveVary_SetDefaults(l)
Page 702 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 702 · click to enlarge
Page 702

VSCMD_Drive Vary_ SetDefaults

VSCMD_DriveVary_SetDefaults is the call issued to set the command default parameters for Drive Vary commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_DriveVary_SetDefaults ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMP_STATE (VST_COMP_STATE) The target state for the individual drive or drive pool group specified in VSID_DRIVE_ID. Used when varying the drives to different states. Valid VSID_COMP_STATE values are enumerated in the vs_types.h file.

VSID_COMP_STATE_LIST (int) Number of states contained in this list.

Parameters · Parameter Type Description

Page 703 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 703 · click to enlarge
Page 703

(VST_COMP_STATE *) Pointer to the list of one or more target states for the drive specified in VSID_DRIVE_ID_LIST. Used when varying the drives to different states. Valid VSID_COMP_STATE_LIST values are enumerated in the vs_types.h file.

VSID_DRIVE_ID (VST_DRIVE_ID) An individual drive whose state is varied. Not necessary when specifying drives to different states.

VSID_DRIVE_ID_LIST (int) Number of drives contained in this list.

(VST_DRIVE_ID *) Pointer to the list of one or more drives whose states are to be varied. Not necessary when specifying drives to different states.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Name of a drive pool group to vary the state of all drives associated with the drive pool group. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted. Not necessary when specifying drives to different states.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Drive Vary commands.

VSID_PRIORITY (VST_PRIORITY) The execution priority (to override the default global execution priority) for Drive Vary command requests. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameter Type Description

Page 704 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 704 · click to enlarge
Page 704

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software is to retry for command status from VolServ before returning a time-out to the client software (to override the default global retry limit) for Drive Vary command requests. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in the USER_FIELD for Drive Vary commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Drive Vary commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 705 of the ADIC 601355 Rev A user manual — Return Values
Page 705 · click to enlarge
Page 705

Return Values VSCMD_DriveVary_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_drivevary_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DriveVary API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_drivevary_execute(void) 14 #else 15 VST_BOOLEAN vst_drivevary_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 int count; 20 VST_DRIVE_ID

Example 1 /**************************************** · drivelist[VST_MAX_ITEMS];

Page 706 of the ADIC 601355 Rev A user manual — Return Values
Page 706 · click to enlarge
Page 706

21 VST_DRIVE_ID temp_drive_id; 22 VST_COMP_STATE temp_state; 23 VST_COMP_STATE

statelist[VST_MAX_ITEMS]; 24 VST_DRIVE_POOL_NAME poolname; 25 int i; 26 VST_COMMAND_HANDLE cmd; 27 int varyopt; 28 int stateopt; 29 30 /* get parameters from user */ 31 printf(“*** Drive Vary parameters

***\n” ); 32 printf(“0) Vary by drive list , 1)

Vary by drive pool 2) Vary by drive ID ==> “ ); 33 varyopt = atoi(gets(input)); 34 35 if (varyopt == 0) 36 { 37 /* vary by drive list */ 38 /* get the list */ 39 count = vst_getdrivelist(drivelist, VST_MAX_ITEMS); 40 VSCMD_DriveVary_SetDefaults( 41 VSID_DRIVE_ID_LIST, count,drivelist, 42 VSID_ENDFIELD); 43 } 44 else if (varyopt == 1) 45 { 46 /* vary by drive pool */ 47 return(vst_drivevary_pool_execute ()); 48 } 49 else 50 { 51 /* vary a single drive */ 52 printf(“\nEnter Drive ID ==> “);

Page 707 of the ADIC 601355 Rev A user manual — Return Values
Page 707 · click to enlarge
Page 707

53 temp_drive_id = atoi(gets(input)); 54 VSCMD_DriveVary_SetDefaults( 55 VSID_DRIVE_ID, temp_drive_id, 56 VSID_ENDFIELD); 57 } 58 59 printf(“0) Vary by state list , 1)

Vary single state ==> “ ); 60 stateopt = atoi(gets(input)); 61 if (stateopt == 0) 62 { 63 /* vary by using a list of component states */ 64 printf(“\nEnter New States (1)ONLINE (2)OFFLINE (3) DIAG”); 65 for (i = 0; i < count; i++) 66 { 67 printf(“State #%d: “, count+1); 68 statelist[i] = atoi(gets(input)); 69 } 70 71 VSCMD_DriveVary_SetDefaults( 72 VSID_COMP_STATE_LIST, count,statelist, 73 VSID_ENDFIELD); 74 } 75 else 76 { 77 /* vary everyting to a single state */ 78 printf(“\nEnter New State (1) ONLINE (2) OFFLINE (3) DIAG ==>”); 79 temp_state = atoi(gets(input)); 80 VSCMD_DriveVary_SetDefaults( 81 VSID_COMP_STATE, temp_state, 82 VSID_ENDFIELD); 83 }

Page 708 of the ADIC 601355 Rev A user manual — Note
Page 708 · click to enlarge
Page 708

84 85 /* create the command handle */ 86 /* Note that the command handle is

not */ 87 /* destroyed in this routine, but in

*/ 88 /* vst_dispatch when final status is

received. */ 89 cmd = VS_Command_Create(); 90 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 91 { 92 /* Send the command to the VolServ software. */ 93 /* Note that status is not processed here. */ 94 /* Instead, it is processed in the */ 95 /* vst_dispatch routine. Also, note that,*/ 96 /* default values such as timeout, value */ 97 /* retry limit and priority are set as */ 98 /* default parameters. */ 99 rc = VSCMD_DriveVary(cmd, 100 VSID_ENDFIELD); 101 } 102 return ( rc ); 103}

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 709 of the ADIC 601355 Rev A user manual — See Also
Page 709 · click to enlarge
Page 709

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_DriveVary(l)
Page 710 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Export ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )
Page 710 · click to enlarge
Page 710

VSCMD_ Export

VSCMD_Export is issued to execute the VolServ Export request.

A client uses the Export request to mark media and related information for removal from the VolServ system. If the specified media are not associated with an archive, they are logically removed from the VolServ system. If the specified media are associated with an archive, they are placed on the eject list of the appropriate archive.

A client can also use the Export request to remove information about media that have been checked out of the archive and are physically out of the archive.

Upon receipt of an Export request, VolServ marks the specified media for ejection and returns a successful return code to the client. A message is sent to the operator console indicating which media need to be ejected from the archive.

To physically remove media from the archive system, an operator must select the eject function from the appropriate archive's console display. The eject function is not available from the API.

After a medium specified on an Export request is physically removed from the archive system, the medium is no longer under the control of VolServ. Consequently, all information related to exported medium is deleted from the VolServ system.

Synopsis VST_BOOLEAN VSCMD_Export ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )

Page 711 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 711 · click to enlarge
Page 711

Arguments • handle = The command handle for this Export request.

  • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMMENT (VST_COMMENT) The export comment to use for these media. This comment appears with the media on the archive’s eject list.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_MEDIA_ID_LIST (int) Number of media identified in the list.

(char **) Identifiers of the media to export.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software is to retry for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 712 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 712 · click to enlarge
Page 712

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 713 of the ADIC 601355 Rev A user manual — Return Values
Page 713 · click to enlarge
Page 713

Return Values VSCMD_Export returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 714 of the ADIC 601355 Rev A user manual — Example
Page 714 · click to enlarge
Page 714
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_export_execute 4 * 5 * PURPOSE: 6 * This function sends an export command to the 7 * Volserv, prompting for all values needed. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_export_execute(void) 15 #else 16 VST_BOOLEAN vst_export_execute() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 int count; 21 char * medialist[VST_MAX_ITEMS]; 22 VST_COMMENT comment;

Example 1 /****************************************

Page 715 of the ADIC 601355 Rev A user manual — Example
Page 715 · click to enlarge
Page 715

23 VST_COMMAND_HANDLE cmd; 24 25 /* get parameters from user */ 26 printf(“*** Export Parameters ***\n”

); 27 printf(“\nEnter Export Comment “); 28 gets( comment); 29 count =

vst_getmedialist(medialist, VST_MAX_ITEMS); 30 /* create the command handle */ 31 /* Note that the command handle is

not */ 32 /* destroyed in this routine, but in

*/ 33 /* vst_dispatch when final status is

received. */ 34 cmd = VS_Command_Create(); 35 /* validate the command handle */ 36 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 37 { 38 /* Send the command to the VolServ software. */ 39 /* Note that status is not processed here. */ 40 /* Instead, it is processed in the */ 41 /* vst_dispatch routine. Also, note that */ 42 /* default values such as time out, value */ 43 /* retry limit and priority are set as */ 44 /* default parameters. */ 45 rc = VSCMD_Export(cmd, 46 VSID_COMMENT, comment, 47 VSID_MEDIA_ID_LIST, count, medialist, 48 VSID_ENDFIELD); 49 } 50

Page 716 of the ADIC 601355 Rev A user manual — Notes
Page 716 · click to enlarge
Page 716

51 return ( rc ); 52 }

VolServ does not generate intermediate status in response to an Export request.

VSCMD_Export triggers MediaClass callbacks from VolServ.

The VSID_Media_ID_LIST parameter requires that two arguments be passed instead of one.

If a list of media specified in an Export request contains media of more than one type, the request fails.

The Export command cannot be cancelled. Media can be “unmarked” for export via the ClearEject request.

A medium that is marked for export from the archive system cannot be reallocated to satisfy a client request, except to satisfy a query of the medium. Any other request (except ClearEject) received for that medium fails.

A medium can be exported even if it is currently allocated. Attempts to physically eject the medium fail until the medium is no longer in-use.

The total length of time the API software waits for a command status in asynchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

Page 717 of the ADIC 601355 Rev A user manual — Tip
Page 717 · click to enlarge
Page 717

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Export command are set with VSCMD_Export_SetDefaults . If command-specific defaults are set for all commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Export command, the parameter identifier and the value to be used for the parameter can be submitted on the command itself.

The following fields can be retrieved from the status handle after a successful Export request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
Page 718 of the ADIC 601355 Rev A user manual — Note
Page 718 · click to enlarge
Page 718
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Initialize(l),
  • VSCMD_Export_SetDefaults(l)
Page 719 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 719 · click to enlarge
Page 719

VSCMD_ Export_ SetDefaults

VSCMD_Export_SetDefaults sets command-level default parameters for the Export command.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_Export_SetDefaults ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_COMMENT (VST_COMMENT) The export comment to use for these media. The comment appears with media on the archive’s eject list.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Export commands.

VSID_MEDIA_ID_LIST (int) Number of media in the list.

Parameters · Parameter Type Description

Page 720 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 720 · click to enlarge
Page 720

(char **) Array of media identifiers to export.

VSID_PRIORITY (VST_PRIORITY) The execution priority (to override the default global execution priority) for Export commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Export commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Export commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Export commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 721 of the ADIC 601355 Rev A user manual — Return Values
Page 721 · click to enlarge
Page 721

Return Values VSCMD_Export_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .

********* 2 * 3 * FUNCTION: vst_export_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Export API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_export_defaults(void) 15 #else 16 VST_BOOLEAN vst_export_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID enterprise_id; 26 VST_COMMENT comment; 27 28 /* get parameters from user */ 29 printf(“*** Export default

Example 1 /**************************************** · parameters ***\n” );

Page 722 of the ADIC 601355 Rev A user manual — Note
Page 722 · click to enlarge
Page 722

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 31 printf(“\nEnter Export Comment “); 32 gets( comment); 33 /* set the default parameters */ 34 rc = VSCMD_Export_SetDefaults( 35 VSID_PRIORITY, priority, 36 VSID_USER_FIELD, user_field, 37 VSID_TIMEOUT_VALUE, timeout, 38 VSID_RETRY_LIMIT, retries, 39 VSID_STATUS_WAIT_FLAG, wait_flag, 40 VSID_ENTERPRISE_ID, enterprise_id, 41 VSID_COMMENT, comment, 42 VSID_ENDFIELD); 43 44 return ( rc ); 45 }

If a list of media specified in an Export request contains media of more than one type, the request fails.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

30 vst_promptforglobals(&priority,

Page 723 of the ADIC 601355 Rev A user manual — See Also
Page 723 · click to enlarge
Page 723

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Export(l)
Page 724 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Import ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )
Page 724 · click to enlarge
Page 724

VSCMD_ Import

VSCMD_Import is issued to request execution of VolServ Import requests.

A client uses Import requests to logically add media to the VolServ system. Upon receipt of an Import request, the specified media are added to the VolServ system. If a non-unique media identifier is specified, the Import for that medium fails.

Import is a logical operation. Media must be physically entered into an archive before they are available for client use (mounting,"…"). Entry is performed by an operator selecting the Enter function from the appropriate archive's console display. The Enter function is not available from the API.

Synopsis VST_BOOLEAN VSCMD_Import ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )

Arguments • handle = The command handle for this Import request.

  • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 725 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 725 · click to enlarge
Page 725

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive for the imported media. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_BATCH_NAME (VST_BATCH_NAME) The batch name to be assigned to media that are automatically imported/checked in. Valid batch names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID

Identifier of the enterprise, if any, to receive final status on this request.

VSID_MANUFACTURER (VST_MANUFACTURER)

The manufacturer to be assigned to the imported media. Valid VSID_MANUFACTURER names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The MediaClass group where imported media is assigned.

VSID_MEDIA_ID_LIST (int) Number of media in the list.

(char **) Array of media identifiers to import.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 726 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 726 · click to enlarge
Page 726

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 727 of the ADIC 601355 Rev A user manual — Return Values
Page 727 · click to enlarge
Page 727

Return Values VSCMD_Import returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 728 of the ADIC 601355 Rev A user manual — Example
Page 728 · click to enlarge
Page 728
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_import_execute 4 * 5 * PURPOSE: 6 * This function sends a import command to the 7 * VolServ software, prompting for all values needed. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_import_execute(void) 15 #else 16 VST_BOOLEAN vst_import_execute() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 int count; 21 char * medialist[VST_MAX_ITEMS]; 22 VST_ARCHIVE_NAME archive;

Example 1 /****************************************

Page 729 of the ADIC 601355 Rev A user manual — Example
Page 729 · click to enlarge
Page 729

23 VST_MEDIA_CLASS_NAME mediaclass; 24 VST_BATCH_NAME batch; 25 VST_MANUFACTURER_NAM manuf; 26 VST_COMMAND_HANDLE cmd; 27 28 /* get parameters from user */ 29 printf(“*** Import parameters ***\n”

); 30 printf(“\nEnter Archive “); 31 gets( archive); 32 printf(“\nEnter Media Class “); 33 gets( mediaclass); 34 printf(“\nEnter Batch “); 35 gets( batch); 36 printf(“\nEnter Manufacturer “); 37 gets( manuf); 38 count = vst_getmedialist(medialist,

VST_MAX_ITEMS); 39 /* create the command handle */ 40 /* Note that the command handle is

not */ 41 /* destroyed in this routine, but in

*/ 42 /* vst_dispatch when final status is

received. */ 43 cmd = VS_Command_Create(); 44 /* make sure that the command handle

is not */ 45 /* null. */ 46 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 47 { 48 /* Send the command to the VolServ software. */ 49 /* Note that status is not processed here. */ 50 /* Instead, it is processed in the */ 51 /* vst_dispatch routine. Also, note that */ 52 /* default values such as timeout, value */

Page 730 of the ADIC 601355 Rev A user manual — Notes
Page 730 · click to enlarge
Page 730

53 /* retry limit and priority are set as */ 54 /* default parameters. */ 55 rc = VSCMD_Import(cmd, 56 VSID_ARCHIVE_NAME, archive, 57 VSID_MEDIA_CLASS_NAME, mediaclass, 58 VSID_BATCH_NAME, batch, 59 VSID_MANUFACTURER, manuf, 60 VSID_MEDIA_ID_LIST, count, medialist, 61 VSID_ENDFIELD); 62 } 63 64 return ( rc ); 65 }

VolServ does not generate intermediate status in response to an Import request.

VSCMD_Import triggers MediaClass callbacks from VolServ.

The VSID_MEDIA_ID_LIST parameter requires that two arguments be passed instead of one.

If a list of media specified in an Import request contains media of more than one type, the request fails.

Import is a logical operation. Media must be physically entered into an archive by an operator before they are available for general use.

Media identifier values must be unique throughout a VolServ system. Non-unique names are rejected.

Page 731 of the ADIC 601355 Rev A user manual — Notes
Page 731 · click to enlarge
Page 731

Media identifiers of media being imported into manual archives may contain alphanumeric and special characters, including spaces. However, spaces cannot be used as leading or trailing characters. If media in a manual archive can later be moved into an automated archive, the media identifiers must also conform to any naming restrictions imposed by the automated archive. For example, special characters may not be allowed in media identifiers in the automated archive.

Media type for the media is determined by the media type of the specified MediaClass group.

After the MediaClass capacity is reached, no additional media can be imported into the MediaClass group.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for Import requests is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
Page 732 of the ADIC 601355 Rev A user manual — Note
Page 732 · click to enlarge
Page 732
  • Command-specific parameter defaults for Import commands are set with VSCMD_Import_SetDefaults . If command-specific defaults are set for import commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Import command, the parameter identifier and the value to be used for the parameter can be submitted on the request itself.

The following fields can be retrieved from the status handle after a successful Import request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE , V
  • SID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 733 of the ADIC 601355 Rev A user manual — See Also
Page 733 · click to enlarge
Page 733

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Import_SetDefaults(l)
Page 734 of the ADIC 601355 Rev A user manual — VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 734 · click to enlarge
Page 734

VSCMD_ Import_ SetDefaults

VSCMD_Import_SetDefaults is the call issued to set the command default parameters for Import commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_Import_SetDefaults ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive (to override the default global destination archive) for the imported media. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Parameters · Parameter Type Description

Page 735 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 735 · click to enlarge
Page 735

VSID_BATCH_NAME (VST_BATCH_NAME) The batch name to be assigned to media that are imported. Valid batch names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Import commands.

VSID_MANUFACTURER (VST_MANUFACTURER)

The manufacturer to be assigned to the imported media. Valid manufacturer names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The MediaClass group where imported media are assigned.

VSID_MEDIA_ID_LIST (int) Number of media in the list.

(char **) Pointer to an array of media identifiers to import.

VSID_PRIORITY (VST_PRIORITY) The execution priority for Import commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Import commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 736 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 736 · click to enlarge
Page 736

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Import commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in status messages returned for Import commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Import_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Parameter Type Description

Page 737 of the ADIC 601355 Rev A user manual — Example
Page 737 · click to enlarge
Page 737

********* 2 * 3 * FUNCTION: vst_import_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Import API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_import_defaults(void) 15 #else 16 VST_BOOLEAN vst_import_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 VST_BATCH_NAME batch; 27 VST_MANUFACTURER_NAME manuf; 28 29 /* get parameters from user */ 30 printf(“*** Import default

parameters ***\n” ); 31 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 32 printf(“\nEnter Batch “); 33 gets( batch);

Example 1 /****************************************

Page 738 of the ADIC 601355 Rev A user manual — Note
Page 738 · click to enlarge
Page 738

34 printf(“\nEnter Manufacturer “); 35 gets( manuf); 36 /* set the default parameters */ 37 rc = VSCMD_Import_SetDefaults( 38 VSID_PRIORITY, priority, 39 VSID_USER_FIELD, user_field, 40 VSID_TIMEOUT_VALUE, timeout, 41 VSID_RETRY_LIMIT, retries, 42 VSID_STATUS_WAIT_FLAG, wait_flag, 43 VSID_ENTERPRISE_ID, enterprise_id, 44 VSID_BATCH_NAME, batch, 45 VSID_MANUFACTURER, manuf, 46 VSID_ENDFIELD); 47 48 return ( rc ); 49 }

If a list of media specified in an Import request contains media of more than one type, the request fails.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Import(l)
Page 739 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_IntransitQuery ( VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD )
Page 739 · click to enlarge
Page 739

VSCMD_ IntransitQuery

VSCMD_IntransitQuery is issued to request execution of VolServ Intransit Query commands.

A client uses Intransit Query requests to obtain information about media in the intransit state. The query returns a list of media identifiers.

A medium is considered to be intransit if it satisfies either of the following conditions:

  • It is waiting to be entered into an archive as a result of Import, Mount, Move, Check-in, or a migration activity processing.
  • It is in the homeless state.

Synopsis VST_BOOLEAN VSCMD_IntransitQuery ( VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = The command handle for this Intransit Query request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 740 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 740 · click to enlarge
Page 740

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status).Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

Parameters · Parameter Type Description

Page 741 of the ADIC 601355 Rev A user manual — Return Values
Page 741 · click to enlarge
Page 741

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_IntransitQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 742 of the ADIC 601355 Rev A user manual — Example
Page 742 · click to enlarge
Page 742

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_intransitquery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_IntransitQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/

Example 1 /****************************************

Page 743 of the ADIC 601355 Rev A user manual — Example
Page 743 · click to enlarge
Page 743

12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_intransitquery_execute(void) 14 #else 15 VST_BOOLEAN

vst_intransitquery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_COMMAND_HANDLE cmd; 20 21 printf(“*** Intransit Query ***\n” ); 22 23 /* create the command handle */ 24 /* Note that the command handle is

not */ 25 /* destroyed in this routine, but in

*/ 26 /* vst_dispatch when final status is

received. */ 27 cmd = VS_Command_Create(); 28 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 29 { 30 /* Send the command to the VolServ software. */ 31 /* Note that status is not processed here. */ 32 /* Instead, it is processed in the */ 33 /* vst_dispatch routine. Also, note that */ 34 /* default values such as timeout, value */ 35 /* retry limit and priority are set as */ 36 /* default parameters. There are no */ 37 /* command-specific parameters for */ 38 /* intransit query. */

Page 744 of the ADIC 601355 Rev A user manual — Notes
Page 744 · click to enlarge
Page 744

39 rc = VSCMD_IntransitQuery(cmd, 40 VSID_ENDFIELD); 41 } 42 return ( rc ); 43 }

VolServ can generate intermediate status in response to an Intransit Query request.

VSCMD_IntransitQuery does not trigger any MediaClass callbacks from VolServ.

The query option on the Intransit Query command is not currently supported by VolServ. VolServ unconditionally returns the identifiers of all media in the intransit state.

Only media in the intransit state are queried and returned.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

Page 745 of the ADIC 601355 Rev A user manual — Note
Page 745 · click to enlarge
Page 745
  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Intransit Query request are set with VSCMD_IntransitQuery_SetDefaults . If command-specific defaults are set for Intransit Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Intransit Query request, the parameter identifier and the value to be used for the parameter can be submitted on the request itself.

The following fields can be retrieved from the status handle after a successful Intransit Query request:

  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 746 of the ADIC 601355 Rev A user manual — See Also
Page 746 · click to enlarge
Page 746

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Intransit_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_IntransitQuery_SetDefaults(l)
Page 747 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID
Page 747 · click to enlarge
Page 747

VSCMD_ IntransitQuery_SetDefaults

VSCMD_IntransitQuery_SetDefaults is issued to set command-level default parameters for Intransit Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_IntransitQuery_SetDefaults ( “…”, VSID_ENDFIELD )

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH

Name of the client dispatch routine to receive status for Intransit Query commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID

Identifier of the enterprise, if any, to receive final status for Intransit Query commands.

Parameters · Parameter Type Description

Page 748 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 748 · click to enlarge
Page 748

VSID_PRIORITY (VST_PRIORITY) The execution priority (to override the default global execution priority) for Intransit Query commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive.The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Intransit Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Intransit Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Intransit Query commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 749 of the ADIC 601355 Rev A user manual — Return Values
Page 749 · click to enlarge
Page 749

Return Values VSCMD_IntransitQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_intransitquery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_IntransitQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_intransitquery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_intransitquery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE;

Example 1 /****************************************

Page 750 of the ADIC 601355 Rev A user manual — Note
Page 750 · click to enlarge
Page 750

20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Intransit Query default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_IntransitQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 751 of the ADIC 601355 Rev A user manual — See Also
Page 751 · click to enlarge
Page 751

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_IntransitQuery(l)
Page 752 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Lock ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )
Page 752 · click to enlarge
Page 752

VSCMD_Lock VSCMD_Lock is issued to request execution of the VolServ Lock command.

The lock identifier assigned to the locked drive is returned to the client. This lock identifier must be used by clients on subsequent requests (such as Mount) for those drives.

A request to lock a drive that is busy (mounted or previously locked) queues until the drive becomes available.

A Lock request that specifies a drive pool or a list of drives should also indicate the number of drives from the pool/list to be locked. VolServ selects the drives to lock from within the pool/list according to drive availability.

A Lock request cannot specify a drive pool or a list of drives that spans archives.

A Lock request reserves one drive for exclusive use, if a quantity is not specified on the command.

VolServ considers only on-line drives as candidates to be locked. If there is not a sufficient number of on-line drives in the same archive to satisfy a Lock request, the Lock request fails.

If there is a sufficient number of on-line drives in the same archive to satisfy a Lock request, but the number of available on-line drives is not sufficient, the request waits until sufficient drives become available. Partial locks are not set.

Synopsis VST_BOOLEAN VSCMD_Lock ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )

Page 753 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 753 · click to enlarge
Page 753

Arguments • handle = The command handle for this Lock request.

  • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVE_COUNT (int) Number of drives to lock.

VSID_DRIVE_EXCL_LIST (int) Number of drives in the drive exclusion list.

(VST_DRIVE_ID *) Pointer to the identifiers of the drives in the specified drive pool that are not to be locked.

VSID_DRIVE_ID (VST_DRIVE_ID) Identifier of a single drive to be reserved for exclusive use.

VSID_DRIVE_ID_LIST (int) Number of drives in list.

(VST_DRIVE_ID *) Pointer to the identifiers of one or more drives to be reserved for exclusive use.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Name of the drive pool group to be reserved for exclusive use. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

Parameters · Parameter Type Description

Page 754 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 754 · click to enlarge
Page 754

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status).Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 755 of the ADIC 601355 Rev A user manual — Return Values
Page 755 · click to enlarge
Page 755

Return Values VSCMD_Lock returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 756 of the ADIC 601355 Rev A user manual — Example
Page 756 · click to enlarge
Page 756
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_lock_pool_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Lock API call for drive 7 * pools. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_lock_pool_execute(void) 15 #else 16 VST_BOOLEAN vst_lock_pool_execute() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_DRIVE_ID

excllist[VST_MAX_ITEMS]; 21 int count;

Example 1 /****************************************

Page 757 of the ADIC 601355 Rev A user manual — Example
Page 757 · click to enlarge
Page 757

22 VST_DRIVE_POOL_NAME dp; 23 int drivecount; 24 VST_COMMAND_HANDLE cmd; 25 26 printf(“\nEnter Drive Pool Name

==>”); 27 gets( dp ); 28 printf(“\nEnter drive exclusion

list\n”); 29 count =

vst_getdrivelist(excllist, VST_MAX_ITEMS); 30 printf(“Enter number of drives to

lock ==> “); 31 drivecount = atoi(gets(input)); 32 33 /* create the command handle */ 34 /* Note that the command handle is

not */ 35 /* destroyed in this routine, but in

*/ 36 /* vst_dispatch when final status is

received. */ 37 cmd = VS_Command_Create(); 38 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 39 { 40 /* Send the command to the VolServ software. */ 41 /* Note that status is not processed here. */ 42 /* Instead, it is processed in the */ 43 /* vst_dispatch routine. Also, note that */ 44 /* default values such as timeout,*/ 45 /* value retry limit and priority are set as */ 46 /* default parameters. */ 47 rc = VSCMD_Lock(cmd, 48 VSID_DRIVEPOOL_NAME, dp,

Page 758 of the ADIC 601355 Rev A user manual — Notes
Page 758 · click to enlarge
Page 758

49 VSID_DRIVE_EXCL_LIST, count,excllist, 50 VSID_DRIVE_COUNT, drivecount, 51 VSID_ENDFIELD); 52 } 53 return(rc); 54 }

VolServ can generate intermediate status in response to a Lock request.

VSCMD_Lock does not trigger any MediaClass callbacks from VolServ.

The VSID_DRIVE_ID_LIST and VSID_DRIVE_EXCEL_LIST parameters require that two arguments be passed instead of one.

A Lock command that specifies a list of drives fails if the drives are not contained within the same physical archive.

A Lock command that specifies a drive pool that spans archives fails.

Any Mount or Dismount request containing the proper lock identifier has access to a locked drive.

If a Mount request does not specify a lock identifier for a locked drive, whether the drive is available for use or not, the Mount request waits until the drive is both unlocked and available.

Page 759 of the ADIC 601355 Rev A user manual — Notes
Page 759 · click to enlarge
Page 759

If a Mount request specifies a drive pool and does not specify a lock identifier, only available and unlocked drives in the specified drive pool are considered to satisfy the Mount request. If there are no available, unlocked drives in the specified drive pool, the Mount request waits until a drive from the specified drive pool becomes available and unlocked.

There are three ways to specify drives for locking: by drive identifier, drive list, or drive pool (with or without the exclusion list).

A Lock command that is queued and awaiting resources can be cancelled via the Cancel command.

An Unlock command should be issued when the client no longer needs drives for exclusive use.

All parameters can be set for the specific request being sent by passing them to this function, or they can be set for all Lock requests using the VSCMD_Lock_SetDefaults function.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the API is not able to receive status for this request.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on command requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Page 760 of the ADIC 601355 Rev A user manual — Tip
Page 760 · click to enlarge
Page 760
  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Lock command are set with VSCMD_Lock_SetDefaults . If command-specific defaults are set for the Lock command, they override the global defaults for all Lock requests.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Lock request, the parameter identifier and the value to be used for the parameter can be submitted on the command request itself.

The following fields can be retrieved from the status handle after a successful Lock request:

  • VSID_Drive_ID,
  • VSID_DRIVE_ID_ENTRY,
  • VSID_DRIVE_ID_TABLE ,
  • VSID_ERROR_CODE,
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_TABLE ,
  • VSID_LOCK_ID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .
Page 761 of the ADIC 601355 Rev A user manual — Note
Page 761 · click to enlarge
Page 761

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Lock_SetDefaults(l),
  • VSCMD_Unlock(l)
Page 762 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 762 · click to enlarge
Page 762

VSCMD_Lock _SetDefaults

VSCMD_Lock_SetDefaults is issued to set the command-level default parameters for the Lock command.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_Lock_SetDefaults ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVE_COUNT (int) Number of drives to lock.

VSID_DRIVE_EXCL_LIST (int) Number of drives in list.

(VST_DRIVE_ID *) Pointer to a list of drives to exclude from the drive pool.

VSID_DRIVE_ID (VST_DRIVE_ID) Drive identifier of drive to lock.

Parameters · Parameter Type Description

Page 763 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 763 · click to enlarge
Page 763

VSID_DRIVE_ID_LIST (int) Number of drives in list.

(VST_DRIVE_ID *) Pointer to a list of drives to lock.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

The drive pool of drives to lock. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Lock commands.

VSID_PRIORITY (VST_PRIORITY) The execution priority for Lock commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software (to override the default global retry limit) for Lock commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status).Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

Parameter Type Description

Page 764 of the ADIC 601355 Rev A user manual — Return Values
Page 764 · click to enlarge
Page 764

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Lock commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Lock commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Lock_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Parameter Type Description

Page 765 of the ADIC 601355 Rev A user manual — Example
Page 765 · click to enlarge
Page 765

********* 2 * 3 * FUNCTION: vst_lock_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Lock API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_lock_defaults(void) 15 #else 16 VST_BOOLEAN vst_lock_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Lock default parameters

***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Lock_SetDefaults( 32 VSID_PRIORITY, priority,

Example 1 /****************************************

Page 766 of the ADIC 601355 Rev A user manual — Note
Page 766 · click to enlarge
Page 766

33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Lock(l)
Page 767 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_MediaClassQuery ( VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD )
Page 767 · click to enlarge
Page 767

VSCMD_ MediaClassQuery

VSCMD_MediaClassQuery is issued to request execution of VolServ Media Class Query commands.

Media Class Query commands are used to obtain information about MediaClass groups in the VolServ system.

Upon receipt of a Media Class Query command, where obtains the requested information about the specified MediaClass groups and returns this information to the client.

Synopsis VST_BOOLEAN VSCMD_MediaClassQuery ( VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD )

Arguments • handle = The command handle for this Media Class Query request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 768 of the ADIC 601355 Rev A user manual — VSID_QUERY_OPTION (VST_QUERY_OPTION)
Page 768 · click to enlarge
Page 768

VSID_CLASS_QUERY_OPT (VST_QUERY_LIST_OPTION)

Indicates the amount of media information being requested for each medium in each reported MediaClass group. Valid VSID_CLASS_QUERY_OPT values are enumerated in the vs_types.h file.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

If information is being requested on a single MediaClass group, specifies the name of that MediaClass group. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for a single specified MediaClass group or on all MediaClass groups. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 769 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 769 · click to enlarge
Page 769

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status).Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MediaClassQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

Parameter Type Description

Page 770 of the ADIC 601355 Rev A user manual — Return Values
Page 770 · click to enlarge
Page 770

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 771 of the ADIC 601355 Rev A user manual — Example
Page 771 · click to enlarge
Page 771

********* 2 * 3 * FUNCTION: vst_mediaclassquery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_MediaClassQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediaclassquery_execute(void) 14 #else 15 VST_BOOLEAN

vst_mediaclassquery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_QUERY_OPTION queryopt; 20 VST_QUERY_LIST_OPTION querylistopt; 21 VST_MEDIA_CLASS_NAME mediaclass; 22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** MediaClass Query

parameters ***\n” ); 26 printf(“0) Query by Media Class Name,

1. Query all ==> “ ); 27 queryopt = atoi(gets(input)); 28 29 if (queryopt == 0) 30 { 31 printf(“\nEnter Media Class Name ==>”); 32 gets( mediaclass); 33 }

Example 1 /****************************************

Page 772 of the ADIC 601355 Rev A user manual — Example
Page 772 · click to enlarge
Page 772

34 printf(“\n0) no media list, 1) Media

List, 2) Media List Details ==> “); 35 querylistopt = atoi(gets(input)); 36 37 /* create the command handle */ 38 /* Note that the command handle is

not */ 39 /* destroyed in this routine, but in

*/ 40 /* vst_dispatch when final status is

received. */ 41 cmd = VS_Command_Create(); 42 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 43 { 44 /* Send the command to the VolServ software. */ 45 /* Note that status is not processed here. */ 46 /* Instead, it is processed in the */ 47 /* vst_dispatch routine. Also, note that */ 48 /* default values such as timeout,*/ 49 /* value retry limit and priority are set as */ 50 /* default parameters. */ 51 if (queryopt == 0) 52 { 53 /* query one media class */ 54 rc = VSCMD_MediaClassQuery(cmd, 55 VSID_QRY_OPTION, queryopt, 56 VSID_CLASS_QRY_OPTION, querylistopt, 57 VSID_MEDIA_CLASS_NAME, mediaclass, 58 VSID_ENDFIELD); 59 }

Page 773 of the ADIC 601355 Rev A user manual — Notes
Page 773 · click to enlarge
Page 773

60 else 61 { 62 /* query all media classes */ 63 rc = VSCMD_MediaClassQuery(cmd, 64 VSID_QRY_OPTION, queryopt, 65 VSID_CLASS_QRY_OPTION, querylistopt, 66 VSID_ENDFIELD); 67 } 68 } 69 return ( rc ); 70 }

VolServ can generate intermediate status in response to a MediaClassQuery request.

VSCMD_MediaClassQuery does not trigger any MediaClass callbacks from VolServ.

When all media classes are requested, each MediaClass status is reported in a group of one or more intermediate status messages.

If a request for MediaClass status determines there is no MediaClass status on which to report, the status message returns a STATUS_FAIL with error of ERR_NOTFOUND.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

Page 774 of the ADIC 601355 Rev A user manual — Tip
Page 774 · click to enlarge
Page 774

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status for Media Class Query requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—.global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Media Class Query commands are set with VSCMD_MediaClassQuery_SetDefaults . If command-specific defaults are set for the Media Class Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Media Class Query command, the parameter identifier and the value to be used for the parameter can be submitted for the specific command itself.

The following fields can be retrieved from the status handle after a successful Media Class Query request:

  • VSID_MEDIACLASS_HANDLE ,
  • VSID_MEDIACLASS_HANDLE_ENTRY ,
  • VSID_MEDIACLASS_HANDLE_TABLE ,
Page 775 of the ADIC 601355 Rev A user manual — Note
Page 775 · click to enlarge
Page 775
  • VSID_QUERY_OPTION ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_MediaClass_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_MediaClassQuery_SetDefaults(l)
Page 776 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 776 · click to enlarge
Page 776

VSCMD_ MediaClassQuery_ SetDefaults

VSCMD_MediaClassQuery_SetDefaults is issued to set the command-level default parameters for the Media Class Query command.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_MediaClassQuery_SetDefaults ( “…”, VSID_ENDFIELD )

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLASS_QUERY_OPT (VST_QUERY_LIST_OPTION)

Indicates the amount of media information being requested for each medium in each reported MediaClass group. Valid VSID_CLASS_QUERY_OPT values are enumerated in the vs_types.h file.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Media Class Query commands.

Parameters · Parameter Type Description

Page 777 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 777 · click to enlarge
Page 777

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status for Media Class Query commands.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

If information is being requested on a single MediaClass group, specifies the name of that MediaClass group. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_PRIORITY (VST_PRIORITY) The execution priority for Media Class Query commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for a single specified MediaClass group or on all MediaClass groups. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Media Class Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameter Type Description

Page 778 of the ADIC 601355 Rev A user manual — Return Values
Page 778 · click to enlarge
Page 778

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Media Class Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Media Class Query commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MediaClassQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_mediaclassquery_defaults 4 * 5 * PURPOSE:

Parameter Type Description · Example 1 /****************************************

Page 779 of the ADIC 601355 Rev A user manual — Return Values
Page 779 · click to enlarge
Page 779

6 * This function sets the default parameters for the 7 * VSCMD_MediaClassQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_mediaclassquery_defaults(void ) 15 #else 16 VST_BOOLEAN

vst_mediaclassquery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Media Class Query default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_MediaClassQuery_SetDefaults ( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field,

Page 780 of the ADIC 601355 Rev A user manual — Note
Page 780 · click to enlarge
Page 780

34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_MediaClassQuery(l)
Page 781 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 781 · click to enlarge
Page 781

VSCMD_ MediaQuery

VSCMD_MediaQuery is issued to request execution of the VolServ Media Query command.

Upon receipt of a Media Query command, VolServ obtains the requested information about the specified media and returns this information to the client.

Synopsis VST_BOOLEAN VSCMD_MediaQuery ( VST_COMMAND_HANDLE handle, "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_MEDIA_ID_LIST (int) Number of media in the list.

(char **) List of media identifiers to query.

Parameters · Parameter Type Description

Page 782 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 782 · click to enlarge
Page 782

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for each medium specified in a list of one or more media or whether information is being requested for all media. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status).Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

Parameter Type Description

Page 783 of the ADIC 601355 Rev A user manual — Return Values
Page 783 · click to enlarge
Page 783

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MediaQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 784 of the ADIC 601355 Rev A user manual — Example
Page 784 · click to enlarge
Page 784

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_mediaquery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_MediaQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/

Example 1 /****************************************

Page 785 of the ADIC 601355 Rev A user manual — Example
Page 785 · click to enlarge
Page 785

12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediaquery_execute(void) 14 #else 15 VST_BOOLEAN vst_mediaquery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_QUERY_OPTION queryopt; 20 int count; 21 char * medialist[VST_MAX_ITEMS]; 22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** Media Query parameters

***\n” ); 26 printf(“0) Query by media list, 1)

Query all ==> “ ); 27 queryopt = atoi(gets(input)); 28 29 if (queryopt == 0) 30 { 31 count = vst_getmedialist(medialist, VST_MAX_ITEMS); 32 } 33 34 /* create the command handle */ 35 /* Note that the command handle is

not */ 36 /* destroyed in this routine, but in

*/ 37 /* vst_dispatch when final status is

received. */ 38 cmd = VS_Command_Create(); 39 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 40 { 41 /* Send the command to the VolServ software. */

Page 786 of the ADIC 601355 Rev A user manual — Notes
Page 786 · click to enlarge
Page 786

42 /* Note that status is not processed here. */ 43 /* Instead, it is processed in the */ 44 /* vst_dispatch routine. Also, note that */ 45 /* default values such as timeout,*/ 46 /* value retry limit and priority are set as */ 47 /* default parameters. */ 48 rc = VSCMD_MediaQuery(cmd, 49 VSID_QRY_OPTION, queryopt, 50 VSID_MEDIA_ID_LIST, count, medialist, 51 VSID_ENDFIELD); 52 } 53 return ( rc ); 54 }

VolServ can generate intermediate status in response to a Media Query request.

VSCMD_MediaQuery does not trigger any MediaClass callbacks from VolServ.

The VSID_MEDIA_ID_LIST parameter requires that two arguments be passed instead of one.

When information is requested for more than one media, the grouped information is returned in one or more intermediate status messages.

A Media Query can query any media in the VolServ system. Media specified in a single Media Query request are not required to be located in the same archive.

Page 787 of the ADIC 601355 Rev A user manual — Tip
Page 787 · click to enlarge
Page 787

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status for Media Query requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Media Query commands are set with VSCMD_MediaQuery_SetDefaults . If command-specific defaults are set for the Media Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Media Query command, the parameter identifier and the value to be used for the parameter can be submitted for the specific command itself.

The following fields can be retrieved from the Status handle after a successful Media Query request:

Page 788 of the ADIC 601355 Rev A user manual — Note
Page 788 · click to enlarge
Page 788
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VISD_ERROR_CODE_TABLE ,
  • VSID_MEDIA_HANDLE ,
  • VSID_MEDIA_HANDLE_ENTRY ,
  • VSID_MEDIA_HANDLE_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

  • vsapi(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Media_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_MediaQuery_SetDefaults(l)

See Also

Page 789 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 789 · click to enlarge
Page 789

VSCMD_ MediaQuery_ SetDefaults

VSCMD_MediaQuery_SetDefaults sets the command-level default parameters for the Media Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_MediaQuery_SetDefaults ( "…", VSID_ENDFIELD )

Arguments • "…" = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Media Query commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Media Query commands.

VSID_MEDIA_ID_LIST (int) Number of media identified in the list.

(char **) List of media identifier to query.

Parameters · Parameter Type Description

Page 790 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 790 · click to enlarge
Page 790

VSID_PRIORITY (VST_PRIORITY) The execution priority for Media Query commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for each medium specified in a list of one or more media or whether information is being requested for all media. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Media Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

Parameter Type Description

Page 791 of the ADIC 601355 Rev A user manual — Return Values
Page 791 · click to enlarge
Page 791

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Media Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Media Query commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MediaQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_mediaquery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_MediaQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 *

Parameter Type Description · Example 1 /****************************************

Page 792 of the ADIC 601355 Rev A user manual — Return Values
Page 792 · click to enlarge
Page 792

12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_mediaquery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_mediaquery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Media Query default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_MediaQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc );

Page 793 of the ADIC 601355 Rev A user manual — Note
Page 793 · click to enlarge
Page 793

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_MediaQuery(l)

40 }

Page 794 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 794 · click to enlarge
Page 794

VSCMD_ MediaTypeQuery

VSCMD_MediaTypeQuery is issued to request execution of the VolServ Media Type Query request.

The Media Type Query request is used to obtain information about media types defined in the VolServ system.

Upon receipt of a Media Type Query request, VolServ obtains the requested information about the specified media type and returns this information to the client.

Synopsis VST_BOOLEAN VSCMD_MediaTypeQuery (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on this request.

Parameters · Parameter Type Description

Page 795 of the ADIC 601355 Rev A user manual — VSID_QUERY_OPTION (VST_QUERY_OPTION)
Page 795 · click to enlarge
Page 795

VSID_MEDIA_TYPE_LIST (int) If VSE_QUERY_OPTION_NONE was specified for VSID_QUERY_OPTION, indicates the number of media types specified in the Media Type list. The maximum number of media types that can be specified is 32.

(char **) If VSE_QUERY_OPTION_NONE was specified for VSID_QUERY_OPTION, specifies the names of the media types for which information is being requested. Valid Media Type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for each media type specified in a list of one or more media types or whether information is being requested for all media types. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 796 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 796 · click to enlarge
Page 796

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MediaTypeQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

Parameter Type Description

Page 797 of the ADIC 601355 Rev A user manual — Return Values
Page 797 · click to enlarge
Page 797

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
Page 798 of the ADIC 601355 Rev A user manual — Example
Page 798 · click to enlarge
Page 798
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_mediatypequery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_MediaTypeQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_mediatypequery_execute(void) 14 #else 15 VST_BOOLEAN

vst_mediatypequery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_BOOLEAN done = VSE_FALSE; 20 VST_QUERY_OPTION queryopt; 21 int /count = 0; 22 char * temp_media_type; 23 char * mediatypelist[VST_MAX_ITEMS]; 24 VST_COMMAND_HANDLE cmd; 25 26 /* get parameters from user */

Example 1 /****************************************

Page 799 of the ADIC 601355 Rev A user manual — Example
Page 799 · click to enlarge
Page 799

27 printf(“*** Media Type Query

parameters ***\n” ); 28 printf(“0) Query by media type list,

1. Query all ==> “ ); 29 queryopt = atoi(gets(input)); 30 31 if (queryopt == 0) 32 { 33 count = vst_getmediatypelist(mediatypelis t, VST_MAX_ITEMS); 34 } 35 36 /* create the command handle */ 37 /* Note that the command handle is

not */ 38 /* destroyed in this routine, but in

*/ 39 /* vst_dispatch when final status is

received. */ 40 cmd = VS_Command_Create(); 41 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 42 { 43 /* Send the command to the VolServ software. */ 44 /* Note that status is not processed here. */ 45 /* Instead, it is processed in the */ 46 /* vst_dispatch routine. Also, note that */ 47 /* default values such as timeout,*/ 48 /* value retry limit and priority are set as */ 49 /* default parameters. */ 50 if (queryopt == 0) 51 { 52 /* query a list of media types */ 53 rc = VSCMD_MediaTypeQuery(cmd,

Page 800 of the ADIC 601355 Rev A user manual — Notes
Page 800 · click to enlarge
Page 800

54 VSID_QRY_OPTION, queryopt, 55 VSID_MEDIA_TYPE_LIST, count, mediatypelist, 56 VSID_ENDFIELD); 57 } 58 else 59 { 60 /* query all media types */ 61 rc = VSCMD_MediaTypeQuery(cmd, 62 VSID_QRY_OPTION, queryopt, 63 VSID_ENDFIELD); 64 } 65 } 66 else 67 { 68 rc = VSE_FALSE; 69 } 70 return ( rc ); 71 }

VolServ can generate intermediate status in response to a Media Type Query request.

Media Type Query status are cumulative. Each status is added to the previous status; therefore, after the final status, the status handle contains all desired information.

VSCMD_MediaTypeQuery does not trigger any MediaClass callbacks from VolServ.

The VSID_MEDIA_TYPE_LIST parameter requires that two arguments be passed instead of one.

Page 801 of the ADIC 601355 Rev A user manual — Tip
Page 801 · click to enlarge
Page 801

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status for Media Type Query requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Media Type Query commands are set with VSCMD_MediaQuery_SetDefaults . If command-specific defaults are set for the Media Type Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Media Type Query command, the parameter identifier and the value to be used for the parameter can be submitted for the specific command itself.

The following fields can be retrieved from the status handle after a successful Media Type Query request:

Page 802 of the ADIC 601355 Rev A user manual — Note
Page 802 · click to enlarge
Page 802
  • VSID_ERROR_CODE,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_MEDIATYPE_HANDLE ,
  • VSID_MEDIATYPE_HANDLE_ENTRY ,
  • VSID_MEDIATYPE_HANDLE_TABLE ,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

  • See Also
  • vsapi(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Media_GetFields(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_MediaTypeQuery_SetDefaults(l)
Page 803 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_MediaTypeQuery_SetDefaults ( “…”, VSID_ENDFIELD )
Page 803 · click to enlarge
Page 803

VSCMD_ MediaTypeQuery_ SetDefaults

VSCMD_MediaTypeQuery_SetDefaults is issued to set the command-level default parameters for Media Type Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_MediaTypeQuery_SetDefaults ( “…”, VSID_ENDFIELD )

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 804 of the ADIC 601355 Rev A user manual — VSID_QUERY_OPTION (VST_QUERY_OPTION)
Page 804 · click to enlarge
Page 804

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Media Type Query commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Media Type Query commands.

VSID_MEDIA_TYPE_LIST (int) If VSE_QUERY_OPTION_NONE was specified for VSID_QUERY_OPTION, indicates the number of media types specified in the list of media types.

(char **) If VSE_QUERY_OPTION_NONE was specified for VSID_QUERY_OPTION, specifies the names of the media types for which information is being requested. Valid Media Type Query names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_PRIORITY (VST_PRIORITY) The execution priority for Media Type Query commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicate whether information is being requested for each media type specified in a list of one or more media types or whether information is being requested for all media types. Valid VSID_QUERY_OPTION values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 805 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 805 · click to enlarge
Page 805

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Media Type Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Media Type Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Media Type Query commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MediaTypeQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .

Parameter Type Description

Page 806 of the ADIC 601355 Rev A user manual — Example
Page 806 · click to enlarge
Page 806
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_mediatypequery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_MediaTypeQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_mediatypequery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_mediatypequery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

Example 1 /**************************************** · enterprise_id;

Page 807 of the ADIC 601355 Rev A user manual — Note
Page 807 · click to enlarge
Page 807

26 27 /* get parameters from user */ 28 printf(“*** Modify Pool default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_MediaTypeQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
Page 808 of the ADIC 601355 Rev A user manual — Notes
Page 808 · click to enlarge
Page 808
  • VSCMD_MediaTypeQuery(l)
Page 809 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 809 · click to enlarge
Page 809

VSCMD_ ModifyMedia

A client uses Modify Media requests to create or modify the attribute values of an existing medium.

Synopsis VST_BOOLEAN VSCMD_ModifyMedia ( “…”, VSID_ENDFIELD )

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_BATCH_NAME (VST_BATCH_NAME) The batch name of the medium. A valid batch name may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on all requests.

VSID_FIELD_LIST (int) Number of field identifiers in the list.

Parameters · Parameter Type Description

Page 810 of the ADIC 601355 Rev A user manual — VSID_MODMEDIA_OPTION (VST_MODMEDIA_OPTION)
Page 810 · click to enlarge
Page 810

(VST_COUNT *) Pointer to an array of field identifiers to associate with the user statistics.

VSID_MANUFACTURER (VST_MANUFACTURER_NAME)

The manufacturer to be assigned to imported medium. Valid manufacturer names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_ID (VST_MEDIA_ID) Media identifier of the medium to update.

VSID_MEDIA_STAT_VALUE_LIST (int) Number of user statistics in the list.

(char **) An array of user statistics to associate with the medium.

VSID_MEDIA_STAT_OPTION_LIST (int) Number of media statistic options in the list.

(VST_MEDIA_STAT_OPTION *) An array of media statistic options to place on the list of user statistics. Valid VSID_MEDIA_STAT_OPTION_LIST values are enumerated in the vs_types.h file.

VSID_MODMEDIA_OPTION (VST_MODMEDIA_OPTION)

The option for the medium's user statistics. Valid VSID_MODMEDIA_OPTION values are enumerated in the vs_types.h file.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 811 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 811 · click to enlarge
Page 811

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status).Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VS_MediaType_SetFields returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed.

Parameter Type Description

Page 812 of the ADIC 601355 Rev A user manual — Return Values
Page 812 · click to enlarge
Page 812

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 813 of the ADIC 601355 Rev A user manual — Example
Page 813 · click to enlarge
Page 813

********* 2 * 3 * FUNCTION: vst_modifymedia_execute 4 * 5 * PURPOSE: 6 * This function actually tests the VSCMD_ModifyMedia 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modifymedia_execute(void) 15 #else 16 VST_BOOLEAN

vst_modifymedia_execute() 17 #endif 18 { 19 int i; 20 int num; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_COMMAND_HANDLE cmdh; 23 VST_MEDIA_ID mediaid; 24 VST_BATCH_NAME batch; 25 VST_MANUFACTURER_NAME

manufacturer; 26 VST_MODMEDIA_OPTION modopt; 27 VST_COUNT

field[VSD_MAX_MEDIA_STATS]; 28 VST_MEDIA_STAT_OPTION

* value[VSD_MAX_MEDIA_STATS]; 30 char

Example 1 /**************************************** · option[VSD_MAX_MEDIA_STATS]; 29 char · valuearray[VSD_MAX_MEDIA_STATS][V SD_MEDIA_STAT_VALUE_LEN];

Page 814 of the ADIC 601355 Rev A user manual — Example
Page 814 · click to enlarge
Page 814

31 32 /* get parameters from user */ 33 printf(“*** Modify Media Parameters

***\n”); 34 printf ( “Enter the media id to

modify ==> “ ); 35 gets(mediaid); 36 printf ( “Enter the batch name

(return for none) ==> “ ); 37 gets(batch); 38 printf ( “Enter the manufacturer name

==> “ ); 39 gets(manufacturer); 40 printf ( “Enter the modify media

option (1-Delete/2-Update/3-Replace)==> “ ); 41 modopt = (VST_MODMEDIA_OPTION)

atoi(gets(input)); 42 printf ( “Enter the number of user

statistics ==> “ ); 43 num = atoi(gets(input)); 44 45 /* loop through the number of user

statistics */ 46 for ( i = 0 ; i < num && i

VSD_MAX_MEDIA_STATS ; i++ ) 47 { 48 printf ( “Enter field index[%d] ==> “, i ); 49 field[i] = (VST_COUNT) atoi(gets(input)); 50 printf ( “Enter user statistic[%d] ==> “, i ); 51 gets(valuearray[i]); 52 value[i] = valuearray[i]; 53 printf ( “Enter user stat option[%d] (1-delete/2-update) ==>“, i ); 54 option[i] = (VST_MEDIA_STAT_OPTION) atoi(gets(input));

Page 815 of the ADIC 601355 Rev A user manual — Example
Page 815 · click to enlarge
Page 815

55 } 56 57 /* Create the command (assume that

the api is */ 58 /* initialized). Note that status is

processed */ 59 /* in the vst_dispatch routine. */ 60 /* Also, the command handle created

here is */ 61 /* destroyed in the dispatch routine.

*/ 62 cmdh = VS_Command_Create(); 63 if (cmdh != (VST_COMMAND_HANDLE)

NULL) 64 { 65 /* execute the modify media command

*/ 66 /* common parameters such as

priority, timeout */ 67 /* value, etc, have been set through

the */ 68 /* VS_Global_SetFields or */ 69 /* VSCMD_ModifyMedia_SetDefaults. */ 70 rc = VSCMD_ModifyMedia ( cmdh, 71 VSID_MEDIA_ID, mediaid, 72 VSID_BATCH_NAME, batch, 73 VSID_MANUFACTURER, manufacturer, 74 VSID_MODMEDIA_OPTION, modopt, 75 VSID_FIELD_LIST, num, field, 76 VSID_MEDIA_STAT_VALUE_LIST, num, value, 77 VSID_MEDIA_STAT_OPTION_LIST, num,option, 78 VSID_ENDFIELD ); 79 } 80 81 return ( rc );

Page 816 of the ADIC 601355 Rev A user manual — Notes
Page 816 · click to enlarge
Page 816

VolServ does not generate intermediate status in response to a Modify Media request.

VSCMD_ModifyMedia does not trigger any MediaClass callbacks from VolServ.

The VSID_FIELD_LIST, VSID_MEDIA_STAT_OPTION_LIST, and VSID_MEDIA_STAT_VALUE_LIST parameters require that two arguments be passed instead of one.

Number of items in the field, media stat, and media stat option lists must be equal.

If the VSID_MODMEDIA_OPTION is set to VSE_MODMEDIA_OPTION_REPLACE, the current medium statistics are deleted, and the statistics given in the VSID_MEDIA_STAT_VALUE_LIST are added for the medium.

If the VSID_MODMEDIA_OPTION is set to VSE_MODMEDIA_OPTION_DELETE, the field, stat option, and stat value lists are ignored, and all current medium statistics are deleted.

A medium may have as many field values as desired. However, only up to 16 can be updated at one time through the Modify Media command.

All medium statistics are kept in character format. If numeric values are to be kept, they should be left-filled with zeros for proper comparisons.

82 }

Page 817 of the ADIC 601355 Rev A user manual — Tip
Page 817 · click to enlarge
Page 817

When a medium is exported, its statistics are deleted after the medium is ejected from the system.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status for Modify Media requests submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Modify Media commands are set with VSCMD_ModifyMedia_SetDefaults . If command-specific defaults are set for the Modify Media commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Media command, the parameter identifier and the value to be used for the parameter can be submitted for the specific command itself.

Page 818 of the ADIC 601355 Rev A user manual — Note
Page 818 · click to enlarge
Page 818

The following fields can be retrieved from the status handle after a successful Modify Media request:

  • VSID_ERROR_CODE,
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_CODE_TABLE,
  • VSID_FIELD,
  • VSID_FIELD_ENTRY,
  • VSID_FIELD_TABLE,
  • VSID_MEDIA_ID,
  • VSID_MEDIA_ID_ENTRY,
  • VSID_MEDIA_ID_TABLE,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • VS_Global_SetFields(l),

  • VSCMD_ModifyMedia_SetDefaults(l)
Page 819 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ModifyMedia_SetDefaults ( “…”, VSID_ENDFIELD )
Page 819 · click to enlarge
Page 819

VSCMD_ ModifyMedia_ SetDefaults

VSCMD_ModifyMedia_SetDefaults sets command-level default parameters for all VSCMD_ModifyMedia commands.

These defaults override those set in VS_Global_SetFields. Also, the values set here can be overridden by passing parameters to VSCMD_ModifyMedia.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Synopsis VST_BOOLEAN VSCMD_ModifyMedia_SetDefaults ( “…”, VSID_ENDFIELD )

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.
Page 820 of the ADIC 601355 Rev A user manual — VSID_MODMEDIA_OPTION (VST_MODMEDIA_OPTION)
Page 820 · click to enlarge
Page 820

VSID_BATCH_NAME (VST_BATCH_NAME) The batch name of the medium. A valid batch name may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for Modify Media commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for Modify Media commands.

VSID_FIELD_LIST (int) Number of field identifiers in the list.

(VST_COUNT *) Pointer to an array of field identifiers to associate with the user statistics.

VSID_MANUFACTURER (VST_MANUFACTURER_NAME)

The manufacturer to be assigned to imported medium. Valid manufacturer names may contain up to 32 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MEDIA_ID (VST_MEDIA_ID) Media identifier of the medium to modify.

VSID_MEDIA_STAT_OPTION_LIST (int) Number of items in the list.

(VST_MEDIA_STAT_OPTION *) An array of media statistic options to place on the list of user statistics.

VSID_MEDIA_STAT_VALUE_LIST (int) Number of user statistics in the list.

(char **) An array of user statistics to associate with the medium.

VSID_MODMEDIA_OPTION (VST_MODMEDIA_OPTION)

The option for the medium's user statistics. Valid VSID_MODMEDIA_OPTION values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 821 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG(VST_STATUS_ WAIT_FLAG)
Page 821 · click to enlarge
Page 821

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Modify Media commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Modify Media commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG(VST_STATUS_ WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for a command. Valid options are VSE_TRUE (API waits for final status) and VSE_FALSE (API does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Modify Media commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Modify Media commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 822 of the ADIC 601355 Rev A user manual — Return Values
Page 822 · click to enlarge
Page 822

Return Values VSCMD_ModifyMedia returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_modifymedia_execute 4 * 5 * PURPOSE: 6 * This function actually tests the VSCMD_ModifyMedia 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modifymedia_execute(void) 15 #else 16 VST_BOOLEAN

vst_modifymedia_execute() 17 #endif 18 { 19 int i; 20 int num;

Example 1 /****************************************

Page 823 of the ADIC 601355 Rev A user manual — Return Values
Page 823 · click to enlarge
Page 823

21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_COMMAND_HANDLE cmdh; 23 VST_MEDIA_ID mediaid; 24 VST_BATCH_NAME batch; 25 VST_MANUFACTURER_NAME

manufacturer; 26 VST_MODMEDIA_OPTION modopt; 27 VST_COUNT

[VSD_MEDIA_STAT_VALUE_LEN]; 31 32 /* get parameters from user */ 33 printf(“*** Modify Media Parameters

***\n”); 34 printf ( “Enter the media id to

modify ==> “ ); 35 gets(mediaid); 36 printf ( “Enter the batch name

(return for none) ==> “ ); 37 gets(batch); 38 printf ( “Enter the manufacturer name

==> “ ); 39 gets(manufacturer); 40 printf ( “Enter the modify media

option (1-Delete/2-Update/3-Replace)==> “ ); 41 modopt = (VST_MODMEDIA_OPTION)

atoi(gets(input)); 42 printf ( “Enter the number of user

statistics ==> “ ); 43 num = atoi(gets(input)); 44

Show 4 more labels / short text on this page
field[VSD_MAX_MEDIA_STATS]; 28 VST_MEDIA_STAT_OPTION · option[VSD_MAX_MEDIA_STATS]; 29 char · value[VSD_MAX_MEDIA_STATS]; 30 char · valuearray[VSD_MAX_MEDIA_STATS]
Page 824 of the ADIC 601355 Rev A user manual — Return Values
Page 824 · click to enlarge
Page 824

45 /* loop through the number of user

statistics */ 46 for ( i = 0 ; i < num && i

VSD_MAX_MEDIA_STATS ; i++ ) 47 { 48 printf ( “Enter field index[%d] ==> “, i ); 49 field[i] = (VST_COUNT) atoi(gets(input)); 50 printf ( “Enter user statistic[%d] ==> “, i ); 51 gets(valuearray[i]); 52 value[i] = valuearray[i]; 53 printf ( “Enter user stat option[%d] (1-delete/2-update) ==>“, i ); 54 option[i] = (VST_MEDIA_STAT_OPTION) atoi(gets(input)); 55 } 56 57 /* Create the command (assume that

the api is */ 58 /* initialized). Note that status is

processed */ 59 /* in the vst_dispatch routine. */ 60 /* Also, the command handle created

here is */ 61 /* destroyed in the dispatch routine.

*/ 62 cmdh = VS_Command_Create(); 63 if (cmdh != (VST_COMMAND_HANDLE)

NULL) 64 { 65 /* execute the modify media command

*/ 66 /* common parameters such as

priority, timeout */ 67 /* value, etc, have been set through

the */ 68 /* VS_Global_SetFields or */ 69 /* VSCMD_ModifyMedia_SetDefaults. */

Page 825 of the ADIC 601355 Rev A user manual — Note
Page 825 · click to enlarge
Page 825

70 rc = VSCMD_ModifyMedia ( cmdh, 71 VSID_MEDIA_ID, mediaid, 72 VSID_BATCH_NAME, batch, 73 VSID_MANUFACTURER, manufacturer, 74 VSID_MODMEDIA_OPTION, modopt, 75 VSID_FIELD_LIST, num, field, 76 VSID_MEDIA_STAT_VALUE_LIST, num, value, 77 VSID_MEDIA_STAT_OPTION_LIST, num, option, 78 VSID_ENDFIELD ); 79 } 80 81 return ( rc ); 82 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • VS_Global_SetFields(l),

  • VSCMD_ModifyMedia(l)
Page 826 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_CreatePool (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 826 · click to enlarge
Page 826

VSCMD_ CreatePool

VSCMD_CreatePool creates a new VolServ drive pool. The drive members of the drive pools are specified in the command. Drive pools are non-exclusive; drives may exist in more than one pool. Drive pools allow logical groupings of system drives for simplified reference when a specific drive does not need to be specified in a command, such as the Mount command.

After receiving a VSCMD_CreatePool request, VolServ creates a new drive pool and returns status to the client which indicates the success or failure of the request.

Synopsis VST_BOOLEAN VSCMD_CreatePool (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Create Pool request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 827 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 827 · click to enlarge
Page 827

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Name of the drive pool to be created. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_DRIVE_ID_LIST (int) Number of drives to include in the new drive pool.

(VST_DRIVE_ID *) Pointer to the list of drives to be included in the new drive pool.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 828 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 828 · click to enlarge
Page 828

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_CreatePool returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

Parameter Type Description

Page 829 of the ADIC 601355 Rev A user manual — Return Values
Page 829 · click to enlarge
Page 829

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API software and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 830 of the ADIC 601355 Rev A user manual — Example
Page 830 · click to enlarge
Page 830

********* 2 * 3 * FUNCTION: vst_createpool_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_CreatePool API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_createpool_execute(void) 14 #else 15 VST_BOOLEAN vst_createpool_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVE_POOL_NAME dp; 20 int count; 21 VST_DRIVE_ID

drivelist[VST_MAX_ITEMS]; 22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** Create Pool Parameters

***\n” ); 26 printf(“\nEnter Drive Pool Name

==>”); 27 gets( dp ); 28 count = vst_getdrivelist(drivelist,

VST_MAX_ITEMS); 29 30 /* create the command handle */ 31 /* Note that the command handle is

not */ 32 /* destroyed in this routine, but in

Example 1 /**************************************** · */

Page 831 of the ADIC 601355 Rev A user manual — Notes
Page 831 · click to enlarge
Page 831

33 /* vst_dispatch when final status is

received. */ 34 cmd = VS_Command_Create(); 35 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 36 { 37 /* Send the command to the VolServ software. */ 38 /* Note that status is not processed here. */ 39 /* Instead, it is processed in the */ 40 /* vst_dispatch routine. Also retry limit */ 41 /* and priority are set as */ 42 /* default parameters. */ 43 rc = VSCMD_CreatePool(cmd, 44 VSID_DRIVEPOOL_NAME, dp, 45 VSID_DRIVE_ID_LIST, count, drivelist, 46 VSID_ENDFIELD); 47 } 48 return ( rc ); 49 }

VolServ generates no intermediate status in response to a Create Pool request.

VSCMD_CreatePool does not trigger any MediaClass callbacks from VolServ.

The name specified for a new drive pool must be unique. A request to create a drive pool with a non-unique name will fail.

Drive pools can contain zero or more drives.

Page 832 of the ADIC 601355 Rev A user manual — Notes
Page 832 · click to enlarge
Page 832

Drives belonging to a single drive pool can be associated with different archives. Drives are not required to be associated with an archive to belong to a drive pool.

Drive pools can contain drives that support incompatible media types.

If a drive pool is specified on a Mount request and the specified drive pool spans archives, VolServ may select a drive to honor the Mount request that is in a different archive than the medium that is selected to honor the request. If this occurs, a Move-Mount action is required. If permitted, the medium is scheduled for ejection from its parent archive and eventually entered into the archive associated with the assigned drive.

Whether or not Move-Mount action processing is permitted is specified at the archive level. The ACTION_MODE and MOVEWAIT_OPTION attributes control whether or not Move-Mount processing is allowed for a specific archive. These attributes are discussed under the VS_Archive_SetFields and VS_Archive_GetFields functions.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Create Pool request submitted through the API interface to the VolServ system.

Page 833 of the ADIC 601355 Rev A user manual — Tip
Page 833 · click to enlarge
Page 833

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

The VSID_DRIVE_ID_LIST and VSID_COMP_STATE_LIST parameters require that two arguments be passed instead of one.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Pool commands are set with VSCMD_CreatePool_SetDefaults . If command-specific defaults are set for Create Pool commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Pool command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Create Pool request:

  • VSID_DRIVE_ID,
  • VSID_DRIVE_ID_ENTRY,
  • VSID_DRIVE_ID_TABLE,
  • VSID_DRIVEPOOL_NAME,
  • VSID_ERROR_CODE,
Page 834 of the ADIC 601355 Rev A user manual — Note
Page 834 · click to enlarge
Page 834
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_CODE_TABLE,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_DeletePool(l),
  • VSCMD_ModifyPool(l)
Page 835 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_CreatePool_SetDefaults ( “…”, VSID_ENDFIELD)
Page 835 · click to enlarge
Page 835

VSCMD_ CreatePool_ SetDefaults

VSCMD_CreatePool_SetDefaults sets the command-level default parameters for Create Pool commands.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Create Pool commands are set with VSCMD_CreatePool_SetDefaults . If command-specific defaults are set for Create Pool commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Create Pool command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_CreatePool_SetDefaults ( “…”, VSID_ENDFIELD)

Page 836 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 836 · click to enlarge
Page 836

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Create Pool commands.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Name of the drive pool to be created. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_DRIVE_ID_LIST (int) Number of drives to include in the new drive pool.

(VST_DRIVE_ID *) Pointer to the list of drives to be included in the new drive pool.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Create Pool commands.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Create Pool commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 837 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 837 · click to enlarge
Page 837

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Create Pool commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Create Pool commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Create Pool commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Create Pool commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 838 of the ADIC 601355 Rev A user manual — Return Values
Page 838 · click to enlarge
Page 838

Return Values VSCMD_CreatePool_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_createpool_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_CreatePool API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_createpool_defaults(void) 15 #else 16 VST_BOOLEAN

vst_createpool_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE;

Example 1 /****************************************

Page 839 of the ADIC 601355 Rev A user manual — Notes
Page 839 · click to enlarge
Page 839

20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Create Drive Pool default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_CreatePool_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

Page 840 of the ADIC 601355 Rev A user manual — Note
Page 840 · click to enlarge
Page 840

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_CreatePool(l)
Page 841 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DeleteArchiveMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 841 · click to enlarge
Page 841

VSCMD_ DeleteArchive MediaClass

VSCMD_DeleteArchiveMediaClass deletes an existing archive media class relationship.

Upon receipt of a VSCMD_DeleteArchiveMediaClass request, VolServ disassociates the archive media class relationship and returns status to the client indicating the success or failure of the request.

Synopsis VST_BOOLEAN VSCMD_DeleteArchiveMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Delete Archive Media Class request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 842 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 842 · click to enlarge
Page 842

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive associated with the archive media class relationship to be deleted. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Name of the MediaClass group associated with the archive media class relationship to be deleted. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 843 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 843 · click to enlarge
Page 843

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DeleteArchiveMediaClass returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

Parameter Type Description

Page 844 of the ADIC 601355 Rev A user manual — Return Values
Page 844 · click to enlarge
Page 844

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 845 of the ADIC 601355 Rev A user manual — Example
Page 845 · click to enlarge
Page 845

********* 2 * 3 * FUNCTION: vst_deletearchivemediaclass_execu te 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DeleteArchiveMediaClass 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_deletearchivemediaclass_execu te(void) 15 #else 16 VST_BOOLEAN

vst_deletearchivemediaclass_execu te() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_ARCHIVE_NAME archive; 21 VST_MEDIA_CLASS_NAME mediaclass; 22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** Delete Archive Media

Class parameters ***\n” ); 26 printf(“Enter Archive Name ==> “ ); 27 gets( archive ); 28 printf(“Enter Media Class Name ==> “

); 29 gets( mediaclass ); 30 /* create the command handle */

Example 1 /****************************************

Page 846 of the ADIC 601355 Rev A user manual — Example
Page 846 · click to enlarge
Page 846

31 /* Note that the command handle is

not */ 32 /* destoyed in this routine, but in

*/ 33 /* vs_dispatch when final status is

received. */ 34 cmd = VS_Command_Create(); 35 if (cmd != (VST_COMMAND_HANDLE )NULL) 36 { 37 /* Send the command to the VolServ software. */ 38 /* Note that status is not processed here. */ 39 /* Instead, it is processed in the */ 40 /* vst_dispatch routine. Also, note that */ 41 /* default values such as timeout, value */ 42 /* limit and priority are setarchive */ 43 /* retry mediaclassas default parameters. */ 44 rc = VSCMD_DeleteArchiveMediaClass(cmd , 45 VSID_ARCHIVE_NAME, archive, 46 VSID_MEDIA_CLASS_NAME, mediaclass, 47 VSID_ENDFIELD); 48 } 49 return ( rc ); 50 }

Page 847 of the ADIC 601355 Rev A user manual — Notes
Page 847 · click to enlarge
Page 847

VolServ generates no intermediate status in response to a Delete Archive Media Class request.

VSCMD_DeleteArchiveMediaClass does not trigger any MediaClass callbacks from VolServ.

If the archive media class contains any media, the VSCMD_DeleteArchiveMediaClass request fails. This includes media that are currently marked for checkout or export and have not yet been ejected.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Delete Archive Media Class request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Delete Archive Media Class commands are set with VSCMD_DeleteArchiveMediaClass_SetDefaults . If
Page 848 of the ADIC 601355 Rev A user manual — Note
Page 848 · click to enlarge
Page 848

command-specific defaults are set for Delete Archive Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Delete Archive Media Class command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Delete Archive Media Class request:

  • VSID_ARCHIVE_NAME,
  • VSID_MEDIA_CLASS_NAME,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 849 of the ADIC 601355 Rev A user manual — See Also
Page 849 · click to enlarge
Page 849
  • See Also
  • vsapi(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreateArchiveMediaClass(l),
  • VSCMD_ModifyArchiveMediaClass(l)
Page 850 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DeleteArchiveMedia Class_SetDefaults ( “…”, VSID_ENDFIELD)
Page 850 · click to enlarge
Page 850

VSCMD_ DeleteArchive MediaClass_ SetDefaults

VSCMD_DeleteArchiveMediaClass_SetDefaults sets the command-level default parameters for Delete Archive Media Class commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Delete Archive Media Class commands are set with VSCMD_DeleteArchiveMediaClass_SetDefaults . If command-specific defaults are set for Delete Archive Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Delete Archive Media Class command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_DeleteArchiveMedia Class_SetDefaults ( “…”, VSID_ENDFIELD)

Page 851 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 851 · click to enlarge
Page 851

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

Name of the archive associated with the archive media class relationship to be deleted. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Delete Archive Media Class commands.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Name of the MediaClass group associated with the archive media class relationship to be deleted. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Delete Archive Media Class commands.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Delete Archive Media Class commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 852 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 852 · click to enlarge
Page 852

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Delete Archive Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Delete Archive Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Delete Archive Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Delete Archive Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 853 of the ADIC 601355 Rev A user manual — Return Values
Page 853 · click to enlarge
Page 853

Return Values VSCMD_DeleteArchiveMediaClass_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_deletearchivemediaclass_defau lts 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_DeleteArchiveMediaClass API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_deletearchivemediaclass_defau lts(void) 15 #else

Example 1 /****************************************

Page 854 of the ADIC 601355 Rev A user manual — 16 VST_BOOLEAN
Page 854 · click to enlarge
Page 854

16 VST_BOOLEAN

vst_deleteaarchivemediaclass_defa ults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Delete Archive Media

Class default parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_DeleteArchiveMediaClass_Set Defaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Page 855 of the ADIC 601355 Rev A user manual — Note
Page 855 · click to enlarge
Page 855

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_DeleteArchiveMediaClass(l)
Page 856 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DeleteMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 856 · click to enlarge
Page 856

VSCMD_ DeleteMedia Class

VSCMD_DeleteMediaClass deletes an existing MediaClass group from the VolServ system.

Upon receipt of a VSCMD_DeleteMediaClass command, VolServ removes the MediaClass group and returns status to the client indicating the success or failure of the request.

Synopsis VST_BOOLEAN VSCMD_DeleteMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Delete Media Class request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 857 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 857 · click to enlarge
Page 857

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Name of the MediaClass group to be deleted. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameters · Parameter Type Description

Page 858 of the ADIC 601355 Rev A user manual — Return Values
Page 858 · click to enlarge
Page 858

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DeleteMediaClass returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 859 of the ADIC 601355 Rev A user manual — Return Values
Page 859 · click to enlarge
Page 859
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 860 of the ADIC 601355 Rev A user manual — Example
Page 860 · click to enlarge
Page 860

********* 2 * 3 * FUNCTION: vst_deletemediaclass_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DeleteMediaClass API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_deletemediaclass_execute(void ) 14 #else 15 VST_BOOLEAN

vst_deletemediaclass_execute() 16 #endif 17 { 18 VST_MEDIA_CLASS_NAME mediaclass; 19 VST_COMMAND_HANDLE cmd; 20 VST_BOOLEAN rc = VSE_FALSE; 21 22 /* get parameters from user */ 23 printf(“*** Delete Media Class

parameters ***\n” ); 24 printf(“\nEnter Media Class name to

delete ==>”); 25 gets( mediaclass); 26 27 /* create the command handle */ 28 /* Note that the command handle is

not */ 29 /* destroyed in this routine, but in

Example 1 /**************************************** · */

Page 861 of the ADIC 601355 Rev A user manual — Notes
Page 861 · click to enlarge
Page 861

30 /* vst_dispatch when final status is

received. */ 31 cmd = VS_Command_Create(); 32 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 33 { 34 /* Send the command to the VolServ software. */ 35 /* Note that status is not processed here. */ 36 /* Instead, it is processed in the */ 37 /* vst_dispatch routine. Also, note that */ 38 /* default values such as timeout,*/ 39 /* value retry limit and priority are set as */ 40 /* default parameters. */ 41 rc = VSCMD_DeleteMediaClass(cmd, 42 VSID_MEDIA_CLASS_NAME, mediaclass, 43 VSID_ENDFIELD); 44 } 45 return ( rc ); 46 }

VolServ generates no intermediate status in response to a Delete Media Class request.

VSCMD_DeleteMediaClass does not trigger any MediaClass callbacks from VolServ.

If the specified MediaClass group is associated with any archive media class relationship, the VSCMD_DeleteMediaClass request fails.

Page 862 of the ADIC 601355 Rev A user manual — Tip
Page 862 · click to enlarge
Page 862

If the specified MediaClass group contains any media, the VSCMD_DeleteMediaClass request fails.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Delete Media Class request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Delete Media Class commands are set with VSCMD_DeleteMediaClass_SetDefaults . If command-specific defaults are set for Delete Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Delete Media Class command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Page 863 of the ADIC 601355 Rev A user manual — Note
Page 863 · click to enlarge
Page 863

The following fields can be retrieved from the status handle after a successful Delete Media Class request:

  • VSID_MEDIA_CLASS_NAME,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreateMediaClass(l),
  • VSCMD_ModifyMediaClass(l)
Page 864 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DeleteMediaClass_ SetDefaults ( “…”, VSID_ENDFIELD)
Page 864 · click to enlarge
Page 864

VSCMD_ DeleteMedia Class_Set Defaults

VSCMD_DeleteMediaClass_SetDefaults sets the command-level default parameters for Delete Archive Media Class commands.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Delete Archive Media Class commands are set with VSCMD_DeleteMediaClass_SetDefaults. If command-specific defaults are set for Delete Archive Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Delete Media Class command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_DeleteMediaClass_ SetDefaults ( “…”, VSID_ENDFIELD)

Page 865 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 865 · click to enlarge
Page 865

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Rquired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Delete Archive Media Class commands.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

Name of the MediaClass group to delete. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Delete Archive Media Class commands.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Delete Archive Media Class commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Delete Archive Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameters · Parameter Type Description

Page 866 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 866 · click to enlarge
Page 866

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Delete Archive Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Delete Archive Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Delete Archive Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DeleteMediaClass_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 867 of the ADIC 601355 Rev A user manual — Example
Page 867 · click to enlarge
Page 867
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_deletemediaclass_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_DeleteMediaClass API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_deletemediaclass_defaults(voi d) 15 #else 16 VST_BOOLEAN

vst_deletemediaclass_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Create Archive Media

Class default parameters ***\n” );

Example 1 /****************************************

Page 868 of the ADIC 601355 Rev A user manual — Note
Page 868 · click to enlarge
Page 868

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_DeleteMediaClass_SetDefault s( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_DeleteMediaClass(l)

29 vst_promptforglobals(&priority,

Page 869 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DeletePool (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 869 · click to enlarge
Page 869

VSCMD_ DeletePool

VSCMD_DeletePool deletes an existing drive pool.

Upon receipt of a VSCMD_DeletePool request, VolServ removes the specified drive pool definition, as well as any drive pool member associations, and returns status to the client indicating the success or failure of the request.

Synopsis VST_BOOLEAN VSCMD_DeletePool (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Delete Pool request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragrap h .
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 870 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 870 · click to enlarge
Page 870

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Name of the drive pool to delete. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameters · Parameter Type Description

Page 871 of the ADIC 601355 Rev A user manual — Return Values
Page 871 · click to enlarge
Page 871

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DeletePool returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 872 of the ADIC 601355 Rev A user manual — Return Values
Page 872 · click to enlarge
Page 872
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 873 of the ADIC 601355 Rev A user manual — Example
Page 873 · click to enlarge
Page 873

********* 2 * 3 * FUNCTION: vst_deletepool_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DeletePool API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_deletepool_execute(void) 14 #else 15 VST_BOOLEAN vst_deletepool_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVE_POOL_NAME dp; 20 VST_COMMAND_HANDLE cmd; 21 22 /* get parameters from user */ 23 printf(“*** Delete Pool Parameters

***\n” ); 24 printf(“\nEnter Drive Pool name to

delete ==>”); 25 gets( dp ); 26 27 /* create the command handle */ 28 /* Note that the command handle is

not */ 29 /* destoyed in this routine, but in

*/ 30 /* vst_dispatch when final status is

received. */ 31 cmd = VS_Command_Create();

Example 1 /****************************************

Page 874 of the ADIC 601355 Rev A user manual — Notes
Page 874 · click to enlarge
Page 874

32 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 33 { 34 /* Send the command to the VolServ software. */ 35 /* Note that status is not processed here. */ 36 /* Instead, it is processed in the */ 37 /* vst_dispatch routine. Also, note that */ 38 /* default values such as timeout,*/ 39 /* value retry limit and priority are set as */ 40 /* default parameters. */ 41 rc = VSCMD_DeletePool(cmd, 42 VSID_DRIVEPOOL_NAME, dp, 43 VSID_ENDFIELD); 44 } 45 return ( rc ); 46 }

VolServ generates no intermediate status in response to a Delete Pool request.

VSCMD_DeletePool does not trigger any MediaClass callbacks from VolServ.

Requests submitted prior to a Delete Pool request are not updated if a drive has already been allocated to the request.

Page 875 of the ADIC 601355 Rev A user manual — Tip
Page 875 · click to enlarge
Page 875

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Delete Pool request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Delete Pool commands are set with VSCMD_DeletePool_SetDefaults . If command-specific defaults are set for Delete Pool commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Delete Pool command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Delete Pool request:

Page 876 of the ADIC 601355 Rev A user manual — Note
Page 876 · click to enlarge
Page 876
  • VSID_DRIVEPOOL_NAME,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreatePool(l),
  • VSCMD_ModifyPool(l)
Page 877 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DeletePool_SetDefaults ( “…”, VSID_ENDFIELD)
Page 877 · click to enlarge
Page 877

VSCMD_ DeletePool_ SetDefaults

VSCMD_DeletePool_SetDefaults sets the command-level default parameters for Delete Pool commands.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Delete Pool commands are set with VSCMD_DeletePool_SetDefaults . If command-specific defaults are set for Delete Pool commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Delete Pool command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_DeletePool_SetDefaults ( “…”, VSID_ENDFIELD)

Page 878 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 878 · click to enlarge
Page 878

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Delete Pool commands.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

Name of the drive pool to delete. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Delete Pool commands.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Delete Pool commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Delete Pool commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameters · Parameter Type Description

Page 879 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 879 · click to enlarge
Page 879

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Delete Pool commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Delete Pool commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Delete Pool commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DeletePool_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

Parameter Type Description

Page 880 of the ADIC 601355 Rev A user manual — Example
Page 880 · click to enlarge
Page 880

********* 2 * 3 * FUNCTION: vst_deletepool_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_DeletePool API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_deletepool_defaults(void) 15 #else 16 VST_BOOLEAN

vst_deletepool_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Delete Pool default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_DeletePool_SetDefaults(

Example 1 /****************************************

Page 881 of the ADIC 601355 Rev A user manual — Note
Page 881 · click to enlarge
Page 881

32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_DeletePool(l)
Page 882 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Disconnect (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 882 · click to enlarge
Page 882

VSCMD_ Disconnect

VSCMD_Disconnect disconnects a specified Internet address from the specified enterprise identifier. This association of Internet address with an enterprise identifier was made via the Connect command.

Even though the specified client Internet address is disassociated from the given enterprise identifier, the address can remain active for a different enterprise.

Upon receipt of a VSCMD_Disconnect request, VolServ verifies that the specified enterprise is associated with the given Internet address. If the association exists, VolServ removes the Internet address from the database and returns final status to inform the client that the request has been completed. If the association does not exist, the command fails, and failure status is returned (if possible) to the client.

Synopsis VST_BOOLEAN VSCMD_Disconnect (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Disconnect request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 883 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 883 · click to enlarge
Page 883

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_CONNECT_HANDLE (VST_CONNECT_HANDLE)

The connect handle that contains the enterprise callback address information of the enterprise whose connection to the VolServ system is broken. VSID_CONNECT_HANDLE is not applicable if VSID_PROCEDURE_NUMBER, VSID_PROGRAM_NUMBER, VSID_PROTOCOL, and VSID_VERSION_NUMBER are specified.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status for this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

The RPC procedure number of the client process to disconnect from VolServ. VSID_PROCEDURE_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

The RPC program number of the client process to disconnect from VolServ. VSID_PROGRAM_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_PROTOCOL (VST_PROTOCOL) The Internet protocol VolServ uses to return status messages and MediaClass callbacks to the client to be disconnected from VolServ. VSID_PROTOCOL is not applicable if VSID_CONNECT_HANDLE is specified.

Parameters · Parameter Type Description

Page 884 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 884 · click to enlarge
Page 884

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_SOCKADDR_IN (VST_SOCKADDR_IN)

The Internet socket address for the client to disconnect from VolServ.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The enterprise identifier of the enterprise to disconnect from VolServ.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) A value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

The RPC version number of the client process to disconnect from VolServ.

Parameter Type Description

Page 885 of the ADIC 601355 Rev A user manual — Return Values
Page 885 · click to enlarge
Page 885

Return Values VSCMD_Disconnect returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed.A return code of VSE_FALSE (which is 0) means the command failed.

- To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 886 of the ADIC 601355 Rev A user manual — Example
Page 886 · click to enlarge
Page 886
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_disconnect_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Disconnect API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_disconnect_execute(void) 14 #else 15 VST_BOOLEAN vst_disconnect_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_ENTERPRISE_ID

Example 1 /**************************************** · TargetEnterpriseID; 20 VST_SOCKADDR_IN · socketaddress;

Page 887 of the ADIC 601355 Rev A user manual — Example
Page 887 · click to enlarge
Page 887

21 VST_PROGRAM_NUMBER prognum; 22 VST_COMMAND_HANDLE cmd; 23 VST_VERSION_NUMBER versnum; 24 VST_PROCEDURE_NUMBER procnum; 25 int temp; 26 27 /* get parameters from user */ 28 printf(“*** Disconnect parameters

***\n” ); 29 printf(“Enter Enterprise ID ==> “ ); 30 TargetEnterpriseID =

atoi(gets(input)); 31 printf(“Enter Program Number ==> “ ); 32 prognum = atoi(gets(input)); 33 printf(“Enter Version Number ==> “ ); 34 versnum = atoi(gets(input)); 35 printf(“Enter Procedure Number ==> “

); 36 procnum = atoi(gets(input)); 37 printf(“Enter Socket sin family ==> “

); 38 temp = atoi(gets(input)); 39 socketaddress.sin_family = (short)

temp; 40 printf(“Enter Socket sin port ==> “

); 41 temp = atoi(gets(input)); 42 socketaddress.sin_port = (u_short)

temp; 43 printf(“Enter Socket sin address ==>

“ ); 44 temp = atoi(gets(input)); 45 socketaddress.sin_addr = (u_long)

temp; 46 47 /* create the command handle */ 48 /* Note that the command handle is

not */ 49 /* destoyed in this routine, but in

*/ 50 /* vst_dispatch when final status is

received. */

Page 888 of the ADIC 601355 Rev A user manual — Notes
Page 888 · click to enlarge
Page 888

51 cmd = VS_Command_Create(); 52 if (cmd != (VST_COMMAND_HANDLE )NULL) 53 { 54 /* Send the command to the VolServ software. */ 55 /* Note that status is not processed here. */ 56 /* Instead, it is processed in the */ 57 /* vst_dispatch routine. Also, note that */ 58 /* default values such as timeout,*/ 59 /* value retry limit and priority are set as */ 60 /* default parameters. */ 61 rc = VSCMD_Disconnect(cmd, 62 VSID_TARGET_ENTERPRISE_ID, TargetEnterpriseID, 63 VSID_PROGRAM_NUMBER, prognum, 64 VSID_VERSION_NUMBER, versnum, 65 VSID_PROCEDURE_NUMBER, procnum, 66 VSID_SOCKADDR_IN, socketaddress, 67 VSID_ENDFIELD); 68 } 69 return ( rc ); 70 }

VolServ generates no intermediate status in response to a Disconnect command.

The Disconnect command cannot trigger MediaClass callbacks from VolServ.

Page 889 of the ADIC 601355 Rev A user manual — Notes
Page 889 · click to enlarge
Page 889

The VSID_CONNECT_HANDLE parameter may be used after a Connect Query command to disconnect an enterprise after the client has gone down.

A VSCMD_Disconnect request can be issued only through the client interface. The association between an enterprise and its clients cannot be established via the GUI.

A Disconnect request cannot be cancelled. The client may reestablish a connection by issuing a Connect request.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, final status for this command is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Disconnect command submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for the Disconnect command are set with VSCMD_Disconnect_SetDefaults . If
Page 890 of the ADIC 601355 Rev A user manual — Note
Page 890 · click to enlarge
Page 890

command-specific defaults are set for the Disconnect command, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Disconnect command, the parameter identifier and the value to be used for the parameter can be submitted on the specific command itself.

The following fields can be retrieved from the status handle after a successful Disconnect request:

  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_TARGET_ENTERPRISE_ID,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 891 of the ADIC 601355 Rev A user manual — See Also
Page 891 · click to enlarge
Page 891

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Connect(l),
  • VSCMD_ConnectQuery(l)
Page 892 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Disconnect_SetDefaults ( “…”, VSID_ENDFIELD)
Page 892 · click to enlarge
Page 892

VSCMD_ Disconnect_ SetDefaults

VSCMD_Disconnect_SetDefaults sets the command-level default parameters for Disconnect commands.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Disconnect commands are set with VSCMD_Disconnect_SetDefaults . If command-specific defaults are set for Disconnect commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Disconnect command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Disconnect_SetDefaults ( “…”, VSID_ENDFIELD)

Page 893 of the ADIC 601355 Rev A user manual — VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)
Page 893 · click to enlarge
Page 893

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Disconnect commands.

VSID_CONNECT_HANDLE (VST_CONNECT_HANDLE)

The connect handle that contains the enterprise callback address information of the enterprise whose connection to the VolServ system is broken. VSID_CONNECT_HANDLE is not applicable if VSID_PROCEDURE_NUMBER, VSID_PROGRAM_NUMBER, VSID_PROTOCOL, and VSID_VERSION_NUMBER are specified.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Disconnect commands.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Disconnect commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

The RPC procedure number of the client process to disconnect from VolServ. VSID_PROCEDURE_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

Parameters · Parameter Type Description

Page 894 of the ADIC 601355 Rev A user manual — VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 894 · click to enlarge
Page 894

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

The RPC program number of the client process to disconnect from VolServ. VSID_PROGRAM_NUMBER is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_PROTOCOL (VST_PROTOCOL) The Internet protocol VolServ uses to return status messages and MediaClass callbacks to the client to be disconnected from VolServ. VSID_PROTOCOL is not applicable if VSID_CONNECT_HANDLE is specified.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Disconnect commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_SOCKADDR_IN (VST_SOCKADDR_IN)

The Internet socket address for the client to disconnect from VolServ.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

The Internet socket address for the client to disconnect from VolServ. Flag indicating whether the API software waits for final status from VolServ (or times-out) for Disconnect commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The enterprise identifier of the enterprise to disconnect from VolServ.

Parameter Type Description

Page 895 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 895 · click to enlarge
Page 895

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Disconnect commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Disconnect commands. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

The RPC version number of the client process to disconnect from VolServ.

Return Values VSCMD_DeletePool_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

Parameter Type Description

Page 896 of the ADIC 601355 Rev A user manual — Example
Page 896 · click to enlarge
Page 896

********* 2 * 3 * FUNCTION: vst_disconnect_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Disconnect API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_disconnect_defaults(void) 15 #else 16 VST_BOOLEAN

vst_disconnect_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Disconnect default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Disconnect_SetDefaults(

Example 1 /****************************************

Page 897 of the ADIC 601355 Rev A user manual — Note
Page 897 · click to enlarge
Page 897

32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Connect(l),
  • VSCMD_ConnectQuery(l)
Page 898 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Dismount (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 898 · click to enlarge
Page 898

VSCMD_ Dismount

A VSCMD_Dismount request informs VolServ that the client is finished using a drive and the medium mounted in the drive.

Upon receipt of a VSCMD_Dismount request for an automated archive, VolServ determines whether the medium has been ejected from the drive by the storage subsystem.

If the medium has been ejected from the drive, VolServ commands the archive robotics to move the medium from the drive pickup point to a bin within the archive system. A successful return code is returned to the client after the medium movement has completed.

If the medium has not been ejected from the drive, the dismount request fails, and VolServ returns a failure status to the client.

For manual archives, a dismount notice is sent to the appropriate archive's console display for action. An operator must dismount the specified medium and then notify VolServ the medium dismount is complete. VolServ returns status to the client only after the operator confirms the dismount is complete.

The Dismount command supports a lock identifier parameter. This parameter is required if the drive to be dismounted has been previously locked with a Lock request.

Synopsis VST_BOOLEAN VSCMD_Dismount (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Page 899 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 899 · click to enlarge
Page 899

Arguments • handle = The command handle for the Dismount request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVE_ID (VST_DRIVE_ID) Identifier of the drive to dismount.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_ERROR_COUNT (VST_COUNT) Number of read/write errors encountered while the drive was mounted.

VSID_LOCK_ID (VST_LOCK_ID) The drive’s lock identifier, required if a drive is locked.

VSID_MEDIA_ID (VST_MEDIA_ID) Identifier of the medium to dismount.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 900 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 900 · click to enlarge
Page 900

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

VSID_USAGE_TIME (VST_USAGE) The length of time, in seconds, the drive was in use.

Parameter Type Description

Page 901 of the ADIC 601355 Rev A user manual — Return Values
Page 901 · click to enlarge
Page 901

Return Values VSCMD_Dismount returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 902 of the ADIC 601355 Rev A user manual — Example
Page 902 · click to enlarge
Page 902
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_dismount_execute 4 * 5 * PURPOSE: 6 * This routine tests the VSCMD_Dismount API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_dismount_execute(

void ) 14 #else 15 VST_BOOLEAN vst_dismount_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_ID media; 20 VST_DRIVE_ID drive; 21 VST_LOCK_ID lock; 22 VST_USAGE time;

Example 1 /****************************************

Page 903 of the ADIC 601355 Rev A user manual — Example
Page 903 · click to enlarge
Page 903

23 VST_COUNT err; 24 VST_COMMAND_HANDLE cmd; 25 26 /* get parameters from user */ 27 printf(“*** Dismount parameters

***\n” ); 28 printf(“Enter Media ID ==> “ ); 29 gets( media ); 30 printf(“Enter Drive ID ==> “ ); 31 drive = atoi(gets(input)); 32 printf(“Enter Lock ID ==> “ ); 33 lock = atol(gets(input)); 34 printf(“Enter Usage Time ==> “ ); 35 time = atol(gets(input)); 36 printf(“Enter Error Count ==> “ ); 37 err = atoi(gets(input)); 38 /* create the command handle */ 39 /* Note that the command handle is

not */ 40 /* destoyed in this routine, but in

*/ 41 /* vst_dispatch when final status is

received. */ 42 cmd = VS_Command_Create(); 43 if (cmd!= (VST_COMMAND_HANDLE )NULL) 44 { 45 /* Send the command to the VolServ software. */ 46 /* Note that status is not processed here. */ 47 /* Instead, it is processed in the */ 48 /* vst_dispatch routine. Also, note that */ 49 /* default values such as timeout,*/ 50 /* value retry limit and priority are set as */ 51 /* default parameters. */ 52 rc = VSCMD_Dismount(cmd, 53 VSID_DRIVE_ID, drive,

Page 904 of the ADIC 601355 Rev A user manual — Notes
Page 904 · click to enlarge
Page 904

54 VSID_MEDIA_ID, media, 55 VSID_LOCK_ID, lock, 56 VSID_USAGE_TIME, time, 57 VSID_ERROR_COUNT, err, 58 VSID_ENDFIELD); 59 } 60 return ( rc ); 61 }

VolServ generates no intermediate status in response to a Dismount request.

VSCMD_Dismount can trigger MediaClass callbacks from VolServ.

VSID_USAGE_TIME and VSID_ERROR_COUNT are optional parameters provided for the client that wants to maintain drive statistics. Correct values for these parameters are the responsibility of the client. When VolServ detects these parameters on a Dismount command, the usage time and/or error count fields for the specified drive are incremented by the amount specified on the Dismount command.

A Dismount request cannot be cancelled. If necessary, the client may request the medium be remounted by issuing a Mount request.

If the drive specified in a Dismount request is off-line, unavailable, or in the diagnostic state, the Dismount request fails.

Page 905 of the ADIC 601355 Rev A user manual — Tip
Page 905 · click to enlarge
Page 905

If the lock identifier specified on a Dismount request differs from the lock identifier associated with the specified drive, the Dismount request fails.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Dismount request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Dismount commands are set with VSCMD_Dismount_SetDefaults . If command-specific defaults are set for Dismount commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Dismount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Page 906 of the ADIC 601355 Rev A user manual — Note
Page 906 · click to enlarge
Page 906

The following fields can be retrieved from the status handle after a successful Dismount request:

  • VSID_DRIVE_ID,
  • VSID_DRIVE_ID_ENTRY,
  • VSID_DRIVE_ID_TABLE,
  • VSID_LOCK_ID,
  • VSID_MEDIA_ID,
  • VSID_MEDIA_ID_ENTRY,
  • VSID_MEDIA_ID_TABLE,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

  • See Also
  • vsapi(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Dismount_SetDefaults(l),
  • VSCMD_Mount(l),
  • VSCMD_Lock(l)
Page 907 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Dismount_SetDefaults ( “…”, VSID_ENDFIELD)
Page 907 · click to enlarge
Page 907

VSCMD_ Dismount_Set Defaults

VSCMD_Dismount_SetDefaults sets the command-level default parameters for Dismount commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Dismount commands are set with VSCMD_Dismount_SetDefaults . If command-specific defaults are set for Dismount commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Dismount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Dismount_SetDefaults ( “…”, VSID_ENDFIELD)

Page 908 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 908 · click to enlarge
Page 908

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Dismount commands.

VSID_DRIVE_ID (VST_DRIVE_ID) Identifier of the drive to dismount.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Dismount commands.

VSID_ERROR_COUNT (VST_COUNT) Number of read/write errors encountered while the drive was mounted.

VSID_LOCK_ID (VST_LOCK_ID) The drive’s lock identifier, required if a drive is locked.

VSID_MEDIA_ID (VST_MEDIA_ID) Identifier of the medium to dismount.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Dismount commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 909 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 909 · click to enlarge
Page 909

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Dismount commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Dismount commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Dismount commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Dismount commands. Neither the API software nor VolServ uses USER_FIELD.

VSID_USAGE_TIME (VST_USAGE) The length of time, in seconds, the drive was in use.

Parameter Type Description

Page 910 of the ADIC 601355 Rev A user manual — Return Values
Page 910 · click to enlarge
Page 910

Return Values VSCMD_Dismount_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_dismount_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Dismount API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_dismount_defaults(void) 15 #else 16 VST_BOOLEAN vst_dismount_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority;

Example 1 /****************************************

Page 911 of the ADIC 601355 Rev A user manual — Note
Page 911 · click to enlarge
Page 911

21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Dismount default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Dismount_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 912 of the ADIC 601355 Rev A user manual — See Also
Page 912 · click to enlarge
Page 912

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Dismount(l)
Page 913 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DrivePoolQuery (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 913 · click to enlarge
Page 913

VSCMD_Drive PoolQuery

The VSCMD_DrivePoolQuery queries for information about one drive pool or about all drive pools known to the VolServ system.

Upon receipt of a Drive Pool Query request, VolServ obtains the requested information about the specified drive pool and returns this information to the client.

Synopsis VST_BOOLEAN VSCMD_DrivePoolQuery (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Drive Pool Query request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 914 of the ADIC 601355 Rev A user manual — VSID_QUERY_OPTION (VST_QUERY_OPTION)
Page 914 · click to enlarge
Page 914

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Name of the drive pool to query. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_POOL_QUERY_OPT (VST_QUERY_LIST_OPTION)

Specifies what drive information, if any, is requested for each specified drive pool. The client can request no drive information, a list of drive identifiers associated with each drive pool, or detailed information about each drive associated with each drive pool. Valid VSID_POOL_QUERY_OPT values are enumerated in the vs_types.h file.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for a single specified drive pool or for all drive pools. Valid VSE_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 915 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 915 · click to enlarge
Page 915

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DrivePoolQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

Parameter Type Description

Page 916 of the ADIC 601355 Rev A user manual — Return Values
Page 916 · click to enlarge
Page 916

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.
Page 917 of the ADIC 601355 Rev A user manual — Example
Page 917 · click to enlarge
Page 917

********* 2 * 3 * FUNCTION: vst_drivepoolquery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DrivePoolQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_drivepoolquery_execute(void) 14 #else 15 VST_BOOLEAN

vst_drivepoolquery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_QUERY_OPTION queryopt; 20 VST_QUERY_LIST_OPTION

querylistopt; 21 int count; 22 VST_DRIVE_POOL_NAME drivepool; 23 VST_COMMAND_HANDLE cmd; 24 25 /* get parameters from user */ 26 printf(“*** DrivePool Query

parameters ***\n” ); 27 printf(“0) Query by drive pool Name,

1. Query all ==> “ ); 28 queryopt = atoi(gets(input)); 29 30 if (queryopt == 0) 31 { 32 printf(“\nEnter drive pool Name ==>”);

Example 1 /****************************************

Page 918 of the ADIC 601355 Rev A user manual — Example
Page 918 · click to enlarge
Page 918

33 gets( drivepool); 34 } 35 printf(“\n1) DriveList , 2) DriveList

Details ==> “ ); 36 querylistopt = atoi(gets(input)); 37 38 /* create the command handle */ 39 /* Note that the command handle is

not */ 40 /* destroyed in this routine, but in

*/ 41 /* vst_dispatch when final status is

received. */ 42 cmd = VS_Command_Create(); 43 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 44 { 45 /* Send the command to the VolServ software. */ 46 /* Note that status is not processed here. */ 47 /* Instead, it is processed in the */ 48 /* vst_dispatch routine. Also, note that */ 49 /* default values such as timeout,*/ 50 /* value retry limit and priority are set as */ 51 /* default parameters. */ 52 if (queryopt == 0) 53 { 54 /* query a single drive pool */ 55 rc = VSCMD_DrivePoolQuery(cmd, 56 VSID_QRY_OPTION, queryopt, 57 VSID_POOL_QRY_OPT, querylistopt, 58 VSID_DRIVEPOOL_NAME, drivepool, 59 VSID_ENDFIELD); 60 }

Page 919 of the ADIC 601355 Rev A user manual — Notes
Page 919 · click to enlarge
Page 919

61 else 62 { 63 /* query all drive pools */ 64 rc = VSCMD_DrivePoolQuery(cmd, 65 VSID_QRY_OPTION, queryopt, 66 VSID_POOL_QRY_OPT, querylistopt, 67 VSID_ENDFIELD); 68 } 69 } 70 return ( rc ); 71 }

VolServ can generate intermediate status in response to a Drive Pool Query request. Statuses are cumulative. Each status is appended to the previous status so that after the final status is given, the status handle contains information from all statuses.

VSCMD_CreatePool does not trigger any MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Drive Pool Query request submitted through the API interface to the VolServ system.

Page 920 of the ADIC 601355 Rev A user manual — Tip
Page 920 · click to enlarge
Page 920

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Drive Pool Query commands are set with VSCMD_DrivePoolQuery_SetDefaults . If command-specific defaults are set for Drive Pool Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Drive Pool Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Drive Pool Query request:

  • VSID_DRIVEPOOL_HANDLE,
  • VSID_DRIVEPOOL_HANDLE_ENTRY,
  • VSID_DRIVEPOOL_HANDLE_TABLE,
  • VSID_QUERY_OPTION,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.
Page 921 of the ADIC 601355 Rev A user manual — Note
Page 921 · click to enlarge
Page 921

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_DrivePoolQuery_SetDefaults(l)
Page 922 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DrivePoolQuery_SetDefaults ( “…”, VSID_ENDFIELD)
Page 922 · click to enlarge
Page 922

VSCMD_Drive PoolQuery_ SetDefaults

VSCMD_DrivePoolQuery_SetDefaults sets the command-level default parameters for Drive Pool Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Drive Pool Query commands are set with VSCMD_DrivePoolQuery_SetDefaults . If command-specific defaults are set for Drive Pool Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Drive Pool Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_DrivePoolQuery_SetDefaults ( “…”, VSID_ENDFIELD)

Page 923 of the ADIC 601355 Rev A user manual — VSID_POOL_QUERY_OPT (VST_QUERY_LIST_OPTION)
Page 923 · click to enlarge
Page 923

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Drive Pool Query commands.

VSID_DRIVEPOOL_NAME (VST_DRIVEPOOL_NAME)

Name of the drive pool to query. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Drive Pool Query commands.

VSID_POOL_QUERY_OPT (VST_QUERY_LIST_OPTION)

Specifies what drive information, if any, is requested for each specified drive pool. The client can request no drive information, a list of drive identifiers associated with each drive pool, or detailed information about each drive associated with each drive pool. Valid VSID_POOL_QUERY_OPT values are enumerated in the vs_types.h file.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Drive Pool Query commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 924 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 924 · click to enlarge
Page 924

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for a single specified drive pool or for all drive pools. Valid VSE_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Drive Pool Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Drive Pool Query commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to be put in USER_FIELD for Drive Pool Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Drive Pool Query commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 925 of the ADIC 601355 Rev A user manual — Return Values
Page 925 · click to enlarge
Page 925

Return Values VSCMD_DrivePoolQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_drivepoolquery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_DrivePoolQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_drivepoolquery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_drivepoolquery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE;

Example 1 /****************************************

Page 926 of the ADIC 601355 Rev A user manual — Note
Page 926 · click to enlarge
Page 926

20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** drive pool Query default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_DrivePoolQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 927 of the ADIC 601355 Rev A user manual — See Also
Page 927 · click to enlarge
Page 927

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_DrivePoolQuery(l)
Page 928 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 928 · click to enlarge
Page 928

VSCMD_Drive Query

VSCMD_DriveQuery queries for information about one or more drives known to the VolServ system.

Upon receipt of a Drive Query command, VolServ obtains the requested information and returns this information to the client.

Synopsis VST_BOOLEAN VSCMD_DriveQuery (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Drive Query request.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status for this request.

VSID_DRIVE_ID (VST_DRIVE_ID) Identifier of a single drive to query.

VSID_DRIVE_ID_LIST (int) Number of drives to query. Can be greater than or equal to 1.

(VST_DRIVE_ID *) Pointer to a list of identifiers of drives to query.

Parameters · Parameter Type Description

Page 929 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 929 · click to enlarge
Page 929

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive final status on this request.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is requested for all drives known to the VolServ system or for the drives identified in a list specified with the Drive Query request. Valid VSE_QUERY_OPTION values are enumerated in the vs_types.h file.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

Parameter Type Description

Page 930 of the ADIC 601355 Rev A user manual — Return Values
Page 930 · click to enlarge
Page 930

VSID_USER_FIELD (VST_USER_FIELD) Value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_DriveQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode - Good initial status received if the API is operating in asynchronous mode • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code. - If the object code value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred. • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.

  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

Parameter Type Description

Page 931 of the ADIC 601355 Rev A user manual — Example
Page 931 · click to enlarge
Page 931

- If the object code value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error. • VSE_ERR_BADFIELD - An invalid parameter was specified.

  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_drivequery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_DriveQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_drivequery_execute(void) 14 #else 15 VST_BOOLEAN vst_drivequery_execute()

Example 1 /****************************************

Page 932 of the ADIC 601355 Rev A user manual — NULL)
Page 932 · click to enlarge
Page 932

16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_QUERY_OPTION queryopt; 20 int count; 21 VST_DRIVE_ID temp_drive_id; 22 VST_DRIVE_ID

drivelist[VST_MAX_ITEMS]; 23 VST_COMMAND_HANDLE cmd; 24 25 /* get parameters from user */ 26 printf(“*** Drive Query parameters

***\n” ); 27 printf(“0) Query by drive list, 1)

Query all, 2) Query single DriveID==> “ ); 28 queryopt = atoi(gets(input)); 29 30 if (queryopt == 0) 31 { 32 count = vst_getdrivelist(drivelist, VST_MAX_ITEMS); 33 } 34 else if (queryopt == 2) 35 { 36 printf(“\nEnter Drive ID to query: “); 37 temp_drive_id = atoi(gets(input)); 38 } 39 40 /* create the command handle */ 41 /* Note that the command handle is

not */ 42 /* destroyed in this routine, but in

*/ 43 /* vst_dispatch when final status is

received. */ 44 cmd = VS_Command_Create(); 45 if ( cmd != (VST_COMMAND_HANDLE)

NULL)

Page 933 of the ADIC 601355 Rev A user manual — Notes
Page 933 · click to enlarge
Page 933

46 { 47 /* Send the command to the VolServ software. */ 48 /* Note that status is not processed here. */ 49 /* Instead, it is processed in the */ 50 /* vst_dispatch routine Also, note that */ 51 /* default values such as timeout,*/ 52 /* value retry limit and priority are set as */ 53 /* default parameters. */ 54 if(queryopt == 2) 55 { 56 rc = VSCMD_DriveQuery(cmd, 57 VSID_QRY_OPTION, VSE_QUERY_OPTION_NONE, 58 VSID_DRIVE_ID, temp_drive_id, 59 VSID_ENDFIELD); 60 } 61 else 62 { 63 rc = VSCMD_DriveQuery(cmd, 64 VSID_QRY_OPTION, queryopt, 65 VSID_DRIVE_ID_LIST, count,drivelist, 66 VSID_ENDFIELD); 67 } 68 } 69 return ( rc ); 70 }

Page 934 of the ADIC 601355 Rev A user manual — Notes
Page 934 · click to enlarge
Page 934

VolServ can generate intermediate status in response to a Drive Query request. Statuses are cumulative. Each status is added to the previous status so that after the final status is given, the status handle contains information from all statuses.

VSCMD_DriveQuery does not trigger any MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

The VSID_DRIVE_ID_LIST and VSID_COMP_STATE_LIST parameters require that two arguments be passed instead of one.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Drive Query request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Drive Query commands are set with VSCMD_DriveQuery_SetDefaults . If
Page 935 of the ADIC 601355 Rev A user manual — Note
Page 935 · click to enlarge
Page 935

command-specific defaults are set for Drive Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Drive Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Drive Query request:

  • VSID_DRIVE_HANDLE,
  • VSID_DRIVE_HANDLE_ENTRY,
  • VSID_DRIVE_HANDLE_TABLE,
  • VSID_ERROR_CODE,
  • VSID_ERROR_CODE_ENTRY,
  • VSID_ERROR_CODE_TABLE,
  • VSID_SEQUENCE_NUM,
  • VSID_SEQUENCE_TABLE,
  • VSID_STATUS_CODE,
  • VSID_STATUS_TYPE,
  • VSID_USER_FIELD.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 936 of the ADIC 601355 Rev A user manual — See Also
Page 936 · click to enlarge
Page 936
  • See Also
  • vsapi(l),
  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Command_GetFields(l),
  • VS_Drive_GetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VS_Table_GetFields(l),
  • VSCMD_DriveQuery_SetDefaults(l)
Page 937 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_DriveQuery_SetDefaults ( “…”, VSID_ENDFIELD)
Page 937 · click to enlarge
Page 937

VSCMD_Drive Query_ SetDefaults

VSCMD_DriveQuery_SetDefaults sets the command-level default parameters for Drive Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Drive Query commands are set with VSCMD_Drive Query_SetDefaults . If command-specific defaults are set for Drive Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Drive Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_DriveQuery_SetDefaults ( “…”, VSID_ENDFIELD)

Page 938 of the ADIC 601355 Rev A user manual — VSID_QUERY_OPTION (VST_QUERY_OPTION)
Page 938 · click to enlarge
Page 938

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

Name of the client dispatch routine to receive status on Drive Query commands.

VSID_DRIVE_ID (VST_DRIVE_ID) Identifier of a single drive to query.

VSID_DRIVE_ID_LIST (int) Number of drives to query. May be greater than or equal to 1.

(VST_DRIVE_ID *) Pointer to a list of identifiers of drives to query.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

Identifier of the enterprise, if any, to receive intermediate and final status on Drive Query commands.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Drive Query commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_QUERY_OPTION (VST_QUERY_OPTION)

Indicates whether information is being requested for all drives known to the VolServ system or for the drives identified in a list specified with the Drive Query request. Valid VSE_QUERY_OPTION values are enumerated in the vs_types.h file.

Parameters · Parameter Type Description

Page 939 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 939 · click to enlarge
Page 939

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) Number of times the API software retries for command status from VolServ before returning a time-out to the client software for Drive Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

Flag indicating whether the API software waits for final status from VolServ (or times-out) for Drive Query commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) Amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) Value to put in USER_FIELD for Drive Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Drive Query commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 940 of the ADIC 601355 Rev A user manual — Return Values
Page 940 · click to enlarge
Page 940

Return Values VSCMD_DriveQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error.
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - Value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_drivequery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_DriveQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_drivequery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_drivequery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE;

Example 1 /****************************************

Page 941 of the ADIC 601355 Rev A user manual — Notes
Page 941 · click to enlarge
Page 941

20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Drive Query default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_DriveQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Two levels of default parameter settings are used in the API software— global defaults and command-specific defaults.

Page 942 of the ADIC 601355 Rev A user manual — Note
Page 942 · click to enlarge
Page 942

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_DriveQuery(l)
Page 943 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ModifyArchiveMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 943 · click to enlarge
Page 943

VSCMD_ Modify ArchiveMedia Class

VSCMD_ModifyArchiveMediaClass modifies the value of one or more attributes of an archive media class. An archive media class is the association of a MediaClass group with a defined archive.

All archive media class attributes must be specified on a Modify Archive Media Class request, whether the value of an attribute is being modified or not.

Synopsis VST_BOOLEAN VSCMD_ModifyArchiveMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Modify Archive Media Class command.

  • “ … ” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.
Page 944 of the ADIC 601355 Rev A user manual — VSCMD_ Modify ArchiveMedia Class
Page 944 · click to enlarge
Page 944
Page 944 of the ADIC 601355 Rev A user manual — VSCMD_ Modify ArchiveMedia Class
Page 945 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 945 · click to enlarge
Page 945

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_MODE)

Specifies what action VolServ is to take when the number of media in the archive media class exceeds the specified high mark threshold. Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The name of the archive associated with the archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY) The percentage of the total MediaClass capacity that can be stored in this archive.

Functins

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE)

Preferred locations (in table format) for media assigned to this archive media class

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status for this request.

VSID_HIGH_MARK (VST_HIGH_MARK) The percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_LOW_MARK (VST_LOW_MARK) The percentage of VSID_CAPACITY below which the specified migration policy option is performed or terminated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

Parameters · Parameter Type Description

Page 946 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 946 · click to enlarge
Page 946

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The name of the MediaClass group associated with the archive media class. Valid MediaClass names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_MIGRATION_PRIORITY (VST_PRIORITY)

The migration priority applied to this archive media class.

VSID_PERCENT (VST_PERCENT) The percentage of the MediaClass capacity allowed in the archive associated with the archive media class.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameter Type Description

Page 947 of the ADIC 601355 Rev A user manual — Functins
Page 947 · click to enlarge
Page 947

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive for media automatically migrated out of this archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) A value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Functins

Return Values VSCMD_ModifyArchiveMediaClass returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed. To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields ) to retrieve the error handle’s object code.

Parameter Type Description

Page 948 of the ADIC 601355 Rev A user manual — Example
Page 948 · click to enlarge
Page 948

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

Example 1 /**************************************** · ********* 2 *

Page 949 of the ADIC 601355 Rev A user manual — Functins
Page 949 · click to enlarge
Page 949

3 * FUNCTION: vst_modarchivemediaclass_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ModifyArchiveMediaClass 7 * API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modarchivemediaclass_execute( void) 15 #else 16 VST_BOOLEAN

Functins

vst_modarchivemediaclass_execute( ) 17 #endif 18 { 19 int i; 20 int count; 21 VST_BOOLEAN rc = VSE_FALSE; 22 VST_ARCHIVE_NAME archive; 23 VST_MEDIA_CLASS_NAME

mediaclass; 24 VST_CAPACITY capacity; 25 VST_ARCHIVE_ACTION_OPTION action; 26 VST_HIGH_MARK highmark; 27 VST_LOW_MARK lowmark; 28 VST_PRIORITY migpri; 29 VST_ARCHIVE_NAME

targetarchive; 30 VST_TABLE_HANDLE · comphandletable; 31 VST_COMPONENT_HANDLE · comphandle;

Page 950 of the ADIC 601355 Rev A user manual — Example
Page 950 · click to enlarge
Page 950

32 VST_COMP_TYPE CompType =

VSE_COMPTYPE_COLUMN; 33 VST_COMPONENT_ID CompID; 34 VST_COMMAND_HANDLE cmd; 35 36 bzero ( CompID, sizeof (

VST_COMPONENT_ID ) ); 37 /* get parameters from user */ 38 printf(“*** Modify parameters ***\n”

); 39 printf(“*** The archive media class

grouping must exist. ***\n”); 40 printf(“Enter Archive Name ==> “ ); 41 gets( archive ); 42 printf(“Enter Media Class Name ==> “

); 43 gets( mediaclass ); 44 printf(“Enter Capacity Percent ==> “

); 45 capacity = atoi(gets(input)); 46 printf(“Enter Archive action option

(0-none/1-mig/2-notify) ==> “ ); 47 action = atoi(gets(input)); 48 printf(“Enter High Mark Percentage

==> “ ); 49 highmark = atoi(gets(input)); 50 printf(“Enter Low Mark Percentage ==>

“ ); 51 lowmark = atoi(gets(input)); 52 53 if ( action == VSE_ARCHIVE_ACTION_MIG

) 54 { 55 printf(“Enter Target Archive ==> “ ); 56 gets( targetarchive ); 57 printf(“Enter Migration Priority == > “ ); 58 migpri = atoi(gets(input)); 59 /* These only need to be set when migration */ 60 /* is used. */

Page 951 of the ADIC 601355 Rev A user manual — Functins
Page 951 · click to enlarge
Page 951

61 VSCMD_ModifyArchiveMediaClass_Set Defaults ( 62 VSID_TARGET_ARCHIVE_NAME, targetarchive, 63 VSID_MIGRATION_PRIORITY, migpri, 64 VSID_ENDFIELD ); 65 } 66 67 printf(“How many prefered placements

(0 to skip): “); 68 count = atoi(gets(input)); 69 if (count > 0) 70 { 71 comphandletable = VS_Table_Create(VSE_COMPONENT_HAN DLE, count); 72 if (comphandletable == (VST_TABLE_HANDLE) NULL) 73 { 74 return (VSE_FALSE); 75 } 76 for (i = 0; i < count; i++) 77 { 78 printf(“Enter row #%d:”, i + 1); 79 CompID[0] = (short) atoi(gets(input)); 80 printf(“Enter column #%d:”, i + 1); 81 CompID[1] = (short) atoi(gets(input)); 82 CompID[2] = 0; 83 CompID[3] = 0; 84 comphandle = VS_Component_Create(); 85 VS_Component_SetFields(comphandle , 86 VSID_COMP_TYPE, CompType,

Functins

Page 952 of the ADIC 601355 Rev A user manual — Example
Page 952 · click to enlarge
Page 952

87 VSID_COMP_ID, CompID, 88 VSID_ENDFIELD); 89 VS_Table_AddEntry(comphandletable ,comphandle); 90 } 91 VSCMD_ModifyArchiveMediaClass_Set Defaults( 92 VSID_COMPONENT_HANDLE_TABLE, comphandletable, 93 VSID_ENDFIELD); 94 } 95 96 /* create the command handle */ 97 /* Note that the command handle is

not */ 98 /* destoyed in this routine, but in

*/ 99 /* vst_dispatch when final status is

received. */ 100 cmd = VS_Command_Create(); 101 if (cmd != (VST_COMMAND_HANDLE )NULL) 102 { 103 /* Send the command to the VolServ software. */ 104 /* Note that status is not processed here. */ 105 /* Instead, it is processed in the */ 106 /* vst_dispatch routine. Also, note that */ 107 /* default values such as timeout */ 108 /* value retry limit and priority are set as */ 109 /* default parameters. */ 110 rc = VSCMD_ModifyArchiveMediaClass(cmd ,

Page 953 of the ADIC 601355 Rev A user manual — Functins
Page 953 · click to enlarge
Page 953

111 VSID_ARCHIVE_NAME, archive, 112 VSID_MEDIA_CLASS_NAME, mediaclass, 113 VSID_HIGH_MARK, highmark, 114 VSID_LOW_MARK, lowmark, 115 VSID_CAPACITY, capacity, 116 VSID_ENDFIELD); 117 } 118 return ( rc ); 119}

Functins

VolServ generates no intermediate status in response to a Modify Archive Media Class.

VSCMD_ModifyArchiveMediaClass does not trigger unsolicited MediaClass callbacks from VolServ.

The migration policy options for are no action, operator notification, and automatic migration.

When the number of media in an archive media class reaches the high mark threshold, VolServ:

  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy option is set to notify.
  • Initiates automatic migration of media if the migration policy is set to migrate.

When the number of media in an archive media class drops to the low mark threshold, VolServ:

Page 954 of the ADIC 601355 Rev A user manual — Notes
Page 954 · click to enlarge
Page 954
  • Does nothing if the migration policy option is set to none.
  • Issues an operator message if the migration policy is set to notify.
  • Terminates automatic migration of media if the migration policy is set to migrate.

The capacity value of an archive media class is relative to the MediaClass group specified overall capacity. Consideration should be given to all media classes that are able to share this archive to ensure that reasonably comparable capacity limitations and high/low marks are set for each archive media class.

Media can reside in an archive only if their associated MediaClass group has an archive media class assignment in that archive.

Archive media class computed capacity limits are “soft”, that is, they can be exceeded when media are imported or moved in from another archive. If automigration is specified, media of this MediaClass group is marked for movement to their target archive. The media type capacity designates the “hard” limit when entering media into an archive.

An archive media class computed capacity is refigured if the capacity of a MediaClass group changes.

Checks to determine if the high mark has been reached or exceeded or the low mark has been reached or passed occur:

  • After any Eject, Enter, Reclassify, or Modify Archive Media Class command executes.
  • After the MediaClass group or archive media class are redefined.
Page 955 of the ADIC 601355 Rev A user manual — Note
Page 955 · click to enlarge
Page 955

The sum of all archive media class capacities can exceed the archive’s physical ability to house media. If VSID_CAPACITY values are set unrealistically high and VSID_HIGH_MARK is similarly high, the archive may physically completely fill before any automigration procedure is triggered.

Components listed as preferred for storage of media of this MediaClass group do not have exclusive ownership of those components.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, final status for this request is returned to the enterprise registered with VolServ.

Functins

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Modify Archive Media Class request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.

Note

Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.

Page 956 of the ADIC 601355 Rev A user manual — Tip
Page 956 · click to enlarge
Page 956
  • Command-specific parameter defaults for Modify Media Class commands are set with VSCMD_ModifyMediaClass_SetDefaults . If command-specific defaults are set for Modify Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Modify Archive Media Class request:

  • VSID_ARCHIVE_NAME ,
  • VSID_COMPONENT_HANDLE ,
  • VSID_COMPONENT_HANDLE_ENTRY,
  • VSID_COMPONENT_HANDLE_TABLE,
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE _ ENTRY ,
  • VSID_ERROR_CODE_TABLE,
  • VSID_MEDIA_CLASS_NAME ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .
Page 957 of the ADIC 601355 Rev A user manual — Functins
Page 957 · click to enlarge
Page 957

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreateArchiveMediaClass(l),
  • VSCMD_DeleteArchiveMediaClass(l),

Functins

  • VSCMD_ModifyArchiveMediaClass_SetDefaults(l)
Page 958 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ModifyArchiveMediaClass _SetDefaults ( “…”, VSID_ENDFIELD)
Page 958 · click to enlarge
Page 958

VSCMD_ Modify ArchiveMedia Class_Set Defaults

VSCMD_ModifyArchieMediaClass_SetDefaults sets the command-level default parameters for Modify Archive Media Class commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Modify Media Class commands are set with VSCMD_ModifyMediaClass_SetDefaults . If command-specific defaults are set for Modify Media Class commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself

Synopsis VST_BOOLEAN VSCMD_ModifyArchiveMediaClass _SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value used as a command default

Page 959 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 959 · click to enlarge
Page 959

value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_ARCHIVE_ACTION (VST_ARCHIVE_ACTION_MODE)

Specifies what action VolServ is to take when the number of media in the archive media class exceeds the specified high mark threshold. Valid VSID_ARCHIVE_ACTION values are enumerated in the vs_types.h file.

Functins

VSID_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The name of the archive associated with the archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_CAPACITY (VST_CAPACITY) The percentage of the total MediaClass capacity that can be stored in this archive.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Modify Archive Media Class commands.

VSID_COMPONENT_HANDLE_TABLE (VST_TABLE_HANDLE)

Preferred locations (in table format) for media assigned to this archive media class.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Modify Archive Media Class commands.

Parameters · Parameter Type Description

Page 960 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 960 · click to enlarge
Page 960

VSID_PRIORITY) The requested execution priority for Modify Archive Media Class commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Modify Archive Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Modify Archive Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The destination archive for media automatically migrated out of this archive media class. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

Parameter Type Description

Page 961 of the ADIC 601355 Rev A user manual — Functins
Page 961 · click to enlarge
Page 961

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Modify Archive Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Modify Archive Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ModifyArchiveMediaClass_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .

Functins

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_modarchivemediaclass_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the

Parameter Type Description · Example 1 /****************************************

Page 962 of the ADIC 601355 Rev A user manual — Return Values
Page 962 · click to enlarge
Page 962

7 * VSCMD_ModifyArchiveMediaClass API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modarchivemediaclass_defaults (void) 15 #else 16 VST_BOOLEAN

vst_modarchivemediaclass_defaults () 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Modify Archive Media

Class default parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_ModifyArchiveMediaClass_Set Defaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout,

Page 963 of the ADIC 601355 Rev A user manual — Functins
Page 963 · click to enlarge
Page 963

35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Functins

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ModifyArchiveMediaClass(l)
Page 964 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ModifyMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 964 · click to enlarge
Page 964

VSCMD_ ModifyMedia Class

VSCMD_ModifyMediaClass modifies the value of one or more attributes of a MediaClass group. A MediaClass group establishes common characteristics for the media it contains.

All MediaClass group attributes must be specified on a Modify Media Class request, whether the value of an attribute is being modified or not.

Synopsis VST_BOOLEAN VSCMD_ModifyMediaClass (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Modify Media Class command.

  • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value of the field to use for this request. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CAPACITY (VST_CAPACITY) The maximum number of media allowed in this MediaClass group.

Parameters · Parameter Type Description

Page 965 of the ADIC 601355 Rev A user manual — VSID_NEW_MEDIA_CLASS_NAME (VST_NEW_MEDIA_CLASS_NAME)
Page 965 · click to enlarge
Page 965

VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE)

Indicates whether this MediaClass group supports the mount by MediaClass functionality. Valid VSID_CLASS_MOUNT_STATE values are enumerated in the vs_types.h file.

VSID_CLASS_RPC_OPTION (VST_CLASS_RPC_OPTION)

Indicates whether callbacks are activated for this MediaClass group and if they are, which callback scheme is used. Valid VSID_CLASS_RPC_OPTION values are enumerated in the vs_types.h file.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status for this request.

Functins

VSID_HIGH_MARK (VST_HIGH_MARK) The percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

VSID_HOST_NAME (VST_HOST_NAME) The network-assigned name of the computer where the task that listens for MediaClass callbacks executes. Applicable only if VSID_CLASS_RPB_OPTION is set to VSE_CLASS_RPC_STANDARD.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The unique name assigned to the MediaClass group.

VSID_NEW_MEDIA_CLASS_NAME (VST_NEW_MEDIA_CLASS_NAME)

The new, unique name assigned to the specified MediaClass group.

Parameter Type Description

Page 966 of the ADIC 601355 Rev A user manual — VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)
Page 966 · click to enlarge
Page 966

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

The media type supported by this MediaClass group. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)

The user-specified comment included in a system log message when the number of media in the MediaClass group exceeds the high mark threshold. The MediaClass name, fill level, high mark threshold, and capacity values are automatically included in the system log message and need not be included in VSID_NOTIFY_COMMENT.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Modify Media Class commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

The RPC procedure number of the client process to receive callbacks generated for this MediaClass group. VSID_PROCEDURE_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROCEDURE_NUMBER is not applicable.

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

The RPC program number of the client process to receive callbacks generated for this MediaClass group. VSID_PROGRAM_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROGRAM_NUMBER is not applicable.

Parameter Type Description

Page 967 of the ADIC 601355 Rev A user manual — Functins
Page 967 · click to enlarge
Page 967

VSID_PROTOCOL (VST_PROTOCOL) The Internet protocol VolServ is to use to send callbacks for this MediaClass group. The default VSID_PROTOCOL is VSE_PROT_TCP. VSID_PROTOCOL is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROTOCOL is not applicable.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Modify Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Modify Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Functins

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise to receive callbacks for this MediaClass group.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

Parameter Type Description

Page 968 of the ADIC 601355 Rev A user manual — VSID_VERSION_NUMBER (VST_VERSION_NUMBER)
Page 968 · click to enlarge
Page 968

VSID_USER_FIELD (VST_USER_FIELD) A value to put in USER_FIELD for Modify Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Modify Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

The RPC version number of the client process to receive callbacks generated for this MediaClass group. VSID_VERSION_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_VERSION_NUMBER is not applicable.

Return Values VSCMD_ModifyMediaClass returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode.

- Good initial status received if the API is operating in asynchronous mode.

  • VSE_FALSE - The command failed. A return code of VSE_FALSE (which is 0) means the command failed. To determine where the error occurred, and what the error was, the client queries the command’s error handle (with VS_Error_GetFields ) to retrieve the error handle’s object code.

Parameter Type Description

Page 969 of the ADIC 601355 Rev A user manual — Functins
Page 969 · click to enlarge
Page 969

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ, and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API, and the client uses VST_ERROR_CODE to identify the specific error.

Functins

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

Example 1 /**************************************** · ********* 2 *

Page 970 of the ADIC 601355 Rev A user manual — Example
Page 970 · click to enlarge
Page 970
3 * FUNCTIONvst_modmediaclass_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ModMediaClass

API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_modmediaclass_execute(void) 14 #else 15 VST_BOOLEAN

vst_modmediaclass_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_CLASS_NAME mediaclass; 20 VST_MEDIA_CLASS_NAME newclass; 21 VST_CAPACITY capacity; 22 VST_CLASS_MOUNT_STATE mountstate; 23 VST_HIGH_MARK highmark; 24 VST_COMMAND_HANDLE cmd; 25 VST_NOTIFY_COMMENT comment; 26 VST_CLASS_RPC_OPTION rpc_option; 27 VST_HOSTNAME

rpc_hostname; 28 VST_PROGRAM_NUMBER rpc_prognum; 29 VST_VERSION_NUMBER rpc_versnum; 30 VST_PROCEDURE_NUMBER rpc_procnum; 31 VST_PROTOCOL

enterpriseid; 33 34 /* get parameters from user */ 35 printf(“*** Modify Media Class

rpc_protocol; 32 VST_ENTERPRISE_ID · parameters ***\n” );

Page 971 of the ADIC 601355 Rev A user manual — Functins
Page 971 · click to enlarge
Page 971

36 printf(“\nEnter Media Class to modify

==>”); 37 gets( mediaclass); 38 printf(“\nEnter New Media Class Name

(return to leave unchanged) ==>“); 39 gets( newclass); 40 printf(“\nEnter capacity==>”); 41 capacity = atoi(gets(input)); 42 printf(“\nEnter class mount state (0)

no, (1) ok: “); 43 mountstate = atoi(gets(input)); 44 printf(“\nEnter high mark ==>”); 45 highmark = atoi(gets(input)); 46 printf(“\nEnter notify comment

==>”); 47 gets(comment); 48 printf(“\nEnter Option (0) no

callbacks, (1) standard, (2) Enterprise ==>”); 49 rpc_option = (VST_CLASS_RPC_OPTION)

Functins

atoi(gets(input)); 50 if (rpc_option ==

VSE_CLASS_RPC_NONE) 51 { 52 VSCMD_ModifyMediaClass_SetDefault s( 53 VSID_CLASS_RPC_OPTION, rpc_option, 54 VSID_ENDFIELD); 55 } 56 else if (rpc_option ==

VSE_CLASS_RPC_STANDARD) 57 { 58 printf(“\nEnter RPC Host Name ==>”); 59 gets(rpc_hostname); 60 printf(“\nEnter program number ==>”); 61 rpc_prognum = (VST_PROGRAM_NUMBER) atol(gets(input));

Page 972 of the ADIC 601355 Rev A user manual — Example
Page 972 · click to enlarge
Page 972

62 printf(“\nEnter version number ==>”); 63 rpc_versnum = (VST_PROGRAM_NUMBER) atol(gets(input)); 64 printf(“\nEnter procedure number ==>”); 65 rpc_procnum = (VST_PROGRAM_NUMBER) atol(gets(input)); 66 printf(“\nEnter Protocol (6) TCP or (17) UDP ==>”); 67 rpc_protocol = (VST_PROTOCOL) atoi(gets(input)); 68 VSCMD_ModifyMediaClass_SetDefault s( 69 VSID_HOST_NAME, rpc_hostname, 70 VSID_CLASS_RPC_OPTION, rpc_option, 71 VSID_PROGRAM_NUMBER, rpc_prognum, 72 VSID_VERSION_NUMBER, rpc_versnum, 73 VSID_PROCEDURE_NUMBER, rpc_procnum, 74 VSID_PROTOCOL, rpc_protocol, 75 VSID_ENDFIELD); 76 } 77 else if (rpc_option ==

VSE_CLASS_RPC_ENTERPRISE) 78 { 79 printf(“\nEnter enterprise id ==>”); 80 enterpriseid = (VST_ENTERPRISE_ID) atol(gets(input)); 81 VSCMD_ModifyMediaClass_SetDefault s(

Page 973 of the ADIC 601355 Rev A user manual — Functins
Page 973 · click to enlarge
Page 973

82 VSID_CLASS_RPC_OPTION, rpc_option, 83 VSID_TARGET_ENTERPRISE_ID, enterpriseid, 84 VSID_ENDFIELD); 85 } 86 87 /* create the command handle */ 88 /* Note that the command handle is

not */ 89 /* destoyed in this routine, but in

*/ 90 /* vst_dispatch when final status is

received. */ 91 cmd = VS_Command_Create(); 92 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 93 { 94 /* Send the command to the VolServ software. */ 95 /* Note that status is not processed here. */ 96 /* Instead, it is processed in the */ 97 /* vst_dispatch routine. Also, note that */ 98 /* default values such as timeout */ 99 /* value retry limit and priority are set as */ 100 /* default parameters. */ 101 rc = VSCMD_ModifyMediaClass(cmd, 102 VSID_MEDIA_CLASS_NAME, mediaclass, 103 VSID_NEW_MEDIA_CLASS_NAME, newclass, 104 VSID_CAPACITY, capacity, 105 VSID_CLASS_MOUNT_STATE, mountstate, 106 VSID_HIGH_MARK, highmark,

Functins

Page 974 of the ADIC 601355 Rev A user manual — Notes
Page 974 · click to enlarge
Page 974

107 VSID_NOTIFY_COMMENT, comment, 108 VSID_ENDFIELD); 109 } 110 return ( rc ); 111}

VolServ can generate intermediate status in response to a Modify Media Class request.

The Modify Media Class command triggers unsolicited MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

The name specified for the MediaClass group must be unique. Any requests to create non-unique MediaClass names fail.

MediaClass groups can span archives.

MediaClass groups may contain only one type of media.

Checks to determine if VSID_HIGH_MARK has been reached or exceeded occur after any Reclassify, Import, or Modify Media Class command.

VSID_CAPACITY is a hard limit. VolServ does not permit the number of media assigned to a MediaClass group to exceed the VSID_CAPACITY for that MediaClass group.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, final status for this request is returned to the enterprise registered with VolServ.

Page 975 of the ADIC 601355 Rev A user manual — Functins
Page 975 · click to enlarge
Page 975

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Modify Media Class request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Modify Media Class commands are set with VSCMD_ModifyMediaClass_SetDefaults . If command-specific defaults are set for Modify Media Class commands, they override the global defaults for all commands.

Functins

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Modify Media Class command:

  • VSID_MEDIA_CLASS_NAME ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .
Page 976 of the ADIC 601355 Rev A user manual — Note
Page 976 · click to enlarge
Page 976

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreateMediaClass(l),
  • VSCMD_DeleteMediaClass(l),
  • VSCMD_ModifyMediaClass_SetDefaults(l)
Page 977 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ModifyMediaClass ( “…”, VSID_ENDFIELD)
Page 977 · click to enlarge
Page 977

VSCMD_ ModifyMedia Class_Set Defaults

VSCMD_ModifyMediaClass_SetDefaults sets the command-level default parameters for Modify Media Class commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Modify Media Class commands are set with VSCMD_ModifyMediaClass_SetDefaults . If command-specific defaults are set for Modify Media Class commands, they override the global defaults for all commands.

Functins

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Media Class command, the parameter identifier and the value used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_ModifyMediaClass ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of arguments. Each pair of Arguments consists of a parameter identifier, followed by the value used as a command default

Page 978 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 978 · click to enlarge
Page 978

value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CAPACITY (VST_CAPACITY) The maximum number of media allowed in this MediaClass group.

VSID_CLASS_MOUNT_STATE (VST_CLASS_MOUNT_STATE)

Indicates whether this MediaClass group supports the “mount by MediaClass” functionality. Valid VSID_CLASS_MOUNT_STATE values are enumerated in the vs_types.h file.

VSID_CLASS_RPC_OPTION (VST_CLASS_RPC_OPTION)

Indicates whether callbacks are activated for this MediaClass group and if they are, which callback scheme is used. Valid VSID_CLASS_RPC_OPTION values are enumerated in the vs_types.h file.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (int) The number of enterprise identifiers in the list.

(VST_ENTERPRISE_ID) The identifier of the enterprise, if any, to receive intermediate and final status for this request.

VSID_HIGH_MARK (VST_HIGH_MARK) The percentage of VSID_CAPACITY above which the specified migration policy option is performed or initiated. This field is applicable only if VSID_ARCHIVE_ACTION is set to VSE_ARCHIVE_ACTION_NOTIFY or VSE_ARCHIVE_ACTION_MIG.

Parameters · Parameter Type Description

Page 979 of the ADIC 601355 Rev A user manual — VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)
Page 979 · click to enlarge
Page 979

VSID_HOST_NAME (VST_HOST_NAME) The network-assigned name of the computer where the task that listens for MediaClass callbacks executes. Applicable only if VSID_CLASS_RPB_OPTION is set to VSE_CLASS_RPC_STANDARD.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The current name assigned to the MediaClass group.

VSID_NEW_MEDIA_CLASS_NAME (VST_NEW_MEDIA_CLASS_NAME)

The current name assigned to the MediaClass group.

VSID_MEDIA_TYPE_NAME (VST_MEDIA_TYPE_NAME)

The media type supported by this MediaClass group. Valid media type names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

Functins

VSID_NOTIFY_COMMENT (VST_NOTIFY_COMMENT)

The user-specified comment included in a system log message when the number of media in the MediaClass group exceeds the high mark threshold. The MediaClass name, fill level, high mark threshold, and capacity values are automatically included in the system log message and need not be included in VSID_NOTIFY_COMMENT.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Modify Media Class commands. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_PROCEDURE_NUMBER (VST_PROCEDURE_NUMBER)

The RPC procedure number of the client process to receive callbacks generated for this MediaClass group. VSID_PROCEDURE_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROCEDURE_NUMBER is not applicable.

Parameter Type Description

Page 980 of the ADIC 601355 Rev A user manual — VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 980 · click to enlarge
Page 980

VSID_PROGRAM_NUMBER (VST_PROGRAM_NUMBER)

The RPC program number of the client process to receive callbacks generated for this MediaClass group. VSID_PROGRAM_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROGRAM_NUMBER is not applicable.

VSID_PROTOCOL (VST_PROTOCOL) The Internet protocol VolServ is to use to send callbacks for this MediaClass group. The default VSID_PROTOCOL is VSE_PROT_TCP. VSID_PROTOCOL is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_PROTOCOL is not applicable.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Modify Media Class commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Modify Media Class commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise to receive callbacks for this MediaClass group.

Parameter Type Description

Page 981 of the ADIC 601355 Rev A user manual — Functins
Page 981 · click to enlarge
Page 981

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) A value to put in USER_FIELD for Modify Media Class commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Modify Media Class commands. Neither the API software nor VolServ uses USER_FIELD.

VSID_VERSION_NUMBER (VST_VERSION_NUMBER)

The RPC version number of the client process to receive callbacks generated for this MediaClass group. VSID_VERSION_NUMBER is required if VSID_CLASS_RPC_OPTION is set to VSE_CLASS_RPC_ENTERPRISE. Otherwise, VSID_VERSION_NUMBER is not applicable.

Functins

Return Values VSCMD_ModifyMediaClass_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 982 of the ADIC 601355 Rev A user manual — Example
Page 982 · click to enlarge
Page 982
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

********* 2 * 3 * FUNCTION: vst_modmediaclass_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_ModMediaClass API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modmediaclass_defaults(void) 15 #else 16 VST_BOOLEAN

vst_modmediaclass_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Create Archive Media

Class default parameters ***\n” );

Example 1 /****************************************

Page 983 of the ADIC 601355 Rev A user manual — Note
Page 983 · click to enlarge
Page 983

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc =

VSCMD_ModifyMediaClass_SetDefault s( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Functins

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

29 vst_promptforglobals(&priority,

Page 984 of the ADIC 601355 Rev A user manual — See Also
Page 984 · click to enlarge
Page 984

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ModifyMediaClass(l)
Page 985 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 985 · click to enlarge
Page 985

VSCMD_ ModifyPool

VSCMD_ModifyPool modifies the list of drives associated with a drive pool. A client issues a VSCMD_ModifyPool request to modify the list of drives that are included in a drive pool description. The client can add drives to and/or delete drives from the specified drive pool with a single VSCMD_ModifyPool request.

Synopsis VST_BOOLEAN VSCMD_ModifyPool (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Modify Pool request.

Functins

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_DRIVE_ID_LIST (int) The number of drives added to or deleted from the specified drive pool.

Parameters · Parameter Type Description

Page 986 of the ADIC 601355 Rev A user manual — VSID_MODPOOL_OPTION_LIST (VST_POOL_DRIVE_OPTION)
Page 986 · click to enlarge
Page 986

(VST_DRIVE_ID) The identifier of drives added to or deleted from the specified drive pool.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

The name of the drive pool whose list of drives are modified. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_MODPOOL_OPTION_LIST (VST_POOL_DRIVE_OPTION)

A pointer to the list of actions that correspond to the drives identified in the VSID_DRIVE_ID table. An entry in the VSID_MODPOOL_OPTION_LIST indicates whether the corresponding entry in VSID_DRIVE_ID_LIST is added to or deleted from the specified drive pool. Valid VSID_MODPOOL_OPTION values are enumerated in the vs_types.h file.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 987 of the ADIC 601355 Rev A user manual — Functins
Page 987 · click to enlarge
Page 987

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

Functins

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_ModifyPool returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

Parameter Type Description

Page 988 of the ADIC 601355 Rev A user manual — Return Values
Page 988 · click to enlarge
Page 988

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
Page 989 of the ADIC 601355 Rev A user manual — Functins
Page 989 · click to enlarge
Page 989
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_modpool_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_ModifyPool API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Functins

vst_modpool_execute(void) 14 #else 15 VST_BOOLEAN vst_modpool_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_DRIVE_POOL_NAME dp; 20 int count; 21 int i; 22 VST_DRIVE_ID drivelist[VST_MAX_ITEMS]; 23 VST_POOL_DRIVE_OPTION

optionlist[VST_MAX_ITEMS]; 24 VST_COMMAND_HANDLE cmd; 25 26 /* get parameters from user */ 27 printf(“*** Modify Pool Parameters

Example 1 /**************************************** · ***\n” );

Page 990 of the ADIC 601355 Rev A user manual — Example
Page 990 · click to enlarge
Page 990

28 printf(“\nEnter Drive Pool to modify

==>”); 29 gets( dp ); 30 count = vst_getdrivelist(drivelist,

VST_MAX_ITEMS); 31 printf(“\nPlease select the action to

take on each drive\n”); 32 for (i = 0; i < count; i++) 33 { 34 printf(“drive %d: (1) add to pool, (2) delete: “, drivelist[i]); 35 optionlist[i] = (VST_POOL_DRIVE_OPTION) atoi(gets(input)); 36 } 37 38 /* create the command handle */ 39 /* Note that the command handle is

not */ 40 /* destoyed in this routine, but in

*/ 41 /* vst_dispatch when final status is

received. */ 42 cmd = VS_Command_Create(); 43 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 44 { 45 /* Send the command to the VolServ software. */ 46 /* Note that status is not processed here. */ 47 /* Instead, it is processed in the */ 48 /* vst_dispatch routine. Also, note that */ 49 /* default values such as timeout, */ 50 /* value retry limit and priority are set as */ 51 /* default parameters. */ 52 rc = VSCMD_ModifyPool(cmd, 53 VSID_DRIVEPOOL_NAME, dp,

Page 991 of the ADIC 601355 Rev A user manual — Functins
Page 991 · click to enlarge
Page 991

54 VSID_DRIVE_ID_LIST, count, drivelist, 55 VSID_MODPOOL_OPTION_LIST, count, optionlist, 56 VSID_ENDFIELD); 57 } 58 return ( rc ); 59 }

VolServ generates no intermediate status in response to a Modify Pool request.

VSCMD_ModifyPool does not trigger any MediaClass callbacks from VolServ.

Functins

The name specified for a new drive pool must be unique. A request to create a drive pool with a non-unique name fails.

Drive pools can contain zero or more drives.

Drives belonging to a single drive pool can be associated with different archives. Drives are not required to be associated with an archive to belong to a drive pool.

Drive pools can contain drives that support incompatible media types.

If a drive pool is specified on a Mount request and the specified drive pool spans archives, VolServ can select a drive to honor the Mount request that is in a different archive than the medium that is selected to honor the request. If this occurs, a Move-Mount action is required. If permitted, the medium is scheduled for ejection from its parent archive and eventually enters the archive associated with the assigned drive.

Page 992 of the ADIC 601355 Rev A user manual — Notes
Page 992 · click to enlarge
Page 992

Whether or not Move-Mount action processing is permitted is specified at the archive level. The ACTION_MODE and MOVEWAIT_OPTION attributes control whether or not Move-Mount processing is allowed for a specific archive. These attributes are discussed under the VS_Archive_SetFields and VS_Archive_GetFields functions.

The VSID_DRIVE_ID_LIST and VSID_MODPOOL_OPTION_LIST parameters require that two arguments be passed instead of one.

  • The first argument passed is the number of drives to add to or delete from the specified drive pool.
  • The second argument is the list of identifier of the drives to add or delete from the specified drive pool.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Modify Pool request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
Page 993 of the ADIC 601355 Rev A user manual — Functins
Page 993 · click to enlarge
Page 993
  • Command-specific parameter defaults for Modify Pool commands are set with VSCMD_ModifyPool_SetDefaults . If command-specific defaults are set for Modify Pool commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Pool command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Modify Pool request:

Functins

  • VSID_DRIVE_ID ,
  • VSID_DRIVE_ID_ENTRY,
  • VSID_DRIVE_ID_TABLE,
  • VSID_DRIVEPOOL_NAME ,
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .
Page 994 of the ADIC 601355 Rev A user manual — Note
Page 994 · click to enlarge
Page 994

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_CreatePool(l),
  • VSCMD_DeletePool(l),
  • VSCMD_ModifyPool_SetDefaults(l)
Page 995 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_ModifyPool_SetDefaults ( “…”, VSID_ENDFIELD)
Page 995 · click to enlarge
Page 995

VSCMD_ ModifyPool_ SetDefaults

VSCMD_ModifyPool_SetDefaults sets the command-level default parameters for Modify Pool commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Modify Pool commands are set with VSCMD_ModifyPool_SetDefaults . If command-specific defaults are set for Modify Pool commands, they override the global defaults for all commands.

Functins

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Modify Pool command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_ModifyPool_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 996 of the ADIC 601355 Rev A user manual — VSID_MODPOOL_OPTION (VST_POOL_DRIVE_OPTION)
Page 996 · click to enlarge
Page 996
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Modify Pool commands.

VSID_DRIVE_ID_LIST (int) The number of drives to be added to or deleted from the specified drive pool.

(VST_DRIVE_ID *) A pointer to the list of drives to be added to or deleted from the specified drive pool.

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

The name of the drive pool whose list of drives is modified. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_MODPOOL_OPTION_LIST (int) The number of entries in the modify pool option list.

(VST_POOL_DRIVE_OPTION *) A pointer to the list of actions that correspond to the drives identified in the VSID_DRIVE_ID table.

VSID_MODPOOL_OPTION (VST_POOL_DRIVE_OPTION)

An overall option to perform for all drives in VSID_DRIVE_ID_LIST. VSID_MODPOOL_OPTION replaces VSID_MODPOOL_OPTION_LIST when all drives are to be modified in some manner.

Parameters · Parameter Type Description

Page 997 of the ADIC 601355 Rev A user manual — Functins
Page 997 · click to enlarge
Page 997

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Modify Pool commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Modify Pool commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Modify Pool commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Functins

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Modify Pool commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Modify Pool commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 998 of the ADIC 601355 Rev A user manual — Return Values
Page 998 · click to enlarge
Page 998

Return Values VSCMD_ModifyPool_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_modpool_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_ModifyPool API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_modpool_defaults(void) 15 #else 16 VST_BOOLEAN vst_modpool_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE;

Example 1 /****************************************

Page 999 of the ADIC 601355 Rev A user manual — Functins
Page 999 · click to enlarge
Page 999

20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Modify Pool default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_ModifyPool_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Functins

  • The first argument passed is the number of drives to be added to or deleted from the specified drive pool.
Page 1000 of the ADIC 601355 Rev A user manual — Note
Page 1000 · click to enlarge
Page 1000
  • The second argument is the list of identifier of the drives to be added to or deleted from the specified drive pool.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_ModifyPool(l)
Page 1001 of the ADIC 601355 Rev A user manual — Functins
Page 1001 · click to enlarge
Page 1001

VSCMD_ Mount

VSCMD_Mount requests that VolServ mount a medium on a drive.

When issuing a Mount command, the client can specify:

  • A single medium
  • A list of media
  • A MediaClass group
  • and either:

- A specific drive

- A drive pool

- A drive pool with the exclusion of drives

Functins

When a MediaClass group is specified, the client has the option to reclassify the selected medium into a different MediaClass group by specifying the VSID_TARGET_MEDIA_CLASS_NAME parameter. If this option is specified, VolServ reclassifies the selected medium before performing any other action on the medium. Using this option is similar to issuing a Reclassify request for the medium.

The Mount request supports a lock identifier parameter. This parameter is required if the drive to be used in satisfying the Mount request is locked. If a Mount request is issued for a locked drive and does not specify a lock identifier, the Mount request waits until the requested drive is unlocked.

The client also has the option of specifying how to handle a mount that requires an inter-archive movement of the medium. This option indicates whether an inter-archive medium movement should or should not be attempted and whether to consider if the source and destination archives are operator attended or not.

Page 1002 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Mount (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)
Page 1002 · click to enlarge
Page 1002

If more than one medium and/or more than one drive is specified on the Mount request, VolServ applies a selection algorithm to select a medium/drive pair from the lists of media and drives.

For manual archives, a Mount notice is sent to the operator console for action. The operator is then responsible for confirmation to VolServ when the mount is complete. VolServ returns status to the client after the operator action is complete.

A Mount request is queued for later processing if:

  • Specified/selected drive is busy.
  • Specified/selected medium is busy.
  • Specified/selected drive is locked and a Lock identifier was not specified on the Mount request.

When a Mount request is queued for later processing, VolServ returns intermediate status to the client that indicates the reason the Mount request was queued.

Synopsis VST_BOOLEAN VSCMD_Mount (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Mount request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
Page 1003 of the ADIC 601355 Rev A user manual — Functins
Page 1003 · click to enlarge
Page 1003
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_CRITERIA_GROUP_HANDLE (int) The index of a criteria group in the criteria group table to be used in selecting a medium to satisfy the Mount request. The valid range for VSID_CRITERIA_GROUP_HANDLE (int) is 0 to 3, inclusive.

(VST_CRITERIAGROUP_HANDLE) A criteria group in the criteria group table to be used in selecting a medium to satisfy the Mount request. There can be 0 to 4 criteria groups defined for a Mount request.

Functins

VSID_DRIVE_EXCL_LIST (int) The number of drives to exclude from the specified drive pool. VSID_DRIVE_EXCL_LIST is applicable only if the client is requesting a mount by drive pool.

(VST_DRIVE_ID *) The list of drives to exclude from the specified drive pool. VSID_DRIVE_EXCL_LIST is applicable only if the client is requesting a mount by drive pool.

VSID_DRIVE_ID (VST_DRIVE_ID) The identifier of the drive to mount. VSID_DRIVE_ID is applicable only if the client is specifying a specific drive to be mounted.

Parameters · Parameter Type Description

Page 1004 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 1004 · click to enlarge
Page 1004

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

The name of the drive pool where a drive is selected to satisfy the Mount request. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted. VSID_DRIVEPOOL_NAME is applicable only if the client is requesting a mount by drive pool.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_LOCK_ID (VST_LOCK_ID) The lock identifier associated with a locked drive that is specified or selected to honor the Mount request. A lock identifier is assigned to a drive with a VSCMD_Lock request.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The name of the MediaClass group where a medium is selected to honor the Mount request. VSID_MEDIA_CLASS_NAME is applicable only if the client is specifying a mount by MediaClass group.

VSID_MEDIA_ID (VST_MEDIA_ID) The identifier of the medium to be mounted. VSID_MEDIA_ID is applicable only if the client is specifying a mount of a specific medium.

VSID_MEDIA_ID_LIST (int) The number of media in the list of media where the medium to honor the Mount request is selected. VSID_MEDIA_ID_LIST (int) is applicable only if the client is specifying a mount from a media identifier list.

(char **) The list of media where the medium to honor the Mount request is selected. VSID_MEDIA_ID_LIST (int) is applicable only if the client is specifying a mount from a media identifier list.

Parameter Type Description

Page 1005 of the ADIC 601355 Rev A user manual — Functins
Page 1005 · click to enlarge
Page 1005

VSID_MOUNT_HANDLE (VST_MOUNT_HANDLE)

A handle that contains Mount command parameters. A client can set mount parameters in a mount handle with the VS_Mount_SetFields function. A mount handle can be passed in a Mount request instead of specifying the mount parameters on the Mount request itself.

VSID_MOUNT_OPTION (VST_MOUNT_OPTION)

A flag that indicates which mount processing options are in effect for the Mount command. Valid VSID_MOUNT_OPTION values are listed in the vs_defs.h file.

VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)

Indicates whether a Mount request should wait or fail if an inter-archive medium movement is required to complete the Mount request and either the source or target archive is unattended. Valid VSID_MOVEWAIT_OPTION values are enumerated in the vs_types.h file.

Functins

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 1006 of the ADIC 601355 Rev A user manual — VSID_TARGET_MEDIA_CLASS_NAME (VST_TARGET_MEDIA_CLASS _NAME)
Page 1006 · click to enlarge
Page 1006

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_MEDIA_CLASS_NAME (VST_TARGET_MEDIA_CLASS _NAME)

The name of the MediaClass group where the mounted medium is reclassified if the reclassify option is in effect for the Mount request.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Mount returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

Parameter Type Description

Page 1007 of the ADIC 601355 Rev A user manual — Functins
Page 1007 · click to enlarge
Page 1007

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.

Functins

  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
Page 1008 of the ADIC 601355 Rev A user manual — Example
Page 1008 · click to enlarge
Page 1008
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_mount_pool_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Mount API call for drive 7 * pools. 8 * 9 * PARAMETERS: 10 * none 11 * 12 * 13 **************************************** *********/ 14 #ifdef ANSI_C 15 VST_BOOLEAN

vst_mount_pool_execute(void) 16 #else 17 VST_BOOLEAN vst_mount_pool_execute() 18 #endif 19 { 20 VST_BOOLEAN rc = VSE_FALSE; 21 int i; 22 int entry; 23 VST_DRIVE_POOL_NAME drivepool; 24 VST_DRIVE_ID excllist[VST_MAX_ITEMS]; 25 int exclcount; 26 VST_MEDIA_ID mediaid;

Example 1 /****************************************

Page 1009 of the ADIC 601355 Rev A user manual — Functins
Page 1009 · click to enlarge
Page 1009

27 VST_LOCK_ID lockid; 28 VST_CRITERIAGROUP_HANDLE grouph; 29 VST_COMMAND_HANDLE cmdh; 30 31 /* get parameters from user */ 32 printf ( “Enter Drive Pool for mount

==> “ ); 33 gets(drivepool); 34 printf(“\n*** Exclusion List

***\n”); 35 exclcount =

vst_getdrivelist(excllist, VST_MAX_ITEMS); 36 printf ( “Enter Media ID for mounting

==> “ ); 37 gets(mediaid); 38 printf ( “Mount by criteria (1) yes

or (2) no ==> “ ); 39 entry = atoi(gets(input)); 40 if ( entry == 1 ) 41 { 42 printf ( “Enter number of criteria groups ==> “ ); 43 entry = atoi(gets(input)); 44 for ( i = 0 ; i < entry ; i++ ) 45 { 46 grouph = vst_create_mount_criteria(); 47 if ( grouph != (VST_CRITERIAGROUP_HANDLE) NULL ) 48 { 49 /* It is easiest to set criteria */ 50 /* groups in the default function as */ 51 /* done here. This is particularly */ 52 /* true if it is desired to use more */ 53 /* than one criteria group. */ 54 VSCMD_Mount_SetDefaults (

Functins

Page 1010 of the ADIC 601355 Rev A user manual — Example
Page 1010 · click to enlarge
Page 1010

55 VSID_CRITERIA_GROUP_HANDLE, i, grouph, 56 VSID_ENDFIELD ); 57 } 58 } 59 } 60 printf(“Enter lock id ==> “); 61 lockid = atol(gets(input)); 62 63 /* create the command (assume that

the api is */ 64 /* initialized) */ 65 cmdh = VS_Command_Create(); 66 if ( cmdh != (VST_COMMAND_HANDLE)

NULL) 67 { 68 /* execute the mount command. */ 69 /* if sync, we will wait for the mount to */ 70 /* complete if async, we will leave once */ 71 /* initial status has been returned */ 72 rc = VSCMD_Mount ( cmdh, 73 VSID_DRIVEPOOL_NAME, drivepool, 74 VSID_DRIVE_EXCL_LIST, exclcount, excllist, 75 VSID_MEDIA_ID, mediaid, 76 VSID_LOCK_ID, lockid, 77 VSID_ENDFIELD ); 78 } 79 else 80 { 81 rc = VSE_FALSE; 82 } 83 return ( rc ); 84 }

Page 1011 of the ADIC 601355 Rev A user manual — Functins
Page 1011 · click to enlarge
Page 1011

VolServ generates no intermediate status in response to a Mount request.

VSCMD_Mount does not trigger any MediaClass callbacks from VolServ.

Depending on the number of available drives and pending Mount requests, a specific Mount request can take a relatively long time to satisfy.

A drive that is specified in a Mount request may not be the ideal drive on which to mount the specified medium. It may take considerably longer to mount the medium onto the drive than if a drive pool had been specified.

Functins

The VSID_MOVEWAIT_OPTION option has no affect on a Mount request for a medium and drive associated with the same archive.

If the specified drive is locked, the appropriate lock identifier must be supplied if that drive is considered in the selection process.

If a specified or selected drive is locked and the Mount request does not specify a lock identifier, VolServ returns an intermediate status message with a “drive locked” indication. VolServ then waits for the drive to become unlocked to continue execution of the command.

If the Mount request specifies a MediaClass group or a list of media and the reclassify option is selected, the reclassify to a different MediaClass group occurs after a specific medium is selected to satisfy the Mount request. Only the selected medium is reclassified.

Page 1012 of the ADIC 601355 Rev A user manual — Notes
Page 1012 · click to enlarge
Page 1012

If the reclassify option is selected, the receiving MediaClass group is checked for compatible media type as well as having adequate capacity for another medium (i.e., fill level less than capacity). If either condition is not satisfied, the Mount request fails.

A pending Mount request (awaiting drive or medium) can be cancelled.

If no drive specified on a Mount request is on-line, the Mount request fails.

If a medium and/or drive is specified and either the medium or drive (or both) are presently in-use, the Mount request waits for resources and returns intermediate status indicating the reason for the delay.

When specifying a drive pool that contains drives that support different types of media, only those drives that support the media type of the media specified in the Mount request are considered for selection.

If a list of media specified in a Mount request contains media of more than one type, the request fails.

When a medium/drive pairing requires the medium be moved within a single archive system (such as cross-aisle or inter-manipulator unit) the mount may take a while to complete. The VSID_MOVEWAIT_OPTION setting does NOT apply to intra-archive system movement.

When a Mount request with groups of media and/or drives is submitted, VolServ attempts to select a drive/medium pair where the drive and medium are associated with the same archive. If there are multiple drive/medium pair candidates, VolServ selects a drive/medium pair from the archive with a free drive if, possible.

Page 1013 of the ADIC 601355 Rev A user manual — Functins
Page 1013 · click to enlarge
Page 1013

If there is no drive/medium pair associated with the same archive, VolServ then selects a drive/medium pair where the drive and medium are associated with different archives. If there are multiple drive/medium pair candidates, VolServ selects a drive/medium pair from the archive with a free drive, if possible. If all archives contain the same number of drives with no drives available, VolServ then selects a drive/medium pair from the archive with the largest number of media.

When specifying a mount by MediaClass group associated across more than one archive, no inter-archive medium/drive pairing is permitted. The medium selected from the MediaClass group must be in the same archive as the selected drive; otherwise the Mount request fails.

When a medium is ejected (as a result an Export or Checkout request), no check is made to determine if a Mount request exists in the queue for the ejected medium. As a result, the Mount request remains queued until a drive is freed. At that time, the Mount request fails because the medium is not available. In other words, the request queue is not checked for impact on pending requests each time a resource changes its availability and after a medium/drive pair is identified. VolServ does not attempt re-pairing based on changed availability of resources.

Functins

A queued Mount request (awaiting drive or medium) can be cancelled.

The VSID_CRITERIA_GROUP_HANDLE parameter require that two arguments be passed instead of one.

  • The first argument passed is the number of criteria groups handles to be used in selecting the medium to be mounted.
  • The second argument is the list of criteria group handles to be used in selecting the medium to be mounted.
Page 1014 of the ADIC 601355 Rev A user manual — Notes
Page 1014 · click to enlarge
Page 1014

The VSID_DRIVE_EXCL_LIST parameter require that two arguments be passed instead of one.

  • The first argument passed is the number of drives to be excluded from the specified drive pool.
  • The second argument is the list of the identifier of the drives to be excluded from the specified drive pool.

The VSID_MEDIA_ID_LIST parameter requires that two arguments be passed instead of one.

  • The first argument passed is the number of media specified where the medium to honor the Mount request is selected.
  • The second argument is the list of media where the medium to honor the Mount request is selected.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Mount request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
Page 1015 of the ADIC 601355 Rev A user manual — Functins
Page 1015 · click to enlarge
Page 1015
  • Command-specific parameter defaults for Mount commands are set with VSCMD_Mount_SetDefaults . If command-specific defaults are set for Mount commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Mount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Mount request:

  • VSID_DRIVE_ID ,

Functins

  • VSID_DRIVE_ID_ENTRY ,
  • VSID_DRIVE_ID_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD ,
  • VSID_WAIT_REASON .
Page 1016 of the ADIC 601355 Rev A user manual — Note
Page 1016 · click to enlarge
Page 1016

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Mount_Create(l),
  • VS_Mount_Destroy(l)
  • VS_Mount_GetFields(l),
  • VS_Mount_SetFields(l),
  • VS_Status_GetFields(l),
  • VSCMD_Mount_SetDefaults(l)
Page 1017 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Mount_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1017 · click to enlarge
Page 1017

VSCMD_ Mount_Set Defaults

VSCMD_Mount_SetDefaults sets the command-level default parameters for Mount commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Mount commands are set with VSCMD_Mount_SetDefaults . If command-specific defaults are set for Mount commands, they override the global defaults for all commands.

Tip

Functins

To override a default (global or command-specific) parameter value for a specific instance of a Mount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Mount_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 1018 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 1018 · click to enlarge
Page 1018
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Mount commands.

VSID_CRITERIA_GROUP_HANDLE (int) The index of a criteria group in the criteria group table to use in selecting a medium to satisfy the Mount request. The valid range for VSID_CRITERIA_GROUP_HANDLE (int) is 0 to 3, inclusive.

(VST_CRITERIAGROUP_HANDLE) A criteria group in the criteria group table to use in selecting a medium to satisfy the Mount request. There can be 0 to 4 criteria groups defined for a Mount request.

VSID_DRIVE_EXCL_LIST (int) The number of drives to exclude from the specified drive pool. VSID_DRIVE_EXCL_LIST is applicable only if the client is requesting a Mount by drive pool.

(VST_DRIVE_ID *) The list of drives to exclude from the specified drive pool. VSID_DRIVE_EXCL_LIST is applicable only if the client is requesting a Mount by drive pool.

VSID_DRIVE_ID (VST_DRIVE_ID) The identifier of the drive to mount. VSID_DRIVE_ID is applicable only if the client specifies a specific drive to be mounted.

Parameters · Parameter Type Description

Page 1019 of the ADIC 601355 Rev A user manual — Functins
Page 1019 · click to enlarge
Page 1019

VSID_DRIVEPOOL_NAME (VST_DRIVE_POOL_NAME)

The name of the drive pool where a drive is selected to satisfy the Mount request. Valid drive pool names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted. VSID_DRIVEPOOL_NAME is applicable only if the client is requesting a mount by drive pool.

(VST_ENTERPRISE_ID) The identifier of the enterprise, if any, to receive intermediate and final status on Mount commands.

VSID_LOCK_ID (VST_LOCK_ID) The lock identifier associated with a locked drive that is specified or selected to honor the Mount request. A lock identifier is assigned to a drive with a VSCMD_Lock request.

Functins

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The name of the MediaClass group where a medium is selected to honor the Mount request. VSID_MEDIA_CLASS_NAME is applicable only if the client is specifying a mount by MediaClass group.

VSID_MEDIA_ID (VST_MEDIA_ID) The identifier of the medium to be mounted. VSID_MEDIA_ID is applicable only if the client is specifying a mount of a specific medium.

VSID_MEDIA_ID_LIST (int) The number of media in the list of media where the medium to honor the Mount request is selected. VSID_MEDIA_ID_LIST is applicable only if the client is specifying a mount from a media identifier list.

(char **) The list of media where the medium to honor the Mount request is selected. VSID_MEDIA_ID_LIST is applicable only if the client is specifying a mount from a media identifier list.

Parameter Type Description

Page 1020 of the ADIC 601355 Rev A user manual — VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)
Page 1020 · click to enlarge
Page 1020

VSID_MOUNT_HANDLE (VST_MOUNT_HANDLE)

A handle that contains Mount command parameters. A client can set mount parameters in a mount handle with the VS_Mount_SetFields function. A mount handle can be passed in a Mount request instead of specifying the mount parameters on the Mount request itself.

VSID_MOUNT_OPTION (VST_MOUNT_OPTION)

A flag that indicates which mount processing options are in effect for the Mount command. Valid VSID_MOUNT_OPTION values are listed in the vs_defs.h file.

VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)

Indicates whether a Mount request should wait or fail if an inter-archive medium movement is required to complete the Mount request and either the source or target archive is unattended. Valid VSID_MOVEWAIT_OPTION values are enumerated in the vs_types.h file.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Mount commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Mount commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameter Type Description

Page 1021 of the ADIC 601355 Rev A user manual — Functins
Page 1021 · click to enlarge
Page 1021

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Mount commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_MEDIA_CLASS_NAME (VST_TARGET_MEDIA_CLASS_NAME)

The name of the MediaClass group where the mounted medium is reclassified if the reclassify option is active for the Mount request.

Functins

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Mount commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Mount commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Mount_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.

Parameter Type Description

Page 1022 of the ADIC 601355 Rev A user manual — Example
Page 1022 · click to enlarge
Page 1022
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_mount_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Mount API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_mount_defaults(void) 15 #else 16 VST_BOOLEAN vst_mount_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Modify Pool default

Example 1 /**************************************** · parameters ***\n” );

Page 1023 of the ADIC 601355 Rev A user manual — Functins
Page 1023 · click to enlarge
Page 1023

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Mount_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Functins

  • The first argument passed is the number of criteria groups handles to use in selecting the medium to mount.
  • The second argument is the list of criteria group handles to use in selecting the medium to mount.

The VSID_DRIVE_EXCL_LIST parameter require that two arguments be passed instead of one.

  • The first argument passed is the number of drives to exclude from the specified drive pool.
  • The second argument is the list of the identifier of the drives to exclude from the specified drive pool.

The VSID_MEDIA_ID_LIST parameter require that two arguments be passed instead of one.

29 vst_promptforglobals(&priority,

Page 1024 of the ADIC 601355 Rev A user manual — Note
Page 1024 · click to enlarge
Page 1024
  • The first argument passed is the number of media specified where the medium to honor the Mount request is selected.
  • The second argument is the list of media where the medium to honor the Mount request is selected.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_CriteriaGroup_Create(l),
  • VS_CriteriaGroup_Destroy(l),
  • VS_CriteriaGroup_SetFields(l),
  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VS_Mount_Create(l),
  • VS_Mount_Destroy(l),
  • VS_Mount_SetFields(l),
  • VSCMD_Mount(l)
Page 1025 of the ADIC 601355 Rev A user manual — Functins
Page 1025 · click to enlarge
Page 1025

VSCMD_Move VSCMD_Move directs the movement of media from one archive to another. Inter-archive media movement requires operator intervention. An operator must eject media from their home archives and enter them into the specified target archive. The eject and enter functionalities are available from the appropriate archive's console display. The eject and enter functionalities are not available from the API.

Upon receipt of a Move request, VolServ verifies the specified media exist, the target archive supports the media type name of the specified media, and there exists an appropriate archive media class with the target archive. Only one target archive can be specified on a move request. The current archive of each specified medium is commanded to eject the medium. An Eject request, specifying the target archive, is displayed on the archive console of each source archive. The operator selects and manually ejects/removes the media on each eject list. After a medium is ejected from its home archive, the target archive displays a corresponding Enter request for that medium. The operator then manually enters the medium on the Enter list into the target archive.

Functins

When the VSID_MOVE_OPTION parameter is set to VSE_MOVE_WAIT, VolServ waits until processing of the Move command completes before returning status to the client. The client must monitor the media movement in some other manner (e.g., MediaClass callbacks) to know when the media are ejected from the home archives and entered into the target archive.

When the VSID_MOVE_OPTION parameter is set to VSE_MOVE_NOWAIT, VolServ returns a status code to the client after the specified media are placed on the ejection candidate list of the home archives.

Page 1026 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 1026 · click to enlarge
Page 1026

When media are ejected from the home archive and entered into the target archive, VolServ generates MediaClass callbacks, if any of the moved media are associated with MediaClass groups that are configured to generate callbacks from VolServ.

The Move command can be used to place homeless media into an archive. A homeless medium is an intransit medium that has no pending movement activity.

Synopsis VST_BOOLEAN VSCMD_Move (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Move request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status for this request.

Parameters · Parameter Type Description

Page 1027 of the ADIC 601355 Rev A user manual — Functins
Page 1027 · click to enlarge
Page 1027

VSID_MEDIA_ID_LIST (int) The number of media to move to the target archive.

(char **) A list of the identifiers of the media to move to the target archive.

VSID_MOVE_OPTION (VST_MOVE_OPTION)

Indicates whether VolServ returns final status to the client as soon as the Move command begins execution or after the Move command completes execution. Valid VSID_MOVE_OPTION values are enumerated in the vs_types.h file.

VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)

Indicates whether a Move request waits or fails if either the source archive or target archive is unattended. The only valid VSID_MOVEWAIT_OPTION value is VSE_MOVEWAIT_ATTENDED. The other VSID_MOVEWAIT_OPTION values enumerated in the vs_types.h file have no effect on VSCMD_Move.

Functins

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 1028 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 1028 · click to enlarge
Page 1028

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The name of the archive where the specified media are to be moved. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Move returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

Parameter Type Description

Page 1029 of the ADIC 601355 Rev A user manual — Functins
Page 1029 · click to enlarge
Page 1029

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.

Functins

  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
Page 1030 of the ADIC 601355 Rev A user manual — Example
Page 1030 · click to enlarge
Page 1030
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_move_execute 4 * 5 * PURPOSE: 6 * This function sends a move command to the VolServ. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_move_execute( void ) 14 #else 15 VST_BOOLEAN vst_move_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_BOOLEAN done = VSE_FALSE; 20 int attended; 21 int wait; 22 int count; 23 char * medialist[VST_MAX_ITEMS]; 24 VST_ARCHIVE_NAME archive; 25 VST_COMMAND_HANDLE cmd; 26 27 /* get parameters from user */

Example 1 /****************************************

Page 1031 of the ADIC 601355 Rev A user manual — Functins
Page 1031 · click to enlarge
Page 1031

28 printf(“*** Move parameters ***\n” ); 29 printf(“\nEnter Archive: “); 30 gets( archive); 31 32 /* If the next prompt is answered

yes, the move */ 33 /* will fail unless both archives are

attended. */ 34 printf(“\nMove only with Attended

Archives (0) no, (1) yes“); 35 attended = atoi(gets(input)); 36 37 /* The wait parameter will cause the

move to */ 38 /* not return final status until the

physical */ 39 /* move is complete, or return

immediately. */ 40 printf(“\nWait for status until Move

Functins

complete (0) no, (1) yes“ ); 41 wait = atoi(gets(input)); 42 count = vst_getmedialist(medialist,

VST_MAX_ITEMS); 43 44 /* create the command handle */ 45 /* Note that the command handle is

not */ 46 /* destoyed in this routine, but in

*/ 47 /* vst_dispatch when final status is

received.*/ 48 cmd = VS_Command_Create(); 49 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 50 { 51 /* Send the command to the VolServ software. */ 52 /* Note that status is not processed here. */ 53 /* Instead, it is processed in the */

Page 1032 of the ADIC 601355 Rev A user manual — Notes
Page 1032 · click to enlarge
Page 1032

54 /* vst_dispatch routine. Also, note that */ 55 /* default values such as timeout, */ 56 /* value retry limit and priority are set as */ 57 /* default parameters. */ 58 rc = VSCMD_Move(cmd, 59 VSID_TARGET_ARCHIVE_NAME, archive, 60 VSID_MEDIA_ID_LIST, count, medialist, 61 VSID_MOVEWAIT_OPTION, (attended == 1 ? VSE_MOVEWAIT_ATTENDED : VSE_MOVEWAIT_YES ), 62 VSID_MOVE_OPTION, (wait == 1 ? VSE_MOVE_WAIT : VSE_MOVE_NOWAIT ), 63 VSID_ENDFIELD); 64 } 65 return ( rc ); 66 }

VolServ generates no intermediate status in response to a Move request.

VSCMD_Move triggers MediaClass callbacks from VolServ.

Operator intervention is required for inter-archive media movement.

A medium that is allocated to a Move request is not available for another allocation until the Move completes.

VSCMD_Move requests movement of media between archives, not within a single archive.

Page 1033 of the ADIC 601355 Rev A user manual — Functins
Page 1033 · click to enlarge
Page 1033

If the VSID_MOVE_OPTION is specified as VSE_MOVE_NOWAIT, the status returned to the client indicates only the initial validity of the Move request. Actual completion of the move can be traced only via MediaClass callback processing, media querying, or operator monitoring.

The VSID_MEDIA_ID_LIST parameter requires that two arguments be passed instead of one.

  • The first argument passed is the number of media to move.
  • The second argument is the list of identifiers of the media to move.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

Functins

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Move request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
Page 1034 of the ADIC 601355 Rev A user manual — Note
Page 1034 · click to enlarge
Page 1034
  • Command-specific parameter defaults for Move commands are set with VSCMD_Move_SetDefaults . If command-specific defaults are set for Move commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Move command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Move request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 1035 of the ADIC 601355 Rev A user manual — Functins
Page 1035 · click to enlarge
Page 1035

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VSCMD_Move_SetDefaults(1),
  • VS_Status_GetFields(l)

Functins

Page 1036 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Move_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1036 · click to enlarge
Page 1036

VSCMD_Move _SetDefaults

VSCMD_Move_SetDefaults sets the command-level default parameters for Move commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Move commands are set with VSCMD_Move_SetDefaults . If command-specific defaults are set for Move commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Move command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Move_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 1037 of the ADIC 601355 Rev A user manual — VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)
Page 1037 · click to enlarge
Page 1037
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Move commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Move commands.

VSID_MEDIA_ID_LIST (int) The number of media to move to the target archive.

(char **) A list of the identifiers of the media to move to the target archive.

Functins

VSID_MOVE_OPTION (VST_MOVE_OPTION)

Indicates whether VolServ returns final status to the client as soon as the Move command begins execution or after the Move command completes execution. Valid VSID_MOVE_OPTION values are enumerated in the vs_types.h file.

VSID_MOVEWAIT_OPTION (VST_MOVEWAIT_OPTION)

Indicates whether a Move request waits or fails if either the source or target archive is unattended. The only valid VSID_MOVEWAIT_OPTION value is VSE_MOVEWAIT_ATTENDED. The other VSID_MOVEWAIT_OPTION values enumerated in the vs_types.h file have no effect on VSCMD_Move.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Move commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 1038 of the ADIC 601355 Rev A user manual — VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)
Page 1038 · click to enlarge
Page 1038

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Move commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Move commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TARGET_ARCHIVE_NAME (VST_ARCHIVE_NAME)

The name of the archive where the specified media are moved. Valid archive names may contain up to 16 alphanumeric characters, including spaces. Leading and trailing spaces are not permitted.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Move commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Move commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 1039 of the ADIC 601355 Rev A user manual — Functins
Page 1039 · click to enlarge
Page 1039

Return Values VSCMD_Move_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

Functins

********* 2 * 3 * FUNCTION: vst_move_defaults 4 * 5 * PURPOSE: 6 * This function sets default parameters for the move 7 * command. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN vst_move_defaults(void) 15 #else 16 VST_BOOLEAN vst_move_defaults() 17 #endif 18 { 19 VST_PRIORITY priority; 20 VST_USER_FIELD user_field; 21 VST_TIME_OUT timeout;

Example 1 /****************************************

Page 1040 of the ADIC 601355 Rev A user manual — Note
Page 1040 · click to enlarge
Page 1040

22 VST_RETRY_LIMIT retries; 23 VST_STATUS_WAIT_FLAG wait_flag; 24 VST_ENTERPRISE_ID

enterprise_id; 25 VST_BOOLEAN rc; 26 27 /* get parameters from user */ 28 printf(“*** Move defaults ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 rc = VSCMD_Move_SetDefaults

( VSID_PRIORITY, priority, 31 VSID_USER_FIELD, user_field, 32 VSID_TIMEOUT_VALUE, timeout, 33 VSID_RETRY_LIMIT, retries, 34 VSID_STATUS_WAIT_FLAG, wait_flag, 35 VSID_ENTERPRISE_ID, enterprise_id, 36 VSID_ENDFIELD); 37 return(rc); 38 }

  • The first argument passed is the number of media to move.
  • The second argument is the list of identifiers of the media to move.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 1041 of the ADIC 601355 Rev A user manual — Functins
Page 1041 · click to enlarge
Page 1041

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Move(l)

Functins

Page 1042 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 1042 · click to enlarge
Page 1042

VSCMD_Multi Mount

VSCMD_MultiMount mounts one or more media with a single command. Up to eight mount requests can be specified on a MultiMount command. The media specified on a MultiMount command are mounted atomically.

Synopsis VST_BOOLEAN VSCMD_MultiMount (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

ARGUMENTS • handle = The command handle for the MultiMount request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

Parameters · Parameter Type Description

Page 1043 of the ADIC 601355 Rev A user manual — Functins
Page 1043 · click to enlarge
Page 1043

VSID_MOUNT_HANDLE (int) The index of this mount handle in a mount handle table. The index of the first mount handle for a MultiMount request should be 0. Enter one VSID_MOUNT_HANDLE (int, VST_MOUNT_HANDLE) parameter pair for each medium to be mounted with this MultiMount request. Up to eight VSID_MOUNT_HANDLE parameter pairs may be specified on a single MultiMount command.

(VST_MOUNT_HANDLE) The mount handle for this individual mount request. Enter one VSID_MOUNT_HANDLE (int, VST_MOUNT_HANDLE) parameter pair for each medium to be mounted with this MultiMount request. Up to eight VSID_MOUNT_HANDLE parameter pairs may be specified on a single MultiMount command.

Functins

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameter Type Description

Page 1044 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 1044 · click to enlarge
Page 1044

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_MultiMount returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

Parameter Type Description

Page 1045 of the ADIC 601355 Rev A user manual — Functins
Page 1045 · click to enlarge
Page 1045

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

Functins

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
Page 1046 of the ADIC 601355 Rev A user manual — Example
Page 1046 · click to enlarge
Page 1046
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_multimount_execute 4 * 5 * PURPOSE: 6 * This function will test the VSCMD_Multimount call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_multimount_execute(void) 14 #else 15 VST_BOOLEAN vst_multimount_execute() 16 #endif 17 { 18 int i; 19 int num; 20 VST_BOOLEAN rc = VSE_FALSE; 21 VST_COMMAND_HANDLE cmdh; 22 VST_MOUNT_HANDLE

mounth[VSD_MAX_MOUNT_REQS]; 23 24 /* get parameters from user */ 25 printf(“*** MultiMount Parameters

***\n”); 26 printf(“Enter the number of mount

requests ==> “ ); 27 num = atoi(gets(input)); 28

Example 1 /****************************************

Page 1047 of the ADIC 601355 Rev A user manual — Functins
Page 1047 · click to enlarge
Page 1047

29 /* loop through the number of mount

request */ 30 for ( i = 0 ; i < num ; i++ ) 31 { 32 /* Create a mount handle. */ 33 /* Each mount handle stores a single mount */ 34 /* request. The MultiMount command accepts */ 35 /* multiple mount requests andexecutes them */ 36 /* all as one operation. */ 37 mounth[i] = vst_create_mount_handle(); 38 if ( mounth[i] != (VST_MOUNT_HANDLE) NULL ) 39 { 40 /* add the mount request to the t */ 41 /* multimount via the command */ 42 /* default function */ 43 VSCMD_MultiMount_SetDefaults ( 44 VSID_MOUNT_HANDLE, i, mounth[i], 45 VSID_ENDFIELD ); 46 } 47 else 48 { 49 rc = VSE_FALSE; 50 break; 51 } 52 } 53 54 if ( rc ) 55 { 56 cmdh = VS_Command_Create(); 57 if (cmdh != (VST_COMMAND_HANDLE)

Functins

NULL) 58 { 59 /* execute the multimount command, note */

Page 1048 of the ADIC 601355 Rev A user manual — Notes
Page 1048 · click to enlarge
Page 1048

60 /* that all parameters have been set */ 61 /* via default functions if sync, we will */ 62 /* wait for all mounts to complete if */ 63 /* async, we will leave once initial */ 64 /* status has been returned */ 65 rc = VSCMD_MultiMount ( cmdh, 66 VSID_ENDFIELD ); 67 } 68 else 69 { 70 rc = VSE_FALSE; 71 } 72 } 73 74 /* destroy the mount handles that

contain the */ 75 /* individual mount requests. */ 76 for ( i = 0 ; i < num ; i++ ) 77 { 78 VS_Mount_Destroy ( mounth[i] ); 79 } 80 return ( rc ); 81 }

VolServ can generates intermediate status in response to a MultiMount request for the following situations.

  • A drive is reserved for an individual Mount request.
  • A medium is mounted for an individual Mount request.
  • An individual Mount request is waiting on a locked drive.
Page 1049 of the ADIC 601355 Rev A user manual — Functins
Page 1049 · click to enlarge
Page 1049
  • An individual Mount request is waiting on a busy drive.
  • An individual Mount request is waiting on a busy media.

Thus, for a successful MultiMount command with two Mount requests, the client can expect at least four intermediate statuses (two for the reserve of drives and two for the mount notification).

VSCMD_MultiMount triggers MediaClass callbacks from VolServ.

The VSID_MOUNT_HANDLE parameter require that two Arguments be passed instead of one.

  • The first argument passed is the index of the entry in the Mount handle table.
  • The second argument is the mount handle to be stored in the Mount handle table. The Mount handle table is created and used internally by the API software and is not visible to the client.

Functins

The MultiMount command does not restrict the Mount request in its use of mount parameters. All mount parameters are valid for each individual Mount request.

A MultiMount request is an “all-or-nothing” request. If an entire MultiMount request cannot be satisfied because of resource conflicts or limitations, the entire command fails.

Partial mounts can be done if one of the last Mount commands fails and the previous Mount commands have already completed. MultiMount does not dismount completed mounts if one mount fails while another succeeds.

A MultiMount command reserves resources to ensure deadlock avoidance. After all individual mounts are issued, the resources are freed.

Page 1050 of the ADIC 601355 Rev A user manual — Notes
Page 1050 · click to enlarge
Page 1050

A MultiMount command should not be used to batch multiple non-related Mount requests into a single command. The overhead of checking for resource contention, the presence of deadlock, and reserving drives is significant. It is recommended that individual Mount requests be issued for unrelated Mount requests.

Only one MultiMount request is processed at a time. If a MultiMount request is received by VolServ and there is already an active MultiMount request, the new request is queued until the active command completes reserving resources.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a MultiMount request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for MultiMount commands are set with VSCMD_MultiMount_SetDefaults . If
Page 1051 of the ADIC 601355 Rev A user manual — Functins
Page 1051 · click to enlarge
Page 1051

command-specific defaults are set for MultiMount commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a MultiMount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful MultiMount request:

  • VSID_DRIVE_ID ,
  • VSID_DRIVE_ID_ENTRY ,

Functins

  • VSID_DRIVE_ID_TABLE ,
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_FIELD ,
  • VSID_MEDIA_ID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD ,
  • VSID_WAIT_REASON .
Page 1052 of the ADIC 601355 Rev A user manual — Note
Page 1052 · click to enlarge
Page 1052

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VSID_Mount_Create(l),
  • VS_Mount_SetFields(l),
  • VS_Status_GetFields(l),
  • VSCMD_MultiMount_SetDefaults(l)
Page 1053 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_MultiMount_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1053 · click to enlarge
Page 1053

VSCMD_ MultiMount_ SetDefaults

VSCMD_MultiMount_SetDefaults sets the command-level default parameters for MultiMount commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for MultiMount commands are set with VSCMD_MultiMount_SetDefaults . If command-specific defaults are set for MultiMount commands, they override the global defaults for all commands.

Functins

Tip

To override a default (global or command-specific) parameter value for a specific instance of a MultiMount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_MultiMount_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 1054 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 1054 · click to enlarge
Page 1054
  • VSID_ENDFIELD = Re quired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on MultiMount commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on MultiMount commands.

VSID_MOUNT_HANDLE (int) The index of this mount handle in a mount handle table. The index of the first mount handle for a MultiMount request should be 0. Enter one VSID_MOUNT_HANDLE (int, VST_MOUNT_HANDLE) parameter pair for each medium to be mounted with a MultiMount request. Up to eight VSID_MOUNT_HANDLE parameter pairs may be specified on a single MultiMount command.

(VST_MOUNT_HANDLE) The mount handle for this individual Mount request. Enter one VSID_MOUNT_HANDLE (int, VST_MOUNT_HANDLE) parameter pair for each medium to be mounted with a MultiMount request. Up to eight VSID_MOUNT_HANDLE parameter pairs may be specified on a single MultiMount command.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for MultiMount commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 1055 of the ADIC 601355 Rev A user manual — Functins
Page 1055 · click to enlarge
Page 1055

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for MultiMount commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for MultiMount commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Functins

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for MultiMount commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for MultiMount commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 1056 of the ADIC 601355 Rev A user manual — Return Values
Page 1056 · click to enlarge
Page 1056

Return Values VSCMD_MultiMount_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_multimount_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Multimount API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_multimount_defaults(void) 15 #else 16 VST_BOOLEAN

vst_multimount_defaults() 17 #endif 18 {

Example 1 /****************************************

Page 1057 of the ADIC 601355 Rev A user manual — Functins
Page 1057 · click to enlarge
Page 1057

19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Multimount default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_MultiMount_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 40 return ( rc ); 41 }

Functins

  • The first argument passed is the index of the entry in the mount handle table.
Page 1058 of the ADIC 601355 Rev A user manual — Note
Page 1058 · click to enlarge
Page 1058
  • The second argument is the mount handle to be stored in the mount handle table. The mount handle table is created and used internally by the API software and is not visible to the client.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_MultiMount(l)
Page 1059 of the ADIC 601355 Rev A user manual — Functins
Page 1059 · click to enlarge
Page 1059

VSCMD_Ping VSCMD_Ping checks the availability of VolServ. If VolServ responds to a VSCMD_Ping request, it can be assumed by the client that the VolServ is available and functioning.

The client is not required to issue a VSCMD_Ping request before sending other requests to the VolServ system.

Upon receiving a VSCMD_Ping request, VolServ immediately returns a VolServ process identifier number. No other processing is executed for a VSCMD_Ping command.

Synopsis VST_BOOLEAN VSCMD_Ping (VST_COMMAND_HANDLE handle)

Functins

Arguments • handle = The command handle for this Ping request.

Return Values VSCMD_Ping returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

Page 1060 of the ADIC 601355 Rev A user manual — Example
Page 1060 · click to enlarge
Page 1060

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_ping 4 * 5 * PURPOSE: 6 * This function tests the VSCMD_Ping API call. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 1061 of the ADIC 601355 Rev A user manual — Functins
Page 1061 · click to enlarge
Page 1061

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_ping( void ) 14 #else 15 VST_BOOLEAN vst_ping() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_COMMAND_HANDLE cmd; 20 21 printf(“*** Pinging VolServ ***\n” ); 22 23 /* create the command handle */ 24 cmd = VS_Command_Create(); 25 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 26 { 27 /* Send the command to the VolServ software. */ 28 /* This will try to “ping” the VolServ */ 29 /* software at the host name and program */ 30 /* number set in VS_Initialize */ 31 rc = VSCMD_Ping(cmd); 32 vst_print_command(cmd); 33 if (rc) 34 { 35 printf(“The VolServ software is active.\n”); 36 } 37 else 38 { 39 printf(“The VolServ software is down.\n”); 40 } 41 } 42 vst_print_error(VSG_Error); 43 return ( rc ); 44 }

Functins

Page 1062 of the ADIC 601355 Rev A user manual — Notes
Page 1062 · click to enlarge
Page 1062

VolServ generates no intermediate or final status in response to a Ping request.

VSCMD_Ping triggers no MediaClass callbacks from VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

The following fields can be retrieved from the status handle after a successful Ping request:

  • VSID_PID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l)
Page 1063 of the ADIC 601355 Rev A user manual — Functins
Page 1063 · click to enlarge
Page 1063

VSCMD_ QueryMount

VSCMD_QueryMount determines which drives can be used in a subsequent Mount command for the specified medium. A Query Mount request returns the drives in the order of preference, based upon availability, proximity to the medium, usage time, and usage count.

Upon receipt of a Query Mount request, VolServ determines which archive contains the specified medium.

If the specified medium is not in an archive, a null list of drives is returned to the client.

If the medium is in an archive, VolServ determines which drives in that archive are suitable for mounting the specified medium. The list of suitable drives is returned to the client in the Query Mount status.

Functins

Synopsis VST_BOOLEAN VSCMD_QueryMount (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for this Query Mount request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = Required at the end of the variable length argument list to indicate the end of the list.
Page 1064 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 1064 · click to enlarge
Page 1064

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_MEDIA_ID (VST_MEDIA_ID) The identifier of the medium for which a list of compatible drives is being requested.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameters · Parameter Type Description

Page 1065 of the ADIC 601355 Rev A user manual — Functins
Page 1065 · click to enlarge
Page 1065

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_QueryMount returns:

Functins

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 1066 of the ADIC 601355 Rev A user manual — Example
Page 1066 · click to enlarge
Page 1066
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_querymount_execute 4 * 5 * PURPOSE:

Example 1 /****************************************

Page 1067 of the ADIC 601355 Rev A user manual — Functins
Page 1067 · click to enlarge
Page 1067

6 * This executes the VSCMD_QueryMount API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_querymount_execute(void) 14 #else 15 VST_BOOLEAN vst_querymount_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_MEDIA_ID mediaid; 20 VST_COMMAND_HANDLE cmd; 21 22 /* get parameters from user */ 23 printf(“*** QueryMount parameters

Functins

***\n” ); 24 25 printf(“\nEnter media ID: “); 26 gets( mediaid); 27 28 /* create the command handle */ 29 /* Note that the command handle is

not */ 30 /* destoyed in this routine, but in

*/ 31 /* vst_dispatch when final status is

received. */ 32 cmd = VS_Command_Create(); 33 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 34 { 35 /* Send the command to the VolServ software. */ 36 /* Note that status is not processed here. */

Page 1068 of the ADIC 601355 Rev A user manual — Notes
Page 1068 · click to enlarge
Page 1068

37 /* Instead, it is processed in the */ 38 /* vst_dispatch routine. Also, note that */ 39 /* default values such as timeout, */ 40 /* value retry limit and priority are set as */ 41 /* default parameters. */ 42 rc = VSCMD_QueryMount(cmd, 43 VSID_MEDIA_ID, mediaid, 44 VSID_ENDFIELD); 45 } 46 return ( rc ); 47 }

VolServ generates no intermediate status in response to a Query Mount request for the following situations.

VSCMD_QueryMount does not trigger any MediaClass callbacks from VolServ.

The drives identified in the status returned to the client are known to be suitable for mounting the specified medium. However, they may not be available for mounting.

Drives that are not in the on-line state are not considered suitable for mounting and are, therefore, not returned in the Query Mount status.

If a Query Mount request specifies a medium that is currently mounted, the Query Mount request fails with the error VSE_VOLERR_MEDIA_MOUNTED. However, the status still includes a list of drives suitable for the specified medium.

Page 1069 of the ADIC 601355 Rev A user manual — Functins
Page 1069 · click to enlarge
Page 1069

The ordering of the drives in the list returned to the client is based on the medium’s current physical location. Drives that are not mounted are listed before drives that are mounted. Consequently, for a mounted medium, the drive on which the medium is currently mounted may not be the first drive in the returned list.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Query Mount request submitted through the API interface to the VolServ system.

Functins

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Query Mount commands are set with VSCMD_QueryMount_SetDefaults . If
Page 1070 of the ADIC 601355 Rev A user manual — Note
Page 1070 · click to enlarge
Page 1070

command-specific defaults are set for Query Mount commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Query Mount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Query Mount request:

  • VSID_DRIVE_ID ,
  • VSID_DRIVE_ID_ENTRY ,
  • VSID_DRIVE_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD ,
  • VSID_WAIT_REASON .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
Page 1071 of the ADIC 601355 Rev A user manual — Functins
Page 1071 · click to enlarge
Page 1071
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_QueryMount_SetDefaults(l)

Functins

Page 1072 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_QueryMount_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1072 · click to enlarge
Page 1072

VSCMD_ QueryMount_ SetDefaults

VSCMD_QueryMount_SetDefaults sets the command-level default parameters for Query Mount commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Query Mount commands are set with VSCMD_QueryMount_SetDefaults . If command-specific defaults are set for Query Mount commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Query Mount command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_QueryMount_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command

Page 1073 of the ADIC 601355 Rev A user manual — Functins
Page 1073 · click to enlarge
Page 1073

default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Query Mount commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Query Mount commands.

Functins

VSID_MEDIA_ID (VST_MEDIA_ID) The identifier of the medium for which a list of compatible drives is being requested.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Query Mount commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Query Mount commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameters · Parameter Type Description

Page 1074 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 1074 · click to enlarge
Page 1074

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Query Mount commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Query Mount commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Query Mount commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_QueryMount_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 1075 of the ADIC 601355 Rev A user manual — Functins
Page 1075 · click to enlarge
Page 1075
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_querymount_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_QueryMount API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

Functins

vst_querymount_defaults(void) 15 #else 16 VST_BOOLEAN

vst_querymount_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Query Mount default

Example 1 /**************************************** · parameters ***\n” );

Page 1076 of the ADIC 601355 Rev A user manual — Note
Page 1076 · click to enlarge
Page 1076

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_QueryMount_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_QueryMount(l)

29 vst_promptforglobals(&priority,

Page 1077 of the ADIC 601355 Rev A user manual — Functins
Page 1077 · click to enlarge
Page 1077

VSCMD_ Reclassify

VSCMD_Reclassify changes the MediaClass group with which the specified media are associated.

Upon receipt of a VSCMD_Reclassify request, VolServ verifies that each specified media identifier references a media of the type supported by the target MediaClass group.

If all specified media are of the appropriate media type, VolServ verifies that the target MediaClass group is not already filled to capacity.

If the target MediaClass group is already filled to capacity, a VSCMD_Reclassify request fails and a failure return code is returned to the client.

If the target MediaClass group is not already filled to capacity, only the media it takes to reach the capacity are reclassified. Any remaining media specified in a VSCMD_Reclassify request are not reclassified, and a failure indicator is returned to the client.

Functins

Synopsis VST_BOOLEAN VSCMD_Reclassify (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Reclassify request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
Page 1078 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 1078 · click to enlarge
Page 1078
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_MEDIA_CLASS_LIST (int) The list of MediaClass groups with which the specified media are currently associated. Used with the media to be reclassified reside in different MediaClass groups.

(char **) A list of the MediaClass groups with which the specified media are currently associated.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The MediaClass name with which all the specified media are currently associated if all of the specified media are associated with the same MediaClass group.

VSID_MEDIA_ID_LIST (int) The identifier of the number of media to reclassify.

(char **) A list of the identifiers of the media to reclassify.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 1079 of the ADIC 601355 Rev A user manual — Functins
Page 1079 · click to enlarge
Page 1079

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Functins

VSID_TARGET_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The name of the target MediaClass group with which the specified media are to be associated.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 1080 of the ADIC 601355 Rev A user manual — Return Values
Page 1080 · click to enlarge
Page 1080

Return Values VSCMD_Reclassify returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 1081 of the ADIC 601355 Rev A user manual — Functins
Page 1081 · click to enlarge
Page 1081
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_reclassify_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Reclassify API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Functins

vst_reclassify_execute(void) 14 #else 15 VST_BOOLEAN vst_reclassify_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_BOOLEAN done = VSE_FALSE; 20 int i;

Example 1 /****************************************

Page 1082 of the ADIC 601355 Rev A user manual — Example
Page 1082 · click to enlarge
Page 1082

21 int count; 22 VST_BOOLEAN single_class = VSE_TRUE; 23 VST_MEDIA_CLASS_NAME

target_media_class; 25 char * medialist[VST_MAX_ITEMS]; 26 char * mediaclasslist

[VST_MAX_ITEMS]; 27 VST_COMMAND_HANDLE cmd; 28 29 /* get parameters from user */ 30 printf(“*** Reclassify parameters

***\n” ); 31 count = vst_getmedialist(medialist,

VST_MAX_ITEMS); 32 printf(“\nEnter Target media class:

“); 33 gets( target_media_class); 34 printf(“\n Are media in same class

(1) yes, (0) no? “); 35 single_class = (VST_BOOLEAN)

atoi(gets(input)); 36 if (single_class) 37 { 38 printf(“\n Enter media class: “); 39 gets( old_media_class); 40 } 41 else 42 { 43 count = vst_getmediaclasslist(mediaclassl ist, VST_MAX_ITEMS); 44 } 45 46 /* create the command handle */ 47 /* Note that the command handle is

old_media_class; 24 VST_MEDIA_CLASS_NAME · not */

Page 1083 of the ADIC 601355 Rev A user manual — Functins
Page 1083 · click to enlarge
Page 1083

48 /* destoyed in this routine, but in

*/ 49 /* vst_dispatch when final status is

received. */ 50 cmd = VS_Command_Create(); 51 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 52 { 53 /* Send the command to the VolServ software. */ 54 /* Note that status is not processed here. */ 55 /* Instead, it is processed in the */ 56 /* vst_dispatch routine. Also, note that */ 57 /* default values such as timeout */ 58 /* value retry limit and priority are set as */ 59 /* default parameters. */ 60 if ( single_class ) 61 { 62 /* all media are in the same source class */ 63 rc = VSCMD_Reclassify(cmd, 64 VSID_MEDIA_CLASS_NAME, old_media_class, 65 VSID_TARGET_MEDIA_CLASS_NAME,

Functins

target_media_class, 66 VSID_MEDIA_ID_LIST, count, medialist, 67 VSID_ENDFIELD); 68 } 69 else 70 { 71 /* The media are in different mediaclass */ 72 /* groups*/ 73 rc = VSCMD_Reclassify(cmd,

Page 1084 of the ADIC 601355 Rev A user manual — Notes
Page 1084 · click to enlarge
Page 1084

mediaclasslist, 75 VSID_TARGET_MEDIA_CLASS_NAME,

target_media_class, 76 VSID_MEDIA_ID_LIST, count, medialist, 77 VSID_ENDFIELD); 78 } 79 } 80 return ( rc ); 81 }

VolServ does not generate intermediate status in response to a Reclassify request.

There are two ways to specify the MediaClass groups with which the specified media are currently associated.

  • If all of the specified media are associated with the same MediaClass group, use the VSID_MEDIA_CLASS_NAME parameter.
  • If the specified media are associated with more than one MediaClass group, use the VSID_MEDIA_CLASS_LIST parameter. The VSID_MEDIA_CLASS_LIST must contain an entry for each medium specified in VSID_MEDIA_ID_LIST (the lists must contain the same number of entries.) Also, the entries in these lists are positional. For example, the first specified medium must be associated with the first specified MediaClass group; the second specified medium must be associated with the

74 VSID_MEDIA_CLASS_LIST, count,

Page 1085 of the ADIC 601355 Rev A user manual — Functins
Page 1085 · click to enlarge
Page 1085

second specified MediaClass group; and the nth specified medium must be associated with the nth specified MediaClass group.

Pending Mount requests are not affected by the reclassification of media.

If a medium to be reclassified is in an archive, the target MediaClass group with which the medium is associated must be associated with that archive.

If the capacity of the target MediaClass group would be exceeded by the reclassification, only as many media as necessary to reach capacity are reclassified. The Reclassify request for any remaining media fails.

The capacity of an archive media class is a soft limit. If the capacity of an archive media class is exceeded, the entire Reclassify request is processed unless the capacity of the associated MediaClass group is also reached. When the capacity of an archive media class is reached, applicable High Mark threshold processing is initiated.

Functins

If the target MediaClass group is not associated with any archive, the Reclassify request fails.

An attempt to reclassify a medium into the MediaClass group with which it is already associated returns an error.

If reclassifying a medium places the medium in a MediaClass group that does not have the medium’s present location as a preferred location, the medium is not moved simply to place it into a preferred location. If the medium is mounted and then dismounted, or ejected and then entered, an attempt is made to place the medium in a preferred location as defined by the target MediaClass group.

A medium that does not reside in an archive can be reclassified.

Page 1086 of the ADIC 601355 Rev A user manual — Notes
Page 1086 · click to enlarge
Page 1086

The VSID_MEDIA_CLASS_LIST parameter require that two Arguments be passed instead of one.

  • The first argument passed is the number of MediaClass groups contained in the list of MediaClass identifiers.
  • The second argument is the list of MediaClass groups with which the specified media are currently associated.

The VSID_MEDIA_ID_LIST parameter require that two arguments be passed instead of one.

  • The first argument passed is the number of media to reclassify.
  • The second argument is the list of media to reclassify.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Reclassify request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
Page 1087 of the ADIC 601355 Rev A user manual — Functins
Page 1087 · click to enlarge
Page 1087
  • Command-specific parameter defaults for Reclassify commands are set with VSCMD_Reclassify_SetDefaults . If command-specific defaults are set for Reclassify commands, they override the global defaults for all commands..

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Reclassify command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Reclassify request:

Functins

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_MEDIA_ID ,
  • VSID_MEDIA_ID_ENTRY ,
  • VSID_MEDIA_ID_TABLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
Page 1088 of the ADIC 601355 Rev A user manual — Note
Page 1088 · click to enlarge
Page 1088
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VSCMD_Reclassify_SetDefaults(l)
Page 1089 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Reclassify_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1089 · click to enlarge
Page 1089

VSCMD_ Reclassify_ SetDefaults

VSCMD_Reclassify_SetDefaults sets the command-level default parameters for Reclassify commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Reclassify commands are set with VSCMD_Reclassify_SetDefaults . If command-specific defaults are set for Reclassify commands, they override the global defaults for all commands.

Functins

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Reclassify command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Reclassify_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 1090 of the ADIC 601355 Rev A user manual — VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)
Page 1090 · click to enlarge
Page 1090
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Reclassify commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Reclassify commands.

VSID_MEDIA_CLASS_LIST (int) The number of MediaClass groups with which the specified media are currently associated. Used with the media to be reclassified reside in different archives.

(char **) A list of the MediaClass groups with which the specified media are currently associated.

VSID_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The MediaClass group with which all the specified media are currently associated if all of the specified media are associated with the same MediaClass group.

VSID_MEDIA_ID_LIST (int) The number of media to reclassify.

(char **) A list of the identifiers of the media to reclassify.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Reclassify commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

Parameters · Parameter Type Description

Page 1091 of the ADIC 601355 Rev A user manual — Functins
Page 1091 · click to enlarge
Page 1091

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Reclassify commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Reclassify commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Functins

VSID_TARGET_MEDIA_CLASS_NAME (VST_MEDIA_CLASS_NAME)

The name of the target MediaClass group with which the specified media are to be associated.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Reclassify commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Reclassify commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Reclassify_SetDefaults returns:

Parameter Type Description

Page 1092 of the ADIC 601355 Rev A user manual — Example
Page 1092 · click to enlarge
Page 1092
  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_Reclassify_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Reclassify API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_reclassify_defaults(void) 15 #else 16 VST_BOOLEAN

vst_reclassify_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority;

Example 1 /****************************************

Page 1093 of the ADIC 601355 Rev A user manual — Functins
Page 1093 · click to enlarge
Page 1093

21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Reclassify default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Reclassify_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 40 return ( rc ); 41 }

Functins

  • The first argument passed is the number of MediaClass groups contained in the list of MediaClass identifiers.
  • The second argument is the list of MediaClass groups with which the specified media are currently associated.
Page 1094 of the ADIC 601355 Rev A user manual — Note
Page 1094 · click to enlarge
Page 1094

The VSID_MEDIA_ID_LIST parameter require that two arguments be passed instead of one.

  • The first argument passed is the number of media to reclassify.
  • The second argument is the list of media to reclassify.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Reclassify(l)
Page 1095 of the ADIC 601355 Rev A user manual — Functins
Page 1095 · click to enlarge
Page 1095

VSCMD_ Reprioritize

VSCMD_Reprioritize changes the execution priority of a request.

The client must supply the request identifier and request type of the request to be reprioritized when issuing a VSCMD_Reprioritize request.

The request identifier and request type of the request to reprioritize can be specified on the VSCMD_Reprioritize request or can be within a command handle that is specified on the VSCMD_Reprioritize request.

Upon receipt of a VSCMD_Reprioritize request, VolServ changes the priority of the specified pending request to the new priority. VolServ then reorders its command queue to reflect the request’s new priority.

Functins

Synopsis VST_BOOLEAN VSCMD_Reprioritize (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Reprioritize request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.
Page 1096 of the ADIC 601355 Rev A user manual — VSID_REQUEST_TYPE (VST_REQUEST_ID)
Page 1096 · click to enlarge
Page 1096

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Reclassify commands.

VSID_COMMAND_HANDLE (VST_COMMAND_HANDLE)

The command handle of the request to reprioritize. If VSID_REQUEST_ID and VSID_REQUEST_TYPE are specified, VSID_COMMAND_HANDLE is not applicable.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_NEW_PRIORITY (VST_PRIORITY) The new execution priority to be assigned to the specified request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this Reprioritize request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_REQUEST_ID (VST_REQUEST_ID) The identifier of the request to reprioritize. If VSID_COMMAND_HANDLE is specified, VSID_REQUEST_ID is not applicable.

VSID_REQUEST_TYPE (VST_REQUEST_ID)

The request type of the request to reprioritize. Valid values for this field are enumerated in the vs_types.h file. VSID_COMMAND_HANDLE is specified, VSID_REQUEST_TYPE is not applicable.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Parameters · Parameter Type Description

Page 1097 of the ADIC 601355 Rev A user manual — Functins
Page 1097 · click to enlarge
Page 1097

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

Functins

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 1098 of the ADIC 601355 Rev A user manual — Return Values
Page 1098 · click to enlarge
Page 1098

Return Values VSCMD_Reprioritize returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
Page 1099 of the ADIC 601355 Rev A user manual — Functins
Page 1099 · click to enlarge
Page 1099
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_reprioritize_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_Reprioritize API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

Functins

vst_reprioritize_execute(void) 14 #else 15 VST_BOOLEAN

vst_reprioritize_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_REQUEST_ID req; 20 VST_REQUEST_TYPE c; 21 VST_PRIORITY p;

Example 1 /****************************************

Page 1100 of the ADIC 601355 Rev A user manual — Example
Page 1100 · click to enlarge
Page 1100

22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** Reprioritize parameters

***\n” ); 26 printf(“Enter Request ID ==> “ ); 27 req = (VST_REQUEST_ID)

atol(gets(input)); 28 printf(“Enter Command Request Type

==> “ ); 29 c = (VST_REQUEST_TYPE)

atol(gets(input)); 30 printf(“Enter New Priority ==> “ ); 31 p = (VST_PRIORITY)

atoi(gets(input)); 32 /* create the command handle */ 33 /* Note that the command handle is

not */ 34 /* destoyed in this routine, but in

*/ 35 /* vst_dispatch when final status is

received. */ 36 cmd = VS_Command_Create(); 37 if (cmd != (VST_COMMAND_HANDLE )NULL) 38 { 39 /* Send the command to the VolServ software. */ 40 /* Note that status is not processed here. */ 41 /* Instead, it is processed in the */ 42 /* vst_dispatch routine. Also, note that */ 43 /* default values such as timeout */ 44 /* value retry limit and priority are set as */ 45 /* default parameters. */ 46 rc = VSCMD_Reprioritize(cmd, 47 VSID_REQUEST_ID, req,

Page 1101 of the ADIC 601355 Rev A user manual — Functins
Page 1101 · click to enlarge
Page 1101

48 VSID_REQUEST_TYPE, c, 49 VSID_NEW_PRIORITY, p, 50 VSID_ENDFIELD); 51 } 52 return ( rc ); 53 }

VolServ generates no intermediate status in response to a Reprioritize request for the following situations.

VSCMD_Reprioritize does not trigger any MediaClass callbacks from VolServ.

Functins

To ensure timely processing, a VSCMD_Reprioritize request is assigned execution priority 0 (zero) by VolServ.

A VSCMD_Reprioritize request cannot be cancelled.

The new priority specified in a VSCMD_Reprioritize request may be higher or lower than the current priority of the specified request.

If the request specified in a VSCMD_Reprioritize request is already processing when the VSCMD_Reprioritize request is received, VolServ still processes the VSCMD_Reprioritize request. If all work on the specified request has completed, the VSCMD_Reprioritize request functions as a noop. However, if there is additional processing to perform to complete the specified request, VolServ reprioritizes the remaining processing.

Page 1102 of the ADIC 601355 Rev A user manual — Notes
Page 1102 · click to enlarge
Page 1102

Any client can reprioritize any command as long as the request identifier and request type are known.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the intermediate and final status for this request is returned to the enterprise registered with VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Reprioritize request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Reprioritize commands are set with VSCMD_Reprioritize_SetDefaults . If command-specific defaults are set for Reprioritize commands, they override the global defaults for all commands.
Page 1103 of the ADIC 601355 Rev A user manual — Note
Page 1103 · click to enlarge
Page 1103

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Reprioritize command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Reprioritize request:

  • VSID_REQUEST_ID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,

Functins

  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Reprioritize_SetDefaults(l)
Page 1104 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Reprioritize_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1104 · click to enlarge
Page 1104

VSCMD_ Reprioritize_ SetDefaults

VSCMD_Reprioritize_SetDefaults sets the command-level default parameters for Reprioritize commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Reprioritize commands are set with VSCMD_Reprioritize_SetDefaults . If command-specific defaults are set for Reprioritize commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Reprioritize command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Reprioritize_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 1105 of the ADIC 601355 Rev A user manual — VSID_REQUEST_TYPE (VST_REQUEST_ID)
Page 1105 · click to enlarge
Page 1105
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Reprioritize commands.

VSID_COMMAND_HANDLE (VST_COMMAND_HANDLE)

The command handle of the request to reprioritize. If VSID_REQUEST_ID and VSID_REQUEST_TYPE are specified, VSID_COMMAND_HANDLE is not applicable.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Reprioritize commands.

Functins

VSID_NEW_PRIORITY (VST_PRIORITY) The new execution priority to be assigned to the specified request. Assignable priority values are restricted to a range from 1 (highest) to 32 (lowest) inclusive.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Reprioritize commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_REQUEST_ID (VST_REQUEST_ID) The identifier of the request to reprioritize. If VSID_COMMAND_HANDLE is specified, VSID_REQUEST_ID is not applicable.

VSID_REQUEST_TYPE (VST_REQUEST_ID)

The request type of the request to reprioritize. Valid values for this field are enumerated in the vs_types.h file. VSID_COMMAND_HANDLE is specified, VSID_REQUEST_TYPE is not applicable.

Parameters · Parameter Type Description

Page 1106 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 1106 · click to enlarge
Page 1106

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Reprioritize commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Reprioritize commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Reprioritize commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Reprioritize commands. Neither the API software nor VolServ uses USER_FIELD.

Parameter Type Description

Page 1107 of the ADIC 601355 Rev A user manual — Functins
Page 1107 · click to enlarge
Page 1107

Return Values VSCMD_Reprioritize_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

Functins

********* 2 * 3 * FUNCTION: vst_reprioritize_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Reprioritize API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_reprioritize_defaults(void) 15 #else 16 VST_BOOLEAN

vst_reprioritize_defaults() 17 #endif 18 {

Example 1 /****************************************

Page 1108 of the ADIC 601355 Rev A user manual — Note
Page 1108 · click to enlarge
Page 1108

19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Reprioritize default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_Reprioritize_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

Page 1109 of the ADIC 601355 Rev A user manual — Functins
Page 1109 · click to enlarge
Page 1109

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Reprioritize(l)

Functins

Page 1110 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 1110 · click to enlarge
Page 1110

VSCMD_ RequestQuery

VSCMD_RequestQuery requests information about an outstanding VolServ request. To execute a valid Request Query command, the client must provide the VolServ-assigned request identifier of the request for which information is needed.

Synopsis VST_BOOLEAN VSCMD_RequestQuery (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Arguments • handle = The command handle for the Request Query request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

Parameters · Parameter Type Description

Page 1111 of the ADIC 601355 Rev A user manual — Functins
Page 1111 · click to enlarge
Page 1111

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_REQUEST_ID (VST_REQUEST_ID) The VolServ-assigned identifier of the request to be queried. A valid request identifier must be specified in the YYYY:DD:MM format where YYYY represents the year, DD represents the day, and MM is the month.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

Functins

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

Parameter Type Description

Page 1112 of the ADIC 601355 Rev A user manual — Return Values
Page 1112 · click to enlarge
Page 1112

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_RequestQuery returns:

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

Parameter Type Description

Page 1113 of the ADIC 601355 Rev A user manual — Functins
Page 1113 · click to enlarge
Page 1113

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.

Functins

  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_requestquery_execute 4 * 5 * PURPOSE: 6 * This executes the VSCMD_RequestQuery API call. 7 * 8 * PARAMETERS: 9 * none 10 *

Example 1 /****************************************

Page 1114 of the ADIC 601355 Rev A user manual — Example
Page 1114 · click to enlarge
Page 1114

11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN

vst_requestquery_execute(void) 14 #else 15 VST_BOOLEAN

vst_requestquery_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 VST_REQUEST_ID requestid; 20 VST_COMMAND_HANDLE cmd; 21 22 /* get parameters from user */ 23 printf(“*** Request Query parameters

***\n” ); 24 printf(“Request ID to query: “); 25 requestid = (VST_REQUEST_ID)

atoi(gets(input)); 26 27 /* create the command handle */ 28 /* Note that the command handle is

not */ 29 /* destoyed in this routine, but in

*/ 30 /* vst_dispatch when final status is

received. */ 31 cmd = VS_Command_Create(); 32 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 33 { 34 /* Send the command to the VolServ software. */ 35 /* Note that status is not processed here. */ 36 /* Instead, it is processed in the */ 37 /* vst_dispatch routine. Also, note that */ 38 /* default values such as timeout */

Page 1115 of the ADIC 601355 Rev A user manual — Functins
Page 1115 · click to enlarge
Page 1115

39 /* value retry limit and priority are set as */ 40 /* default parameters. */ 41 rc = VSCMD_RequestQuery(cmd, 42 VSID_REQUEST_ID, requestid, 43 VSID_ENDFIELD); 44 } 45 return ( rc ); 46 }

VolServ generates no intermediate status in response to a Request Query request.

Functins

VSCMD_RequestQuery does not trigger any MediaClass callbacks from VolServ.

The request identifier as shown in syslogs and vsadm is not in the correct format for a VSCMD_RequestQuery request. The request identifier obtained from these sources has the format: 93:123:45678. A request identifier in this format must be converted to the ydddnnnnn format before being used as a parameter on a VSCMD_RequestQuery request. The request identifier 93:123:45678, converted to the appropriate format, is 312345678.

The client must specify the identifier of the request to query.

After a request completes processing, there is a relatively short period of time that the request shows a state of complete. Afterwards, all knowledge of the request is removed from the VolServ system and a subsequent VSCMD_RequestQuery request for that request fails.

Page 1116 of the ADIC 601355 Rev A user manual — Tip
Page 1116 · click to enlarge
Page 1116

Only one request can be queried per VSCMD_RequestQuery request.

If the VSID_ENTERPRISE_ID parameter is set to any value other than zero, the final status for this request is returned to the enterprise registered with VolServ.

The total length of time the API software waits for a command status in synchronous mode from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive final status on a Request Query request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Request Query commands are set with VSCMD_RequestQuery_SetDefaults . If command-specific defaults are set for Request Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Request Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Page 1117 of the ADIC 601355 Rev A user manual — Functins
Page 1117 · click to enlarge
Page 1117

The following fields can be retrieved from the status handle after a successful Request Query request:

  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_REQUEST_HANDLE ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Functins

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_RequestQuery_SetDefaults(l)
Page 1118 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_RequestQuery_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1118 · click to enlarge
Page 1118

VSCMD_ Request Query_Set Defaults

VSCMD_RequestQuery_SetDefaults sets the command-level default parameters for Request Query commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Request Query commands are set with VSCMD_RequestQuery_SetDefaults . If command-specific defaults are set for Request Query commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of a Request Query command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_RequestQuery_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command

Page 1119 of the ADIC 601355 Rev A user manual — Functins
Page 1119 · click to enlarge
Page 1119

default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Request Query commands.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Request Query commands.

Functins

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Request Query commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_REQUEST_ID (VST_REQUEST_ID) The VolServ-assigned identifier of the request to be queried. A valid request identifier must be specified in theYYYY:DD:MM format where YYYY represents the year, DD represents the day, and MM is the month.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Request Query commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameters · Parameter Type Description

Page 1120 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 1120 · click to enlarge
Page 1120

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Request Query commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Request Query commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Request Query commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_RequestQuery_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 1121 of the ADIC 601355 Rev A user manual — Functins
Page 1121 · click to enlarge
Page 1121
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.

********* 2 * 3 * FUNCTION: vst_requestquery_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_RequestQuery API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

Functins

vst_requestquery_defaults(void) 15 #else 16 VST_BOOLEAN

vst_requestquery_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Modify Pool default

Example 1 /**************************************** · parameters ***\n” );

Page 1122 of the ADIC 601355 Rev A user manual — Note
Page 1122 · click to enlarge
Page 1122

user_field, &timeout, &retries, &wait_flag, &enterprise_id); 30 /* set the default parameters */ 31 rc = VSCMD_RequestQuery_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_RequestQuery(l)

29 vst_promptforglobals(&priority,

Page 1123 of the ADIC 601355 Rev A user manual — VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)
Page 1123 · click to enlarge
Page 1123

VSCMD_ Unlock

VSCMD_Unlock releases exclusive use of a drive or a set of drives. The drive to be unlocked and the assigned lock identifier for the drive must be specified.

A set of drives locked with a single VSCMD_Lock request can be unlocked with multiple VSCMD_Unlock commands.

A VSCMD_Unlock request can specify a subset of the drives locked for the issuing client. VolServ unlocks only those drives specified in the VSCMD_Unlock request.

Synopsis VST_BOOLEAN VSCMD_Unlock (VST_COMMAND_HANDLE handle, “…”, VSID_ENDFIELD)

Functins

Arguments • handle = The command handle for the Unlock request.

  • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status for this request.

Parameters · Parameter Type Description

Page 1124 of the ADIC 601355 Rev A user manual — VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)
Page 1124 · click to enlarge
Page 1124

VSID_DRIVE_ID (int) The number of drives to unlock.

(VST_DRIVE_ID *) A pointer to the list of identifiers of the drives to unlock.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on this request.

VSID_LOCK_ID (VST_LOCK_ID) The lock identifier assigned to the drives to unlock. A lock identifier is assigned to a drive when the drive is locked with the VSCMD_Lock command.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for this request. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for this request. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode.

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for this request. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

Parameter Type Description

Page 1125 of the ADIC 601355 Rev A user manual — Functins
Page 1125 · click to enlarge
Page 1125

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software for this request. The default time-out value is 120 seconds.

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for this request. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for this request. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Unlock returns:

Functins

  • VSE_TRUE

- Successful execution if the API is operating in synchronous mode

- Good initial status received if the API is operating in asynchronous mode

  • VSE_FALSE - The request failed. A return code of VSE_FALSE (which is 0) means the request failed.

- To determine where the error occurred, and what the error was, the client queries the request’s error handle (with VS_Error_GetFields) to retrieve the error handle’s object code.

- If the object code’s value is VSE_NONE, the client must query the global error code (VSG_Error) to determine where the error occurred.

Parameter Type Description

Page 1126 of the ADIC 601355 Rev A user manual — Example
Page 1126 · click to enlarge
Page 1126
  • VSE_ERR_BADHANDLE - Specified handle was not a valid command handle.
  • VSE_ERR_NULLHANDLE - Specified handle was a null pointer.

- If the object code’s value is VSE_VOLSERV, the error occurred in VolServ and the client uses VST_ERROR_NUMCODE to identify the specific error.

- If the object code’s value is not VSE_VOLSERV and is not VSE_NONE, the error occurred in the API and the client uses VST_ERROR_CODE to identify the specific error.

  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.
  • VSE_ERR_NOTINITIALIZED - The VolServ API is not initialized.
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument.
  • VSE_ERR_SEND - The API software could not send the command request to VolServ. This may be an RPC communication error and can indicate VolServ is not executing.

********* 2 * 3 * FUNCTION: vst_unlock_execute 4 * 5 * PURPOSE:

Example 1 /****************************************

Page 1127 of the ADIC 601355 Rev A user manual — NULL) 36 {
Page 1127 · click to enlarge
Page 1127

6 * This executes the VSCMD_Unlock API call. 7 * 8 * PARAMETERS: 9 * none 10 * 11 **************************************** *********/ 12 #ifdef ANSI_C 13 VST_BOOLEAN vst_unlock_execute(void) 14 #else 15 VST_BOOLEAN vst_unlock_execute() 16 #endif 17 { 18 VST_BOOLEAN rc = VSE_FALSE; 19 int count; 20 VST_DRIVE_ID

drivelist[VST_MAX_ITEMS]; 21 VST_LOCK_ID lockid; 22 VST_COMMAND_HANDLE cmd; 23 24 /* get parameters from user */ 25 printf(“*** Unlock Parameters ***\n”

Functins

); 26 count = vst_getdrivelist(drivelist,

VST_MAX_ITEMS); 27 printf(“\nEnter Lock ID ==>”); 28 lockid = (VST_LOCK_ID)

atoi(gets(input)); 29 30 /* create the command handle */ 31 /* Note that the command handle is

not */ 32 /* destoyed in this routine, but in

*/ 33 /* vst_dispatch when final status is

received. */ 34 cmd = VS_Command_Create(); 35 if ( cmd != (VST_COMMAND_HANDLE)

NULL) 36 {

Page 1128 of the ADIC 601355 Rev A user manual — Notes
Page 1128 · click to enlarge
Page 1128

37 /* Send the command to the VolServ software. */ 38 /* Note that status is not processed here. */ 39 /* Instead, it is processed in the */ 40 /* vst_dispatch routine. Also, note that */ 41 /* default values such as timeout */ 42 /* value retry limit and priority are set as */ 43 /* default parameters. */ 44 rc = VSCMD_Unlock(cmd, 45 VSID_DRIVE_ID_LIST, count,drivelist, 46 VSID_LOCK_ID, lockid, 47 VSID_ENDFIELD); 48 } 49 return ( rc ); 50 }

VolServ can generate intermediate status in response ton Unlock request.

VSCMD_Unlock does not trigger MediaClass callbacks from VolServ.

Drives specified on a VSCMD_Unlock request that are either not locked or that have a lock identifier different from the one specified on the VSCMD_Unlock request return a failure status.

The VSID_DRIVE_ID parameter requires that two arguments be passed instead of one.

Page 1129 of the ADIC 601355 Rev A user manual — Tip
Page 1129 · click to enlarge
Page 1129
  • The first argument passed is the number of drives to unlock.
  • The second argument is the list of identifiers of the drives to unlock.

The total length of time the API software waits for a command status, in synchronous mode, from VolServ is (VSID_RETRY_LIMIT plus 1) multiplied by VSID_TIMEOUT_VALUE.

When the API software is operating in asynchronous mode, client software must call VS_Select to receive intermediate and final status on an Unlock request submitted through the API interface to the VolServ system.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

Functins

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Unlock commands are set with VSCMD_Unlock_SetDefaults . If command-specific defaults are set for Unlock commands, they override the global defaults for all commands.

Tip

To override a default (global or command-specific) parameter value for a specific instance of an Unlock command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

The following fields can be retrieved from the status handle after a successful Unlock request:

  • VSID_DRIVE_ID ,
Page 1130 of the ADIC 601355 Rev A user manual — Note
Page 1130 · click to enlarge
Page 1130
  • VSID_DRIVE_ID_ENTRY ,
  • VSID_DRIVE_ID_TABLE ,
  • VSID_ERROR_CODE ,
  • VSID_ERROR_CODE_ENTRY ,
  • VSID_ERROR_CODE_TABLE ,
  • VSID_LOCK_ID ,
  • VSID_SEQUENCE_NUM ,
  • VSID_SEQUENCE_TABLE ,
  • VSID_STATUS_CODE ,
  • VSID_STATUS_TYPE ,
  • VSID_USER_FIELD .

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Command_Create(l),
  • VS_Command_Destroy(l),
  • VS_Error_GetFields(l),
  • VS_Initialize(l),
  • VS_Status_GetFields(l),
  • VSCMD_Lock(l),
  • VSCMD_Unlock_SetDefaults(l)
Page 1131 of the ADIC 601355 Rev A user manual — Synopsis VST_BOOLEAN VSCMD_Unlock_SetDefaults ( “…”, VSID_ENDFIELD)
Page 1131 · click to enlarge
Page 1131

VSCMD_ Unlock_Set Defaults

VSCMD_Unlock_SetDefaults sets the command-level default parameters for Unlock commands.

Two levels of default parameter settings are used in the API software—global defaults and command-specific defaults.

  • Global defaults for all commands are initialized at startup and can be set or retrieved using VS_Global_SetFields and VS_Global_GetFields function calls.
  • Command-specific parameter defaults for Unlock commands are set with VSCMD_Unlock_SetDefaults . If command-specific defaults are set for Unlock commands, they override the global defaults for all commands.

Tip

Functins

To override a default (global or command-specific) parameter value for a specific instance of an Unlock command, the parameter identifier and the value to be used for the parameter can be submitted on the specific request itself.

Synopsis VST_BOOLEAN VSCMD_Unlock_SetDefaults ( “…”, VSID_ENDFIELD)

Arguments • “…” = Variable length argument list consisting of pairs of Arguments. Each pair of Arguments consists of a parameter identifier, followed by the value to be used as a command default value for the field. The valid parameter identifiers and types for this function are shown in the following "Parameters" paragraph.

Page 1132 of the ADIC 601355 Rev A user manual — VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)
Page 1132 · click to enlarge
Page 1132
  • VSID_ENDFIELD = R equired at the end of the variable length argument list to indicate the end of the list.

VSID_CLIENT_DISPATCH (VST_CLIENT_DISPATCH)

The name of the client dispatch routine to receive status on Unlock commands.

VSID_DRIVE_ID (int) The number of drives to unlock.

(VST_DRIVE_ID *) A pointer to the list of identifiers of the drives to unlock.

VSID_ENTERPRISE_ID (VST_ENTERPRISE_ID)

The identifier of the enterprise, if any, to receive intermediate and final status on Unlock commands.

VSID_LOCK_ID (VST_LOCK_ID) The lock identifier assigned to the drives to unlock. A lock identifier is assigned to a drive when the drive is locked with the VSCMD_Lock command.

VSID_PRIORITY (VST_PRIORITY) The requested execution priority for Unlock commands. Assignable priority values are restricted to the range from 1 (highest) to 32 (lowest) inclusive. The default priority value is 15.

VSID_RETRY_LIMIT (VST_RETRY_LIMIT) The number of times the API software retries for command status from VolServ before returning a time-out to the client software for Unlock commands. VSID_RETRY_LIMIT is not applicable when the API software executes in asynchronous mode. The default retry limit is 3.

Parameters · Parameter Type Description

Page 1133 of the ADIC 601355 Rev A user manual — Functins
Page 1133 · click to enlarge
Page 1133

VSID_STATUS_WAIT_FLAG (VST_STATUS_WAIT_FLAG)

A flag indicating whether the API software waits for final status from VolServ (or times-out) for Unlock commands. Valid options are VSE_TRUE (API software waits for final status) and VSE_FALSE (API software does not wait for final status). Also determines whether the API software operates in synchronous mode (VSE_TRUE) or in asynchronous mode (VSE_FALSE). The default VSID_STATUS_WAIT_FLAG value is VSE_TRUE.

VSID_TIMEOUT_VALUE (VST_TIME_OUT) The amount of time (in seconds) the API software waits for status from VolServ before returning a time-out to the client software. The default time-out value is 120 seconds.

Functins

VSID_USER_FIELD (VST_USER_FIELD) The value to put in USER_FIELD for Unlock commands. USER_FIELD is a 16-character field provided for user information. Information entered in this field is echoed back to the user in every status message returned for Unlock commands. Neither the API software nor VolServ uses USER_FIELD.

Return Values VSCMD_Unlock_SetDefaults returns:

  • VSE_TRUE - Successful execution.
  • VSE_FALSE - API failure - An appropriate error code is set in VSG_Error .
  • VSE_ERR_BADFIELD - An invalid parameter was specified.
  • VSE_ERR_BADSIZE - The value passed for a string parameter exceeds the maximum allowable length for that parameter.

Parameter Type Description

Page 1134 of the ADIC 601355 Rev A user manual — Example
Page 1134 · click to enlarge
Page 1134
  • VSE_ERR_NULLSTRING - A null value was passed to a string argument

********* 2 * 3 * FUNCTION: vst_unlock_defaults 4 * 5 * PURPOSE: 6 * This function sets the default parameters for the 7 * VSCMD_Unlock API call. 8 * 9 * PARAMETERS: 10 * none 11 * 12 **************************************** *********/ 13 #ifdef ANSI_C 14 VST_BOOLEAN

vst_unlock_defaults(void) 15 #else 16 VST_BOOLEAN vst_unlock_defaults() 17 #endif 18 { 19 VST_BOOLEAN rc = VSE_FALSE; 20 VST_PRIORITY priority; 21 VST_USER_FIELD user_field; 22 VST_TIME_OUT timeout; 23 VST_RETRY_LIMIT retries; 24 VST_STATUS_WAIT_FLAG wait_flag; 25 VST_ENTERPRISE_ID

enterprise_id; 26 27 /* get parameters from user */ 28 printf(“*** Unlock default

parameters ***\n” ); 29 vst_promptforglobals(&priority,

user_field, &timeout, &retries, &wait_flag, &enterprise_id);

Example 1 /****************************************

Page 1135 of the ADIC 601355 Rev A user manual — Note
Page 1135 · click to enlarge
Page 1135

30 /* set the default parameters */ 31 rc = VSCMD_Unlock_SetDefaults( 32 VSID_PRIORITY, priority, 33 VSID_USER_FIELD, user_field, 34 VSID_TIMEOUT_VALUE, timeout, 35 VSID_RETRY_LIMIT, retries, 36 VSID_STATUS_WAIT_FLAG, wait_flag, 37 VSID_ENTERPRISE_ID, enterprise_id, 38 VSID_ENDFIELD); 39 return ( rc ); 40 }

Functins

  • The first argument passed is the number of drives to unlock.
  • The second argument is the list of identifiers of the drives to unlock.

Note

If the argument list does not end with VSID_ENDFIELD, unpredictable results occur.

See Also • vsapi(l),

  • VS_Error_GetFields(l),
  • VS_Global_SetFields(l),
  • VSCMD_Unlock(l)
Page 1136 of the ADIC 601355 Rev A user manual — NOTES
Page 1136 · click to enlarge
Page 1136

NOTES

Page 1137 of the ADIC 601355 Rev A user manual — Functins
Page 1137 · click to enlarge
Page 1137

NOTES

Functins

Page 1138 of the ADIC 601355 Rev A user manual — Notes
Page 1138 · click to enlarge
Page 1138
Page 1138 of the ADIC 601355 Rev A user manual — Notes
Page 1139 of the ADIC 601355 Rev A user manual — Valid Status Fields
Page 1139 · click to enlarge
Page 1139

A

Valid Status

Fields

Valid Status Fields

Page 1140 of the ADIC 601355 Rev A user manual — Roadmap
Page 1140 · click to enlarge
Page 1140

Roadmap

Naming conventions.

Global parameters.

Error handling.

API functions. 2

Valid staus fields. A

Error codes. B

Mount example. C

A-2 Valid Status Fields 601355 Rev A

Topic Refer To · Chapter

Page 1141 of the ADIC 601355 Rev A user manual — VSID_
Page 1141 · click to enlarge
Page 1141

COMPONENT

_HANDLE_

ENTRY

Archive MediaClass X X X

VSID_

COMPONENT

_HANDLE

VSID_

ARCHIVE_

VSID_

NAME

ARCHIVE_

HANDLE_

VSID_

TABLE

Query X X X

ARCHIVE_

HANDLE_

ENTRY

VSID_

ARCHIVE_

HANDLE

VSID_

CODE_TABLE

ACTION_

VSCMD_Audit X X X

VSID_

CODE_ENTRY

ACTION_

VSID_

ACTION_

VSID_

CODE

Table A-1

601355 Rev A Valid Status Fields A-3

Show 28 more labels / short text on this page
VSID_ACTION_CODE through VSID_COMPONENT_HANDLE_ENTRY · Vary X · Archive MediaClass X · VSCMD_ClearEject · VSCMD_CreatePool · VSCMD_DeletePool · VSCMD_Disconnect · VSCMD_DriveQuery · VSCMD_Archive- · VSCMD_Archive- · VSCMD_Checkin · VSCMD_Checkout · VSCMD_Connect · VSCMD_Connect- · VSCMD_Dismount · VSCMD_DrivePool · VSCMD_DriveVary · VSCMD_Cancel · VSCMD_Create- · VSCMD_Create- · VSCMD_Delete- · VSCMD_Delete- · VSCMD_Export · VSCMD_Import · MediaClass · MediaClass · Query · Query
Page 1142 of the ADIC 601355 Rev A user manual — VSID_
Page 1142 · click to enlarge
Page 1142

COMPONENT

_HANDLE_

ENTRY

ArchiveMediaClass X X X

VSID_

COMPONENT

_HANDLE

VSID_

ARCHIVE_

VSID_

NAME

ARCHIVE_

HANDLE_

VSID_

TABLE

ARCHIVE_

HANDLE_

ENTRY

VSID_

ARCHIVE_

HANDLE

VSID_

CODE_TABLE

ACTION_

VSID_

CODE_ENTRY

ACTION_

VSID_

ACTION_

VSID_

CODE

A-4 Valid Status Fields 601355 Rev A

Show 26 more labels / short text on this page
VSCMD_MediaClass · VSCMD_MediaType · VSCMD_ModifyPool · VSCMD_MultiMount · VSCMD_Reclassify · VSCMD_Reprioritize · VSCMD_Intransit- · VSCMD_Request- · VSCMD_Media- · VSCMD_Modify- · VSCMD_Modify- · VSCMD_Modify- · VSCMD_Mount · VSCMD_Query- · VSCMD_Unlock · VSCMD_Lock · VSCMD_Move · VSCMD_Ping · MediaClass · Query · Query · Query · Query · Media · Mount · Query
Page 1143 of the ADIC 601355 Rev A user manual — VSID_COMP
Page 1143 · click to enlarge
Page 1143

VSID_DRIVE_

HANDLE

CONNECT_

HANDLE_

Query X X X

VSID_

TABLE

CONNECT_

HANDLE_

VSID_

ENTRY

CONNECT

_HANDLE

COMP_STATE VSID_

VSID_

_ID_ENTRY VSID_COM

P_ID_

TABLE

VSCMD_Audit X X X

VSID_COMP

COMP_

VSID_

ID

COMPONENT

_HANDLE_

VSID_

TABLE

Table A-2

601355 Rev A Valid Status Fields A-5

Show 29 more labels / short text on this page
VSCMD_DriveQuery X · VSID_COMPONENT_HANDLE_TABLE through VSID_DRIVE_HANDLE · Vary X · Archive MediaClass X · VSCMD_ClearEject · VSCMD_CreatePool · Archive MediaClass · VSCMD_DeletePool · VSCMD_Disconnect · VSCMD_DriveVary · VSCMD_Archive- · VSCMD_Archive- · VSCMD_Checkin · VSCMD_Checkout · VSCMD_Connect · VSCMD_Connect- · VSCMD_Dismount · VSCMD_DrivePool · VSCMD_Cancel · VSCMD_Create- · VSCMD_Create- · VSCMD_Delete- · VSCMD_Delete- · VSCMD_Export · VSCMD_Import · MediaClass · MediaClass · Query · Query
Page 1144 of the ADIC 601355 Rev A user manual — VSID_DRIVE_
Page 1144 · click to enlarge
Page 1144

VSID_DRIVE_

HANDLE

CONNECT_

HANDLE_

VSID_

TABLE

CONNECT_

HANDLE_

VSID_

ENTRY

CONNECT

_HANDLE

COMP_STATE VSID_

VSID_

_ID_ENTRY VSID_COM

P_ID_

TABLE

VSID_COMP

COMP_

VSID_

ID

COMPONENT

_HANDLE_

VSID_

TABLE

A-6 Valid Status Fields 601355 Rev A

Show 27 more labels / short text on this page
Archive MediaClass X · VSCMD_MediaClass · VSCMD_MediaType · VSCMD_ModifyPool · VSCMD_MultiMount · VSCMD_Reclassify · VSCMD_Reprioritize · VSCMD_Intransit- · VSCMD_Request- · VSCMD_Media- · VSCMD_Modify- · VSCMD_Modify- · VSCMD_Modify- · VSCMD_Mount · VSCMD_Query- · VSCMD_Unlock · VSCMD_Lock · VSCMD_Move · VSCMD_Ping · MediaClass · Query · Query · Query · Query · Media · Mount · Query
Page 1145 of the ADIC 601355 Rev A user manual — DRIVE_ID_
Page 1145 · click to enlarge
Page 1145

VSID_

DRIVE

POOL_

NAME

VSCMD_CreatePool X

DRIVEPOOL_

HANDLE_

Query X X X

VSID_

TABLE

DRIVEPOOL

_HANDLE_

ENTRY

VSID_

DRIVEPOOL_

HANDLE

VSID_

DRIVE_ID_

VSID_

TABLE

VSCMD_Dismount X X X

VSCMD_DriveVary X X X

DRIVE_ID_

ENTRY

VSID_

DRIVE_

VSID_

ID

VSID_DRIVE_

HANDLE_

TABLE

VSID_DRIVE_

HANDLE_

ENTRY

Table A-3

601355 Rev A Valid Status Fields A-7

Show 27 more labels / short text on this page
VSCMD_DeletePool X · VSID_DRIVE_HANDLE_ENTRY through DSID_DRIVEPOOL_NAME · VSCMD_DriveQuery X X · VSCMD_ClearEject · Archive MediaClass · Archive MediaClass · VSCMD_Disconnect · VSCMD_Archive- · VSCMD_Archive- · VSCMD_Checkin · VSCMD_Checkout · VSCMD_Connect · VSCMD_Connect- · VSCMD_DrivePool · VSCMD_Cancel · VSCMD_Create- · VSCMD_Create- · VSCMD_Delete- · VSCMD_Delete- · VSCMD_Export · VSCMD_Import · VSCMD_Audit · MediaClass · MediaClass · Query · Query · Vary
Page 1146 of the ADIC 601355 Rev A user manual — DRIVE_ID_
Page 1146 · click to enlarge
Page 1146

VSID_

DRIVE

POOL_

NAME

VSCMD_ModifyPool X

DRIVEPOOL_

HANDLE_

VSID_

TABLE

DRIVEPOOL

_HANDLE_

ENTRY

VSID_

DRIVEPOOL_

HANDLE

VSID_

DRIVE_ID_

VSID_

TABLE

VSCMD_Lock X X X

VSCMD_Mount X X X

VSCMD_MultiMount X X X

Mount X X X

VSCMD_Unlock X X X

DRIVE_ID_

ENTRY

VSID_

DRIVE_

VSID_

ID

VSID_DRIVE_

HANDLE_

TABLE

VSID_DRIVE_

HANDLE_

ENTRY

A-8 Valid Status Fields 601355 Rev A

Show 21 more labels / short text on this page
VSCMD_MediaClass · VSCMD_MediaType · Archive MediaClass · VSCMD_Reclassify · VSCMD_Reprioritize · VSCMD_Intransit- · VSCMD_Request- · VSCMD_Media- · VSCMD_Modify- · VSCMD_Modify- · VSCMD_Modify- · VSCMD_Query- · VSCMD_Move · VSCMD_Ping · MediaClass · Query · Query · Query · Query · Media · Query
Page 1147 of the ADIC 601355 Rev A user manual — VSID_
Page 1147 · click to enlarge
Page 1147

CLASS_NAME VSID_MEDIA

_HANDLE

LOCK_ID VSID_MEDIA_

Archive MediaClass X

TABLE VSID_

ENTRY VSID_FIELD_

VSID_FIELD VSID_FIELD_

ERROR_

CODE_

TABLE

VSCMD_Audit X X X

VSCMD_Checkin X X X

VSCMD_Checkout X X X

VSCMD_ClearEject X X X

Query X X X

VSCMD_CreatePool X X X

VSCMD_DriveQuery X X X

VSCMD_DriveVary X X X

VSCMD_Export X X X

VSCMD_Import X X X

VSID_

CODE_ENTRY

ERROR_

VSID_

ERROR_

VSID_

CODE

Table A-4

601355 Rev A Valid Status Fields A-9

Show 20 more labels / short text on this page
MediaClass X · Archive MediaClass X · MediaClass X · VSCMD_Dismount X · VSID_ERROR_CODE through VSID_MEDIA_HANDLE · VSCMD_DeletePool · VSCMD_Disconnect · VSCMD_Connect · VSCMD_Connect- · VSCMD_DrivePool · VSCMD_Archive- · VSCMD_Archive- · VSCMD_Cancel · VSCMD_Create- · VSCMD_Create- · VSCMD_Delete- · VSCMD_Delete- · Query · Query · Vary
Page 1149 of the ADIC 601355 Rev A user manual — MEDIA_ID
Page 1149 · click to enlarge
Page 1149

MEDIATYPE_

HANDLE

VSID_

MEDIACLASS

_HANDLE_

VSID_

TABLE

MEDIACLASS

_HANDLE_

VSID_

ENTRY

MEDIACLASS_

HANDLE

VSID_

MEDIA_ID

_TABLE

VSID_

VSCMD_Audit X X X

VSCMD_Checkin X X X

VSCMD_Checkout X X X

Eject X X X

VSCMD_Dismount X X X

MEDIA_ID

_ENTRY

MEDIA_ID VSID_

VSID_

VSID_MEDIA

_HANDLE_

TABLE

VSID_MEDIA

_HANDLE_

ENTRY

Table A-5

VSCMD_

601355 Rev A Valid Status Fields A-11

Show 29 more labels / short text on this page
VSID_MEDIA_HANDLE through VSID_MEDIATYPE_HANDLE · VSCMD_Archive- · VSCMD_Archive- · VSCMD_Connect · VSCMD_Connect · VSCMD_Create- · VSCMD_Create- · VSCMD_Create- · VSCMD_Delete- · VSCMD_Delete- · VSCMD_Delete- · VSCMD_Cancel · VSCMD_Clear- · VSCMD_Drive- · VSCMD_Drive- · MediaClass · MediaClass · MediaClass · MediaClass · Disconnect · Pool Query · Archive · Archive · Query · Query · Query · Vary · Pool · Pool
Page 1151 of the ADIC 601355 Rev A user manual — Table A-6
Page 1151 · click to enlarge
Page 1151
ADIC 601355 Rev A — Valid Status Fields diagram (page 1151)
Fig. 1 · Valid Status Fields

Table A-6

601355 Rev A Valid Status Fields A-13

VSID_STATUS_CODE through VSID_WAIT_REASON

Page 1153 of the ADIC 601355 Rev A user manual — VSID_
Page 1153 · click to enlarge
Page 1153

SEQUENCE

_TABLE

Query X X X

VSCMD_Cancel X X X

Query X X X

Query X X X

VSID_

SEQUENCE

VSID_

_NUM

REQUEST_

VSID_

ID

REQUEST_

HANDLE

VSID_

QUERY_

OPTION

VSID_

PID VSID_QUERY_

ENTERPRISE_

ID

VSID_

MEDIATYPE_

HANDLE_

TABLE

VSID_

MEDIATYPE_

HANDLE_

ENTRY

VSID_

Table A-7

601355 Rev A Valid Status Fields A-15

Show 27 more labels / short text on this page
Vary X X · VSCMD_Audit X X · VSCMD_Checkin X X · VSCMD_Checkout X X · VSCMD_ClearEject X X · VSCMD_Connect X X · ArchiveMediaClass X X · MediaClass X X · VSCMD_CreatePool X X · ArchiveMediaClass X X · MediaClass X X · VSCMD_DeletePool X X · VSCMD_Disconnect X X · VSCMD_Dismount X X · VSCMD_DriveQuery X X · VSCMD_DriveVary X X · VSCMD_Export X X · VSCMD_Import X X · VSID_MEDIATYPE_HANDLE_ENTRY through VSID_SEQUENCE_TABLE · VSCMD_Archive- · VSCMD_Archive- · VSCMD_Connect- · VSCMD_DrivePool · VSCMD_Create- · VSCMD_Create- · VSCMD_Delete- · VSCMD_Delete-
Page 1155 of the ADIC 601355 Rev A user manual — Valid Status Fields
Page 1155 · click to enlarge
Page 1155

NOTES

Valid Status Fields

601355 Rev A Valid Status Fields A-17

Page 1156 of the ADIC 601355 Rev A user manual — NOTES
Page 1156 · click to enlarge
Page 1156

NOTES

A-18 Valid Status Fields 601355 Rev A

Page 1157 of the ADIC 601355 Rev A user manual — Error Codes
Page 1157 · click to enlarge
Page 1157

B

Error Codes

Error Codes

Page 1158 of the ADIC 601355 Rev A user manual — Note
Page 1158 · click to enlarge
Page 1158

Roadmap

Naming conventions. Global parameters. Error handling.

API functions. 2

Valid staus fields. A

Error codes. B

Mount example. C

Note

Some errors are specific to VSADM functionality, thus they are not marked as being returned for a Client Command.

B-2 Error Codes 601355 Rev A

Topic Refer To · Chapter

Page 1159 of the ADIC 601355 Rev A user manual — Error Codes
Page 1159 · click to enlarge
Page 1159

Error Codes

0 VSE_VOLERR_NONE No error.

1 VSE_VOLERR_AUTH Authorization error. Client is not authorized to send commands.

2 VSE_VOLERR_VERS Version error. Software versions are incompatible.

3 VSE_VOLERR_PROC Procedure error.

4 VSE_VOLERR_DB Database error.

5 VSE_VOLERR_SWCOMM Software communication error. VolServ cannot communicate with one of its tasks or with an archive.

6 VSE_VOLERR_SYSTEM System error. Internal system object cannot be found in memory lists. (VolServ may need to be cycled.)

7 VSE_VOLERR_NOTEMPTY Item not empty.

8 VSE_VOLERR_NOTFOUND Item not found. Query could not find a match for the given criteria.

9 VSE_VOLERR_EXIST Item already exists.

10 VSE_VOLERR_INVAL Invalid item.

11 VSE_VOLERR_BUSY Device is busy.

12 VSE_VOLERR_OVERFLOW Overflow.

13 VSE_VOLERR_INVALID_ARCHIVE Invalid archive. Specified archive does not exist or could not be found. Medium is found, but it is not in the correct archive.

Error Codes

601355 Rev A Error Codes B-3

Code Definition Description

Page 1160 of the ADIC 601355 Rev A user manual — 26 VSE_VOLERR_DRIVE_NOT_ASSOCI ATED
Page 1160 · click to enlarge
Page 1160

14 VSE_VOLERR_INVALID_BATCH Invalid batch. Specified batch could not be found or does not exist.

15 VSE_VOLERR_INVALID_CLASS Invalid class. Specified MediaClass name could not be found or does not exist.

16 VSE_VOLERR_INVALID_OPT Invalid option specified. An invalid drive pool option (add/delete) was specified.

17 VSE_VOLERR_EMPTY_LIST No list specified. No archive/drive/medium list was specified for command requiring list.

18 VSE_VOLERR_BAD_LIST Error retrieving list items. Query failed to return a valid archive/drive/medium list.

19 VSE_VOLERR_DRIVE_ASSOCIATED Drive still associated with archive.

20 VSE_VOLERR_IMPORT Medium failed import.

21 VSE_VOLERR_CHECKIN Medium failed checkin.

22 VSE_VOLERR_INVALID_COMMAND Invalid command. Command to cancel/reprioritize was not a valid command type.

23 VSE_VOLERR_DRIVE_IN_POOL Drive still member of drive pool group.

24 VSE_VOLERR_LIST Error in list - check individual error codes on item in list. At least one of the items in the list returned an error (i.e., reclassify may be successful for one medium but not another).

25 VSE_VOLERR_EMPTY_POOL Drive pool empty.

26 VSE_VOLERR_DRIVE_NOT_ASSOCI ATED

Drive not associated with an archive.

B-4 Error Codes 601355 Rev A

Code Definition Description

Page 1161 of the ADIC 601355 Rev A user manual — Error Codes
Page 1161 · click to enlarge
Page 1161

27 VSE_VOLERR_INVAL_STATE Invalid action or location state for operation. The medium is not in the correct state for the specified operation (a medium mount may fail because the medium is marked for export). The archive is not in the correct state to be started/stopped.

28 VSE_VOLERR_INVALID_DRIVE Invalid drive specified. Specified drive could not be found or is out of valid drive ID range. No drive in the drive list or drive pool is suitable to satisfy the request.

29 VSE_VOLERR_INVALID_MEDIA Invalid media specified. A medium specified for dismount does not match the medium actually mounted on the specified drive.

30 VSE_VOLERR_INVALID_POOL Invalid pool specified. Specified drive pool could not be found.

31 VSE_VOLERR_ARCHIVE_MANAGER Archive manager general error. Components in the archive are unavailable, so requests cannot be processed. Archive or archive components cannot be initialized. Cannot find component to complete request. See logs for more information.

32 VSE_VOLERR_MEM_ALLOC Memory allocation error. Out of memory.

33 VSE_VOLERR_INVALID_ ATTRIBUTES

Invalid parameters specified.

34 VSE_VOLERR_OPERATOR_FAIL Operator failed command.

Error Codes

601355 Rev A Error Codes B-5

Code Definition Description

Page 1162 of the ADIC 601355 Rev A user manual — 46 VSE_VOLERR_MEDIUM_NOT_ MARKED_EJECT
Page 1162 · click to enlarge
Page 1162

35 VSE_VOLERR_MEDIUM_IN_ ARCHIVE

Medium already exists in an archive. Medium was found in a different archive, and thus may not be entered into this archive.

36 VSE_VOLERR_UNKNOWN_MEDIUM Unknown medium. Medium is not known to VolServ software (i.e., it has not been imported).

37 VSE_VOLERR_MUST_CHECKIN_ MEDIUM

Medium must be checked in.

38 VSE_VOLERR_PORT_IN_USE Specified port is in use.

39 VSE_VOLERR_MEDIUM_TO_BE_ CHECKED_OUT

Medium is to be checked out.

40 VSE_VOLERR_MEDIUM_NOT_TO_ BE_ENTERED

Medium not scheduled to be entered. Some other action is to be taken on the medium; it may be destined for checkout.

41 VSE_VOLERR_ARCHMEDIA_ NOTFOUND

Medium not found in archive. Cannot find the medium in the specified archive.

42 VSE_VOLERR_MEDIUM_DUPLICATE Duplicate medium. Two media with the same Media ID were found in the archive.

43 VSE_VOLERR_MEDIUM_MOUNTED Medium mounted.

44 VSE_VOLERR_MEDIUM_NOT_ MOUNTED

Medium not mounted.

45 VSE_VOLERR_MEDIUM_MARKED_ EJECT

Medium already marked for ejection.

46 VSE_VOLERR_MEDIUM_NOT_ MARKED_EJECT

Medium not marked for ejection.

B-6 Error Codes 601355 Rev A

Code Definition Description

Page 1163 of the ADIC 601355 Rev A user manual — Error Codes
Page 1163 · click to enlarge
Page 1163

47 VSE_VOLERR_MEDIA_NOT_ AVAILABLE

Media not available for use. The medium is currently in an unavailable component (i.e., it may be in a CLM that has been taken off-line). The robots that can access the medium are off-line.

48 VSE_VOLERR_MEDIUM_NOT_IN_ SPECIFIED_CLASS

Medium not in specified MediaClass group.

49 VSE_VOLERR_ARCHIVE_CLASS_ NOT_FOUND

Archive not associated with MediaClass group.

50 VSE_VOLERR_ARCHIVE_CLASS_ EXISTS

Archive already associated with MediaClass group.

51 VSE_VOLERR_ARCHIVE_CLASS_IS_ IMPORT_DEFAULT

MediaClass group is the auto-import default for archive.

52 VSE_VOLERR_ARCHIVE_CLASS_ PLACEMENT_NOT_SUPPORTED

MediaClass group placement not supported for this archive type.

53 VSE_VOLERR_INVALID_LOCATION Invalid archive media class placement location.

54 VSE_VOLERR_ARCHIVE_ MEDIATYPE_NOTFOUND

Archive does not support media type.

55 VSE_VOLERR_ARCHIVE_FULL Archive has reached capacity for media type. There is no more room in the archive for this media type.

56 VSE_VOLERR_INVALID_LOCKID Invalid lock ID.

57 VSE_VOLERR_DRIVE_LOCKED Drive currently locked.

58 VSE_VOLERR_DRIVE_NOT_LOCKED Drive not locked.

59 VSE_VOLERR_DRIVE_NOT_ AVAILABLE

Drive not available for use.

60 VSE_VOLERR_DRIVE_ALREADY_ ASSOCIATED

Drive already associated.

Error Codes

601355 Rev A Error Codes B-7

Code Definition Description

Page 1164 of the ADIC 601355 Rev A user manual — 81 VSE_VOLERR_DRIVE_NOT_ MOUNTED
Page 1164 · click to enlarge
Page 1164

61 VSE_VOLERR_DRIVE_ASSOCIATED _WITH_ANOTHER_ARCHIVE

Drive associated with another archive.

62 VSE_VOLERR_ARCHIVE_HW Archive hardware error.

63 VSE_VOLERR_CMD_NOT_ CANCELLABLE

Command not in state to cancel.

64 VSE_VOLERR_CMD_CANCELLED Command has been cancelled.

65 VSE_VOLERR_CMD_NOTFOUND Command not found. Unable to cancel or reprioritize.

66 VSE_VOLERR_AUDIT_FAIL Audit failed.

67 VSE_VOLERR_NEW_MEDIUM New medium - imported.

68 VSE_VOLERR_UNREADABLE_ LABEL

Unreadable medium label.

69 VSE_VOLERR_WRONG_BIN Medium in wrong bin.

70 VSE_VOLERR_COMP_NOT_ SUPPORTED

Component not supported.

71 VSE_VOLERR_COMP_INVALID Invalid component.

72 VSE_VOLERR_COMPSTATE_INVALID Invalid component state.

73 VSE_VOLERR_COMP_NOT_ AVAILABLE

Component not available.

74 VSE_VOLERR_COMP_NOTFOUND Component not found.

75 VSE_VOLERR_COMPTYPE_INVALID Invalid component type.

76 VSE_VOLERR_COMP_DOES_NOT_ SUPPORT_MEDIATYPE

Component does not support media type.

77 VSE_VOLERR_RECLASSIFY Reclassify error.

78 VSE_VOLERR_ROBOT_OFFLINE Robot off-line.

79 VSE_VOLERR_DRIVE_MOUNTED Drive is mounted.

80 VSE_VOLERR_PORT_EMPTY Port is empty.

81 VSE_VOLERR_DRIVE_NOT_ MOUNTED

Drive is not mounted.

B-8 Error Codes 601355 Rev A

Code Definition Description

Page 1165 of the ADIC 601355 Rev A user manual — Error Codes
Page 1165 · click to enlarge
Page 1165

82 VSE_VOLERR_ARCHIVE_CLASSES_ STILL_EXIST

MediaClass group associated with archives.

83 VSE_VOLERR_MOUNT_ RECLASSIFY_NOT_SUPPORTED

Reclassify only supported for mount by MediaClass group.

84 VSE_VOLERR_ARCHIVE_NOT_ ONLINE

Archive not on-line.

85 VSE_VOLERR_MEDIA_NOT_IN_LIST Media is not on list.

86 VSE_VOLERR_MEDIA_ALREADY_IN _LIST

Media is already on list.

87 VSE_VOLERR_MEDIA_NOT_ PROCESSED

Media was not processed. Processing, as specified by the request, was not completed for this medium.

88 VSE_VOLERR_MEDIA_ASSIGNED Media assigned. The specified medium is assigned to be mounted (Query Mount). VolServ tried to assign a medium that was already assigned. If this is the case, there is a VolServ software error (Mount).

89 VSE_VOLERR_MEDIA_NOT_ ASSIGNED

Media is not assigned.

90 VSE_VOLERR_INVALID_ MANUFACTURER_NAME

Invalid manufacturer name.

91 VSE_VOLERR_INVALID_REQUEST_ ID

Invalid request ID. Specified request ID was not a positive non-zero number.

92 VSE_VOLERR_INVALID_PRIORITY Invalid priority. The range of valid priorities is 1 to 32, inclusive.

93 VSE_VOLERR_INVALID_DRIVE_ TYPE

Invalid drive type. The specified drive type is invalid (creation of a drive).

Error Codes

601355 Rev A Error Codes B-9

Code Definition Description

Page 1166 of the ADIC 601355 Rev A user manual — 102 VSE_VOLERR_INVALID_ARCHIVE_ ACTION_OPTION
Page 1166 · click to enlarge
Page 1166

94 VSE_VOLERR_INVALID_MEDIA_ TYPE

Invalid media type. The specified media type was not a valid system or user-defined media type.

95 VSE_VOLERR_INVALID_DRIVE_ SELECT

Invalid drive select option. A drive select option other than by drive ID, drive list, or drive pool was specified. Note: Selecting by list is not valid for a mount command.

96 VSE_VOLERR_INVALID_MEDIA_ SELECT

Invalid media select option. A media select option other than by media ID, media list, or MediaClass group was specified.

97 VSE_VOLERR_INVALID_CLASS_ MOUNT_STATE

Invalid class mount state. The MediaClass group is not defined as mountable by class.

98 VSE_VOLERR_INVALID_ARCHIVE_ MODE

Invalid archive mode The specified archive mode is not in the range of allowable modes (attended/unattended).

99 VSE_VOLERR_CLM_ASSOCIATED Component already associated. The specified component is already associated with a drive.

100 VSE_VOLERR_EJECTION_CLEARED Medium ejection cleared.

A medium marked for ejection (on the Eject list) was unmarked (removed from the Eject list).

101 VSE_VOLERR_MANUAL_EJECT Medium manually ejected. The specified medium was manually ejected while processing this request.

102 VSE_VOLERR_INVALID_ARCHIVE_ ACTION_OPTION

Invalid archive action. The specified archive action option is not within the allowed range (none, migrate, notify).

B-10 Error Codes 601355 Rev A

Code Definition Description

Page 1167 of the ADIC 601355 Rev A user manual — Error Codes
Page 1167 · click to enlarge
Page 1167

103 VSE_VOLERR_INVALID_MIGRATION _PRIORITY

Invalid migration priority.

104 VSE_VOLERR_INVALID_HIGH_MARK Invalid high mark.

105 VSE_VOLERR_INVALID_LOW_MARK Invalid low mark.

106 VSE_VOLERR_INVALID_CAPACITY Invalid capacity.

107 VSE_VOLERR_INVALID_TARGET_ ARCHIVE

Invalid target archive. Migration was specified as the archive action option, but an unknown or invalid migration archive was specified.

108 VSE_VOLERR_COMP_OVERLAP Component overlaps with another in the list. A component specified for preferred placement overlaps with another already in the list (i.e., if row 1,0,0,0 was specified, as was column 1,2,0,0, then the column would return this error as it is redundant).

109 VSE_VOLERR_DRIVE_NOT_ONLINE Drive not on-line.

110 VSE_VOLERR_MOUNT_CROSSES_ ARCHIVES

Mount crosses archives. The mount requires a medium be moved between archives, but the move-wait option specifies no wait.

111 VSE_VOLERR_CLASS_NOT_ MOUNTABLE

Class mount state not set to mount. The specified MediaClass group is not defined for mounting by class.

112 VSE_VOLERR_CLASS_CANNOT_ STATISFY_MOUNT

No media in class or no drives to satisfy mount.

113 VSE_VOLERR_NO_MEDIA_FOUND_ IN_CLASS_FOR_MOUNT

No media available in class to satisfy mount.

114 VSE_VOLERR_NO_DRIVES_FOUND _FOR_MOUNT

No drives available to satisfy Mount.

Error Codes

115 VSE_VOLERR_NO_DRIVES_ AVAILABLE_IN_POOL

No drives available in drive pool to satisfy Mount.

601355 Rev A Error Codes B-11

Code Definition Description

Page 1168 of the ADIC 601355 Rev A user manual — 126 VSE_VOLERR_INVALID_RPC_ VERSION
Page 1168 · click to enlarge
Page 1168

116 VSE_VOLERR_INCONSISTENCY Software or database inconsistency. Database inconsistency was encountered.

117 VSE_VOLERR_MEDIA_STILL_IN_ CLASS

Media still in class. MediaClass group cannot be deleted, unless there are no media in the class.

118 VSE_VOLERR_DRIVE_ARCHIVE_ INCOMPATIBLE_MEDIA_TYPES

Drive and archive are of incompatible media types. The drive to be associated does not match any media types that the archive supports.

119 VSE_VOLERR_INVALID_MEDIA_ SYNTAX

Invalid media syntax.

120 VSE_VOLERR_INVALID_DRIVE_ SYNTAX

Invalid drive syntax.

121 VSE_VOLERR_CLASS_STILL_ TARGET_CLASS_FOR_MIGRATION

Class still specified as target for migration. The specified archive MediaClass group association cannot be deleted because this archive and MediaClass group are the migration target for another archive media class association.

122 VSE_VOLERR_NOT_ENOUGH_ AVAILABLE_DRIVES_IN_POOL

Not enough available drives in pool. There are not enough available drives in the pool to satisfy the request.

123 VSE_VOLERR_INVALID_RPC_ OPTION

Invalid RPC option.

124 VSE_VOLERR_INVALID_RPC_HOST NAME

Invalid RPC hostname.

125 VSE_VOLERR_INVALID_RPC_ PROGRAM_NUMBER

Invalid RPC program number.

126 VSE_VOLERR_INVALID_RPC_ VERSION

Invalid RPC version.

B-12 Error Codes 601355 Rev A

Code Definition Description

Page 1169 of the ADIC 601355 Rev A user manual — Error Codes
Page 1169 · click to enlarge
Page 1169

127 VSE_VOLERR_INVALID_RPC_PROC _NUMBER

Invalid RPC procedure number.

128 VSE_VOLERR_INVALID_RPC_ PROTOCOL

Invalid RPC protocol.

129 VSE_VOLERR_LOCK_CROSSES_ ARCHIVES

Lock crosses archives. Only drives in the same archive can be locked with a single lock command.

130 VSE_VOLERR_SOFTWARE_NOT_ READY

Software not ready. VolServ is not ready to process requests. It is still initializing.

131 VSE_VOLERR_NOT_ACCEPTING_ COMMANDS

VolServ not accepting commands. VolServ is in single-user mode (i.e., it is not accepting commands through the client interface).

132 VSE_VOLERR_COMMAND_NOT_ ALLOWED

Command not allowed. The specified command is not allowed over this interface. The system administrator controls which commands are allowed over each interface.

133 VSE_VOLERR_INVALID_LOCK_ COUNT

Invalid lock count. Drive lock count is not a positive non-zero number.

134 VSE_VOLERR_NO_AVAILABLE_BINS No available bins.

135 VSE_VOLERR_INVALID_MODE Invalid mode. The specified mode is out of range.

136 VSE_VOLERR_COMMAND_IN_ UNKNOWN_STATE

Command terminated in unknown state.

137 VSE_VOLERR_MANUFACTURER_ MISSING

Manufacturer not specified. A batch identifier was specified without the manufacturer name (none or both are required).

Error Codes

601355 Rev A Error Codes B-13

Code Definition Description

Page 1170 of the ADIC 601355 Rev A user manual — 147 VSE_VOLERR_INVALID_TARGET_ CLASS
Page 1170 · click to enlarge
Page 1170

138 VSE_VOLERR_BATCH_ MISSING Batch not specified. A manufacturer name was specified with the batch identifier (none or both are required).

139 VSE_VOLERR_CLASS_DOES_NOT_ SUPPORT_MEDIA_TYPE

Class does not support media type.

140 VSE_VOLERR_INVALID_MOVEWAIT_ OPTION

Invalid move-wait option. The move-wait option was not in the range of accepted values (no, yes, attended).

141 VSE_VOLERR_ARCHIVE_ UNATTENDED

Current archive mode is unattended. The request cannot be completed because the source archive was unattended.

142 VSE_VOLERR_TARGET_ARCHIVE_ UNATTENDED

Target archive mode is unattended. The request cannot be completed because the destination archive was unattended.

143 VSE_VOLERR_DELETING_MEDIA_ FROM_CLASS

Error deleting medium from class.

144 VSE_VOLERR_ADDING_MEDIA_TO_ CLASS

Error adding medium to class.

145 VSE_VOLERR_MEDIA_ALREADY_IN _CLASS

Medium already in class. Reclassify failed because medium already exists in MediaClass group.

146 VSE_VOLERR_INVALID_CURRENT_ CLASS

Invalid current class. Reclassify failed because medium does not exist in specified current class.

147 VSE_VOLERR_INVALID_TARGET_ CLASS

Invalid target class. Reclassify failed because target class is not a valid class for this medium.

B-14 Error Codes 601355 Rev A

Code Definition Description

Page 1171 of the ADIC 601355 Rev A user manual — Error Codes
Page 1171 · click to enlarge
Page 1171

148 VSE_VOLERR_MEDIA_STILL_IN_ ARCHIVE

Media still in archive. If environment variables are set appropriately, then archive that still has media in it cannot be deleted.

149 VSE_VOLERR_MIXED_MEDIA_ TYPES_IN_LIST

Media list with mixed media types. Mount failed because the specified media contained media of differing media types.

150 VSE_VOLERR_FILLLEVEL_ EXCEEDS_NEW_CAPACITY

Current fill level exceeds desired capacity. The modify class failed because the current fill level is above the requested capacity.

151 VSE_VOLERR_MAX_MEDIATYPES_ DEFINED

Maximum number of media types defined.

152 VSE_VOLERR_ARCHMEDIA_MOVE_ FAILED

Archive media move failed (not currently returned).

153 VSE_VOLERR_CLASS_CAPACITY_ INCONSISTENCY

Archive media class inconsistency (not currently returned).

154 VSE_VOLERR_MEDIA_CLASS_FULL MediaClass group is full.

155 VSE_VOLERR_BIN_EMPTY Bin empty. Medium movement failed because the medium was not in the bin.

156 VSE_VOLERR_BIN_NOT_EMPTY Bin not empty. Medium movement failed because a medium already exists in the destination bin (several retries with a new bin will be tried before failing).

157 VSE_VOLERR_DRIVE_MEDIA_ ASSIGNED

Drive has media assigned. Mount failed because the drive already had a medium assigned to it.

158 VSE_VOLERR_CLIENT_ CONNECTED

Client connected.

Error Codes

601355 Rev A Error Codes B-15

Code Definition Description

Page 1172 of the ADIC 601355 Rev A user manual — 169 VSE_VOLERR_ARCHIVE_MANAGER _TERMINATING
Page 1172 · click to enlarge
Page 1172

159 VSE_VOLERR_UNABLE_TO_ CONNECT_CLIENT

Unable to connect to client.

160 VSE_VOLERR_INVALID_ ENTERPRISE_ID

Invalid enterprise ID.

161 VSE_VOLERR_UNKNOWN_ ENTERPRISE_ID

Unknown enterprise ID.

162 VSE_VOLERR_UNKNOWN_CLIENT Unknown client.

163 VSE_VOLERR_UNABLE_TO_ DISCONNECT_CLIENT

Unable to disconnect from client.

164 VSE_VOLERR_ENTER_WRONG_ ARCHIVE

Medium to be entered in another archive.

165 VSE_VOLERR_CHECKEDIN_ MEDIUM

Medium checked in.

166 VSE_VOLERR_MEDIUM_ID_ MISMATCH

Medium ID specified does not match bar code. Medium movement failed because the wrong medium was in the bin.

167 VSE_VOLERR_COMP_ INCONSISTENT_MAPPINGS

Inconsistency in column mappings. During configuration or reconfiguration, there was an inconsistency in the column mappings.

168 VSE_VOLERR_EU_HAS_ ASSOCIATED_MEDIA

CLM or CLU with associated media - manual eject. This is the result of a Mount failing because the CLM could not move the medium to the recorder, and error recovery processing could not correct the problem.

169 VSE_VOLERR_ARCHIVE_MANAGER _TERMINATING

Archive manager terminating - request cancelled. The archive is in the process of shutting down; therefore, the request has been cancelled.

B-16 Error Codes 601355 Rev A

Code Definition Description

Page 1173 of the ADIC 601355 Rev A user manual — Error Codes
Page 1173 · click to enlarge
Page 1173

170 VSE_VOLERR_MEDIA_NOT_ EJECTED_FROM_DRIVE

Medium not ejected from drive. Dismount failed because the medium was not ejected from the drive.

171 VSE_VOLERR_MEDIA_ALREADY_IN _TARGET_ARCHIVE

Medium already exists in target archive. Move failed because medium already resides in the destination archive.

172 VSE_VOLERR_MEDIUM_NOT_ MOUNTED_ON_DRIVE

Medium is not mounted on specified drive.

173 VSE_VOLERR_PORT_NO_ AVAILABLE_BINS

No available port bins.

174 VSE_VOLERR_PORT_COUNT_TOO_ LARGE

Port count too large.

175 VSE_VOLERR_INVALID_MEDIA_ STAT_VALUE

Invalid media statistic value for user-defined media statistics.

176 VSE_VOLERR_INVALID_MOUNT_ CRITERIA

Invalid mount criteria.

177 VSE_VOLERR_NO_MEDIA_ SELECTED_BY_CRITERIA

No media found that meet user criteria.

178 VSE_VOLERR_INCONSISTENT_ MEDIA_ON_LIST

Media on console list.

179 VSE_VOLERR_CANNOT_ REPRIORITIZE_CMD

Command not in state to reprioritize.

180 VSE_VOLERR_INVALID_DRIVE_LIST Invalid Drive list.

181 VSE_VOLERR_MEDIUM_IN_PORT Medium in port.

182 VSE_VOLERR_PROTOCOL_NOT_ SUPPORTED

Protocol not supported at this time.

183 VSE_VOLERR_MEDIUM_NOT_ REMOVED_FROM_ARCHIVE

Medium not physically removed from archive. Manual eject was requested, but medium was not physically removed (only the STK ACS product family archives verify that medium was physically removed).

Error Codes

601355 Rev A Error Codes B-17

Code Definition Description

Page 1174 of the ADIC 601355 Rev A user manual — 199 ERR_ARCHIVE_MOVEMENT_ PENDING_FOR_MEDIUM
Page 1174 · click to enlarge
Page 1174

184 VSE_VOLERR_ARCHIVE_ PHYSICALLY_FULL

Archive is physically full.

185 VSE_VOLERR_INVALID_SOCKET_ INFORMATION

Invalid socket information.

186 VSE_VOLERR_ROBOT_ACCESSOR_ FULL

Accessor contains a medium.

187 VSE_VOLERR_AUDIT_IN_ PROGRESS

Shelf cannot be varied during an audit.

188 VSE_VOLERR_PORT_NOT_ AVAILABLE

Port is not available.

189 ERR_HARDWARE_NOT_READY Hardware not ready.

190 ERR_MAC_OFFLINE Manipulator Accessor Component (MAC) is offline or unavailable.

191 ERR_MAC_NOTFOUND MAC not found.

192 ERR_PTBIN_OFFLINE Pass-through bin offline or unavailable.

193 ERR_PTBIN_NOTFOUND Pass-through bin not found.

194 ERR_ROW_NOTFOUND Row not found.

195 ERR_CLU_INVALID Port not accessible or offline.

196 ERR_HARDWARE_COMPONENT_ OFFLINE

Physical hardware component offline.

197 ERR_MEDIUM_CHECKED_OUT Medium checked out.

198 ERR_MEDIUM_INTRANSIT Medium intransit.

199 ERR_ARCHIVE_MOVEMENT_ PENDING_FOR_MEDIUM

Archive movement pending for medium.

200 ERR_LICENSE_STRING_MISSING License string missing.

201 ERR_LICENSE_LIMIT_REACHED License limit reached.

202 ERR_INVALID_LICENSE_STRING Invalid license string.

203 ERR_EJECT_IN_PROGRESS Eject currently in progress for medium.

B-18 Error Codes 601355 Rev A

Code Definition Description

Page 1175 of the ADIC 601355 Rev A user manual — Error Codes
Page 1175 · click to enlarge
Page 1175

204 ERR_TIMEOUT_WAITING_ON_ HARDWARE_STATUS

Timeout waiting on hardware status.

205 ERR_HARDWARE_COMMUNICATION Hardware communication error.

206 ERR_ARCHIVE_TYPE_NOT_ SUPPORTED

Archive type is not supported.

207 ERR_DISMOUNT_ALREADY_ QUEUED

Medium dismount is already queued.

Error Codes

601355 Rev A Error Codes B-19

Code Definition Description

Page 1176 of the ADIC 601355 Rev A user manual — NOTES
Page 1176 · click to enlarge
Page 1176

NOTES

B-20 Error Codes 601355 Rev A

Page 1177 of the ADIC 601355 Rev A user manual — Mount Example
Page 1177 · click to enlarge
Page 1177

Mount Example

Mount Example

Page 1178 of the ADIC 601355 Rev A user manual — Roadmap
Page 1178 · click to enlarge
Page 1178

Roadmap

Naming conventions.

Global parameters.

Error handling.

API functions. 2

Valid staus fields. A

Error codes. B

Mount example. C

C-2 Mount Example 601355 Rev A

Topic Refer To · Chapter

Page 1179 of the ADIC 601355 Rev A user manual — Mount Example
Page 1179 · click to enlarge
Page 1179

Mount Example

Example Mount by MediaClass Group & Drive Pool:

1 #include 2 #include 3 4 /* include the VolServ API header file*/ 5 6 /* define the volserv host computer */ 7 #define VOLSERV_HOST "vshost" 8 9 /* forward declare the dispatch routine

*/ 10 void dispatch ( VST_COMMAND_HANDLE ); 11 12 void print_error ( VST_ERROR_HANDLE ); 13 14 main ( int argc, char *argv[] ) 15 { 16 int exitcode = 0; 17 18 /* the name of the MediaClass group

from */ 19 /* which to select the medium to

mount */ 20 VST_MEDIA_CLASS_NAME mediaclass; 21 22 /* the name of the DrivePool group

from */ 23 /* which to select the drive to mount

*/ 24 VST_DRIVE_POOL_NAME drivepool; 25 26 /* the identifier of the medium that

was mounted */ 27 VST_MEDIA_ID mediaid; 28 29 /* the identifier of the drive that

was mounted */ 30 VST_DRIVE_ID driveid; 31

601355 Rev A Mount Example C-3

Page 1180 of the ADIC 601355 Rev A user manual — Example
Page 1180 · click to enlarge
Page 1180

32 /* the command handle for the Mount

request */ 33 VST_COMMAND_HANDLE cmdh; 34 35 /* the status handle for the Mount

request */ 36 VST_STATUS_HANDLE stath; 37 38 /* the error handle for the Mount

request */ 39 VST_ERROR_HANDLE errh; 40 41 /* the error object code for the

Mount request */ 42 VST_ERROR_OBJCODE errobj; 43 44 /* the numeric error code for the

Mount request */ 45 VST_ERROR_NUMCODE errnum; 46 47 /* check for the proper number of

arguments */ 48 if ( argc != 3 ) 49 { 50 printf ("usage: mount \n"); 51 exit ( 1 ); 52 } 53 54 /* copy the MediaClass name and the

drive pool name */ 55 strcpy ( mediaclass, argv[1] ); 56 strcpy ( drivepool, argv[2] ); 57 58 /* initilize the VolServ API */ 59 if ( VS_Initialize ( VOLSERV_HOST, 0,

10. ) 60 { 61 62 /* create a command handle to hold the ping */ 63 /* and mount request */

C-4 Mount Example 601355 Rev A

Page 1181 of the ADIC 601355 Rev A user manual — Mount Example
Page 1181 · click to enlarge
Page 1181

Mount Example

64 if ( (cmdh = VS_Command_Create ()) !=

(VST_COMMAND_HANDLE) NULL ) 65 { 66 /* check to see if VolServ s/w is available */ 67 if ( ! VSCMD_Ping ( cmdh ) ) 68 { 69 printf ( "VolServ system is not available\n"

); 70 exit ( 1 ); 71 } 72 73 /******************************* ********/ 74 /* Send the Mount request. */ 75 /* The default API mode is synchronous. */ 76 /* Therefore, wait for status until the */ 77 /* command is complete or until it */ 78 /* times-out waiting for status. */ 79 /* Set the timeout for three minutes and */ 80 /* the retry to two so that the total time */ 81 /* to wait is nine minutes. */ 82 /* Also,register a dispatch routine to */ 83 /* catch mount intermediate status. */ 84 /******************************* ********/ 85 if ( VSCMD_Mount ( cmdh,

601355 Rev A Mount Example C-5

Page 1182 of the ADIC 601355 Rev A user manual — Example
Page 1182 · click to enlarge
Page 1182

86 VSID_MEDIA_CLASS_NAME, mediaclass, 87 VSID_DRIVEPOOL_NAME, drivepool, 88 VSID_TIMEOUT_VALUE, 180, 89 VSID_RETRY_LIMIT, 2, 90 VSID_CLIENT_DISPATCH, dispatch, 91 VSID_ENDFIELD ) ) 92 { 93 /* Mount was successful. */ 94 /* Get the status handle */ 95 VS_Command_GetFields ( cmdh, 96 VSID_STATUS_HANDLE,&stath, 97 VSID_ENDFIELD ); 98 99 /* Get identifiers of medium and drive */ 100 /* that were mounted from status handle */ 101 VS_Status_GetFields ( stath, 102 VSID_MEDIA_ID,mediaid, 103 VSID_DRIVE_ID,&driveid, 104 VSID_ENDFIELD ); 105 106 /* Output user message showing */ 107 /* identifiers of mounted medium and */ 108 /* drive. */

C-6 Mount Example 601355 Rev A

Page 1183 of the ADIC 601355 Rev A user manual — Mount Example
Page 1183 · click to enlarge
Page 1183

Mount Example

109 printf ( "Media [%s] mounted on drive

[%d]\n", mediaid, driveid ); 110 } 111 else 112 { 113 /******************************* *****/ 114 /* Mount was not successful. */ 115 /* Get error handle from command to */ 116 /* determine where error occurred */ 117 /******************************* *****/ 118 VS_Command_GetFields ( cmdh, 119 VSID_ERROR_HANDLE,&errh, 120 VSID_ENDFIELD ); 121 122 /******************************* *****/ 123 /* Get error object and numeric code */ 124 /* from error handle. */ 125 /* The error object code tells where */ 126 /* the error occurred. */ 127 /* The error numeric code tells what */ 128 /* error occurred. */

601355 Rev A Mount Example C-7

Page 1184 of the ADIC 601355 Rev A user manual — Example
Page 1184 · click to enlarge
Page 1184

129 /******************************* ******/ 130 VS_Error_GetFields ( errh, 131 VSID_ERROR_NUMBER, &errnum, 132 VSID_ERROR_OBJECT, &errobj, 133 VSID_ENDFIELD ); 134 135 /******************************* *****/ 136 /* if command's error number states */ 137 /* no error, error is stored in the */ 138 /* global error code. */ 139 /******************************* *****/ 140 if ( errnum != VSE_ERR_NONE ) 141 { 142 143 /******************************* **/ 144 /* check to see if error was a */ 145 /* VolServ error. if yes, print a */ 146 /* message to the user stating the */ 147 /* error condition. */ 148 /******************************* **/ 149 if ( errobj == VSE_VOLSERV )

C-8 Mount Example 601355 Rev A

Page 1185 of the ADIC 601355 Rev A user manual — VSE_VOLERR_NO_MEDIA_FOUND_IN_CLA SS_FOR_MOUNT:
Page 1185 · click to enlarge
Page 1185

Mount Example

150 { 151 152 switch ( errnum ) 153 { 154 case VSE_VOLERR_INVALID_CLASS: 155 printf ( "Invalid media class[%s]\n", mediaclass); 156 break; 157 case VSE_VOLERR_INVALID_POOL: 158 printf ( "Invalid drive

pool[%s]\n" drivepool ); 159 break; 160 case

VSE_VOLERR_NO_DRIVES_AVAILABLE_I N_POOL161 printf ( "No drives

available in drive pool

[%s]\n", drivepool ); 162 break; 163 case VSE_VOLERR_CLASS_NOT_MOUNTABLE: 164 printf ( "Media class [%s]

does not allow mounts\n",

mediaclass ); 165 break; 166 case

VSE_VOLERR_NO_MEDIA_FOUND_IN_CLA SS_FOR_MOUNT:

601355 Rev A Mount Example C-9

Page 1186 of the ADIC 601355 Rev A user manual — Example
Page 1186 · click to enlarge
Page 1186

167 printf ( "Media class [%s]

has no media available for

mounting\n",mediaclass ); 168 break; 169 default: 170 printf ( "VolServ error

encountered \n" ); 171 break; 172 } 173 } 174 175 /******************************* **/ 176 /* print the error code for the user */ 177 /******************************* **/ 178 print_error ( errh ); 179 } 180 else 181 { 182 /******************************* **/ 183 /* print the error code from the */ 184 /* VolServ global error handle */ 185 /******************************* **/ 186 print_error ( VSG_Error ); 187 } 188

C-10 Mount Example 601355 Rev A

Page 1187 of the ADIC 601355 Rev A user manual — Mount Example
Page 1187 · click to enlarge
Page 1187

Mount Example

189 exitcode = 1; 190 } 191 } 192 else 193 { 194 /******************************* *********/ 195 /* print the error code from the */ 196 /* VolServ global error handle */ 197 /******************************* *********/ 198 print_error ( VSG_Error ); 199 exitcode = 1; 200 } 201 } 202 else 203 { 204 /******************************* *********/ 205 /* print the error code from the */ 206 /* VolServ global error handle */ 207 /******************************* *********/ 208 print_error ( VSG_Error ); 209 exitcode = 1; 210 } 211 212 exit ( exitcode ); 213} 214 215/************************************* ***********/ 216/* The dispatch routine registered with the mount*/

601355 Rev A Mount Example C-11

Page 1188 of the ADIC 601355 Rev A user manual — Example
Page 1188 · click to enlarge
Page 1188

217/* command. This routine is called by the API */ 218/* whenever status (final or intermediate) is */ 219/* received for the Mount request. For this */ 220/* example, we are interested in intermediate */ 221/* status. if we receive final status, we ignore */ 222/* it and let the main routine print out the */ 223/* media/drive used. */ 224/************************************* ***********/ 225void 226dispatch ( VST_COMMAND_HANDLE cmdh ) 227{ 228 VST_STATUS_HANDLE stath; 229 VST_STATUS_TYPE stattype; 230 VST_WAIT_REASON wait; 231 232 /******************************* **************/ 233 /* Get status handle from Mount

request */ 234 /******************************* **************/ 235 VS_Command_GetFields ( cmdh, 236 VSID_STATUS_HANDLE,&stath, 237 VSID_ENDFIELD ); 238

C-12 Mount Example 601355 Rev A

Page 1189 of the ADIC 601355 Rev A user manual — Mount Example
Page 1189 · click to enlarge
Page 1189

Mount Example

239 /******************************* **************/ 240 /* Get status type (intermediate or

final) */ 241 /* and wait reason (if any exists).

*/ 242 /******************************* **************/ 243 VS_Status_GetFields ( stath, 244 VSID_STATUS_TYPE, &stattype, 245 VSID_WAIT_REASON, &wait, 246 VSID_ENDFIELD ); 247 248 /******************************* **************/ 249 /* If intermediate status, print

message to */ 250 /* user. If final status, ignore it.

*/ 251 /******************************* **************/ 252 if ( stattype ==

VSE_STATUSTYPE_INTERMEDIATE ) 253 { 254 /* print message depending upon wait reason */ 255 switch ( wait ) 256 { 257 case VSE_WAIT_LOCKED_DRIVE: 258 printf ( "Mount waiting on locked drive\n" ); 259 break; 260 case VSE_WAIT_BUSY_DRIVE: 261 printf ( "Mount waiting on busy drive\n"); 262 break;

601355 Rev A Mount Example C-13

Page 1190 of the ADIC 601355 Rev A user manual — Example
Page 1190 · click to enlarge
Page 1190

263 case VSE_WAIT_BUSY_MEDIUM: 264 printf ( "Mount waiting on busy medium\n" ); 265 break; 266 default: 267 printf ( "Unknown wait reason [%d] received\n",wait ); 268 break; 269 } 270 } 271} 272 273/* print error code from given error handle */ 274void 275print_error ( VST_ERROR_HANDLE errh ) 276{ 277 VST_ERROR_CODE errcode; 278 279 VS_Error_GetFields ( errh, 280 VSID_ERROR_CODE, errcode, 281 VSID_ENDFIELD ); 282 283 printf ( "Error code [%s] returned

from API\n", errcode ); 284}

C-14 Mount Example 601355 Rev A

Page 1191 of the ADIC 601355 Rev A user manual — Mount Example
Page 1191 · click to enlarge
Page 1191

Mount Example

NOTES

601355 Rev A Mount Example C-15

Page 1192 of the ADIC 601355 Rev A user manual — NOTES
Page 1192 · click to enlarge
Page 1192

NOTES

C-16 Mount Example 601355 Rev A

Sources

References & links

Pages referenced in this manual — manufacturer, support and downloads.

Display codes

Error codes

What the fault codes shown on the display mean and how to clear them.

CodeMeaningFix
0No error. p.1159
1Authorization error. Client is not authorized to send commands. p.1159
2Version error. Software versions are incompatible. p.1159
3Procedure error. p.1159
4Database error. p.1159
5Software communication error. VolServ cannot communicate with one of its tasks or with an archive. p.1159
6System error. Internal system object cannot be found in memory lists. (VolServ may need to be cycled.) p.1159
7Item not empty. p.1159
8Item not found. Query could not find a match for the given criteria. p.1159
9Item already exists. p.1159
10Invalid item. p.1159
11Device is busy. p.1159
12Overflow. p.1159
13Invalid archive. Specified archive does not exist or could not be found. Medium is found, but it is not in the correct archive. p.1159
14Invalid batch. Specified batch could not be found or does not exist. p.1160
15Invalid class. Specified MediaClass name could not be found or does not exist. p.1160
16Invalid option specified. An invalid drive pool option (add/delete) was specified. p.1160
17No list specified. No archive/drive/medium list was specified for command requiring list. p.1160
18Error retrieving list items. Query failed to return a valid archive/drive/medium list. p.1160
19Drive still associated with archive. p.1160
20Medium failed import. p.1160
21Medium failed checkin. p.1160
22Invalid command. Command to cancel/reprioritize was not a valid command type. p.1160
23Drive still member of drive pool group. p.1160
24Error in list - check individual error codes on item in list. At least one of the items in the list returned an error (i.e., reclassify may be successful for one medium but not another). p.1160
25Drive pool empty. p.1160
26Drive not associated with an archive. p.1160
27Invalid action or location state for operation. The medium is not in the correct state for the specified operation (a medium mount may fail because the medium is marked for export). The archive is not in the correct state to be started/stopped. p.1161
28Invalid drive specified. Specified drive could not be found or is out of valid drive ID range. No drive in the drive list or drive pool is suitable to satisfy the request. p.1161
29Invalid media specified. A medium specified for dismount does not match the medium actually mounted on the specified drive. p.1161
30Invalid pool specified. Specified drive pool could not be found. p.1161
31Archive manager general error. Components in the archive are unavailable, so requests cannot be processed. Archive or archive components cannot be initialized. Cannot find component to complete request. See logs for more information. p.1161
32Memory allocation error. Out of memory. p.1161
33Invalid parameters specified. p.1161
34Operator failed command. p.1161
35Medium already exists in an archive. Medium was found in a different archive, and thus may not be entered into this archive. p.1162
36Unknown medium. Medium is not known to VolServ software (i.e., it has not been imported). p.1162
37Medium must be checked in. p.1162
38Specified port is in use. p.1162
39Medium is to be checked out. p.1162
40Medium not scheduled to be entered. Some other action is to be taken on the medium; it may be destined for checkout. p.1162
41Medium not found in archive. Cannot find the medium in the specified archive. p.1162
42Duplicate medium. Two media with the same Media ID were found in the archive. p.1162
43Medium mounted. p.1162
44Medium not mounted. p.1162
45Medium already marked for ejection. p.1162
46Medium not marked for ejection. p.1162
47Media not available for use. The medium is currently in an unavailable component (i.e., it may be in a CLM that has been taken off-line). The robots that can access the medium are off-line. p.1163
48Medium not in specified MediaClass group. p.1163
49Archive not associated with MediaClass group. p.1163
50Archive already associated with MediaClass group. p.1163
51MediaClass group is the auto-import default for archive. p.1163
52MediaClass group placement not supported for this archive type. p.1163
53Invalid archive media class placement location. p.1163
54Archive does not support media type. p.1163
55Archive has reached capacity for media type. There is no more room in the archive for this media type. p.1163
56Invalid lock ID. p.1163
57Drive currently locked. p.1163
58Drive not locked. p.1163
59Drive not available for use. p.1163
60Drive already associated. p.1163
61Drive associated with another archive. p.1164
62Archive hardware error. p.1164
63Command not in state to cancel. p.1164
64Command has been cancelled. p.1164
65Command not found. Unable to cancel or reprioritize. p.1164
66Audit failed. p.1164
67New medium - imported. p.1164
68Unreadable medium label. p.1164
69Medium in wrong bin. p.1164
70Component not supported. p.1164
71Invalid component. p.1164
72Invalid component state. p.1164
73Component not available. p.1164
74Component not found. p.1164
75Invalid component type. p.1164
76Component does not support media type. p.1164
77Reclassify error. p.1164
78Robot off-line. p.1164
79Drive is mounted. p.1164
80Port is empty. p.1164
81Drive is not mounted. p.1164
82MediaClass group associated with archives. p.1165
83Reclassify only supported for mount by MediaClass group. p.1165
84Archive not on-line. p.1165
85Media is not on list. p.1165
86Media is already on list. p.1165
87Media was not processed. Processing, as specified by the request, was not completed for this medium. p.1165
88Media assigned. The specified medium is assigned to be mounted (Query Mount). VolServ tried to assign a medium that was already assigned. If this is the case, there is a VolServ software error (Mount). p.1165
89Media is not assigned. p.1165
90Invalid manufacturer name. p.1165
91Invalid request ID. Specified request ID was not a positive non-zero number. p.1165
92Invalid priority. The range of valid priorities is 1 to 32, inclusive. p.1165
93Invalid drive type. The specified drive type is invalid (creation of a drive). p.1165
94Invalid media type. The specified media type was not a valid system or user-defined media type. p.1166
95Invalid drive select option. A drive select option other than by drive ID, drive list, or drive pool was specified. Note: Selecting by list is not valid for a mount command. p.1166
96Invalid media select option. A media select option other than by media ID, media list, or MediaClass group was specified. p.1166
97Invalid class mount state. The MediaClass group is not defined as mountable by class. p.1166
98Invalid archive mode The specified archive mode is not in the range of allowable modes (attended/unattended). p.1166
99Component already associated. The specified component is already associated with a drive. p.1166
100Medium ejection cleared. A medium marked for ejection (on the Eject list) was unmarked (removed from the Eject list). p.1166
101Medium manually ejected. The specified medium was manually ejected while processing this request. p.1166
102Invalid archive action. The specified archive action option is not within the allowed range (none, migrate, notify). p.1166
103Invalid migration priority. p.1167
104Invalid high mark. p.1167
105Invalid low mark. p.1167
106Invalid capacity. p.1167
107Invalid target archive. Migration was specified as the archive action option, but an unknown or invalid migration archive was specified. p.1167
108Component overlaps with another in the list. A component specified for preferred placement overlaps with another already in the list (i.e., if row 1,0,0,0 was specified, as was column 1,2,0,0, then the column would return this error as it is redundant). p.1167
109Drive not on-line. p.1167
110Mount crosses archives. The mount requires a medium be moved between archives, but the move-wait option specifies no wait. p.1167
111Class mount state not set to mount. The specified MediaClass group is not defined for mounting by class. p.1167
112No media in class or no drives to satisfy mount. p.1167
113No media available in class to satisfy mount. p.1167
114No drives available to satisfy Mount. p.1167
115No drives available in drive pool to satisfy Mount. p.1167
116Software or database inconsistency. Database inconsistency was encountered. p.1168
117Media still in class. MediaClass group cannot be deleted, unless there are no media in the class. p.1168
118Drive and archive are of incompatible media types. The drive to be associated does not match any media types that the archive supports. p.1168
119Invalid media syntax. p.1168
120Invalid drive syntax. p.1168
121Class still specified as target for migration. The specified archive MediaClass group association cannot be deleted because this archive and MediaClass group are the migration target for another archive media class association. p.1168
122Not enough available drives in pool. There are not enough available drives in the pool to satisfy the request. p.1168
123Invalid RPC option. p.1168
124Invalid RPC hostname. p.1168
125Invalid RPC program number. p.1168
126Invalid RPC version. p.1168
127Invalid RPC procedure number. p.1169
128Invalid RPC protocol. p.1169
129Lock crosses archives. Only drives in the same archive can be locked with a single lock command. p.1169
130Software not ready. VolServ is not ready to process requests. It is still initializing. p.1169
131VolServ not accepting commands. VolServ is in single-user mode (i.e., it is not accepting commands through the client interface). p.1169
132Command not allowed. The specified command is not allowed over this interface. The system administrator controls which commands are allowed over each interface. p.1169
133Invalid lock count. Drive lock count is not a positive non-zero number. p.1169
134No available bins. p.1169
135Invalid mode. The specified mode is out of range. p.1169
136Command terminated in unknown state. p.1169
137Manufacturer not specified. A batch identifier was specified without the manufacturer name (none or both are required). p.1169
138Batch not specified. A manufacturer name was specified with the batch identifier (none or both are required). p.1170
139Class does not support media type. p.1170
140Invalid move-wait option. The move-wait option was not in the range of accepted values (no, yes, attended). p.1170
141Current archive mode is unattended. The request cannot be completed because the source archive was unattended. p.1170
142Target archive mode is unattended. The request cannot be completed because the destination archive was unattended. p.1170
143Error deleting medium from class. p.1170
144Error adding medium to class. p.1170
145Medium already in class. Reclassify failed because medium already exists in MediaClass group. p.1170
146Invalid current class. Reclassify failed because medium does not exist in specified current class. p.1170
147Invalid target class. Reclassify failed because target class is not a valid class for this medium. p.1170
148Media still in archive. If environment variables are set appropriately, then archive that still has media in it cannot be deleted. p.1171
149Media list with mixed media types. Mount failed because the specified media contained media of differing media types. p.1171
150Current fill level exceeds desired capacity. The modify class failed because the current fill level is above the requested capacity. p.1171
151Maximum number of media types defined. p.1171
152Archive media move failed (not currently returned). p.1171
153Archive media class inconsistency (not currently returned). p.1171
154MediaClass group is full. p.1171
155Bin empty. Medium movement failed because the medium was not in the bin. p.1171
156Bin not empty. Medium movement failed because a medium already exists in the destination bin (several retries with a new bin will be tried before failing). p.1171
157Drive has media assigned. Mount failed because the drive already had a medium assigned to it. p.1171
158Client connected. p.1171
159Unable to connect to client. p.1172
160Invalid enterprise ID. p.1172
161Unknown enterprise ID. p.1172
162Unknown client. p.1172
163Unable to disconnect from client. p.1172
164Medium to be entered in another archive. p.1172
165Medium checked in. p.1172
166Medium ID specified does not match bar code. Medium movement failed because the wrong medium was in the bin. p.1172
167Inconsistency in column mappings. During configuration or reconfiguration, there was an inconsistency in the column mappings. p.1172
168CLM or CLU with associated media - manual eject. This is the result of a Mount failing because the CLM could not move the medium to the recorder, and error recovery processing could not correct the problem. p.1172
169Archive manager terminating - request cancelled. The archive is in the process of shutting down; therefore, the request has been cancelled. p.1172
170Medium not ejected from drive. Dismount failed because the medium was not ejected from the drive. p.1173
171Medium already exists in target archive. Move failed because medium already resides in the destination archive. p.1173
172Medium is not mounted on specified drive. p.1173
173No available port bins. p.1173
174Port count too large. p.1173
175Invalid media statistic value for user-defined media statistics. p.1173
176Invalid mount criteria. p.1173
177No media found that meet user criteria. p.1173
178Media on console list. p.1173
179Command not in state to reprioritize. p.1173
180Invalid Drive list. p.1173
181Medium in port. p.1173
182Protocol not supported at this time. p.1173
183Medium not physically removed from archive. Manual eject was requested, but medium was not physically removed (only the STK ACS product family archives verify that medium was physically removed). p.1173
184Archive is physically full. p.1174
185Invalid socket information. p.1174
186Accessor contains a medium. p.1174
187Shelf cannot be varied during an audit. p.1174
188Port is not available. p.1174
189Hardware not ready. p.1174
190Manipulator Accessor Component (MAC) is offline or unavailable. p.1174
191MAC not found. p.1174
192Pass-through bin offline or unavailable. p.1174
193Pass-through bin not found. p.1174
194Row not found. p.1174
195Port not accessible or offline. p.1174
196Physical hardware component offline. p.1174
197Medium checked out. p.1174
198Medium intransit. p.1174
199Archive movement pending for medium. p.1174
200License string missing. p.1174
201License limit reached. p.1174
202Invalid license string. p.1174
203Eject currently in progress for medium. p.1174
204Timeout waiting on hardware status. p.1175
205Hardware communication error. p.1175
206Archive type is not supported. p.1175
207Medium dismount is already queued. p.1175

Ask about the ADIC 601355 Rev A

Owners and our team usually reply within a day — and your question helps the next person too.

Add your email to get notified when it’s answered — no spam, ever.

0 questions
No questions yet about the ADIC 601355 Rev A

Be the first to ask — other owners or our team will answer.

Original document

ADIC 601355 Rev A manual PDF

1192 pages·5.7 MB·Digital Camera·PDF
Click any page above to open it here
Page 1 / …
100%
Loading pages…