以下将介绍怎样定义资产的属性及动作:
Note
| 1. 通过API可对资产进行添加、更新和删除操作。 2. 资产操作只有具有Inventory 角色权限的技术员才能操作。 3. 属性区分大小写,必须按照定义的方式使用。 4. 如果对示例表单中的按钮重命名,请将 'operation' 作为隐藏参数。 |
对工作站/服务器的操作,需要在HttpRequest 请求参数中设置如下属性,并且应确保'operation'动作为 'AddAsset','UpdateAsset' 或 'SaveAsset'.
属性 | 备注 |
targetURL= "/servlets/AssetServlet" | Target URL for adding/updating workstation/server |
assetName | Name of the asset (workstation/server) |
assetType | asset Type |
model | Model No. of the asset (workstation/server) |
productName | Product Name of the asset (workstation/server) |
siteName | Site to which workstation/server is associated |
ipAddress | IP Address of workstation/server. |
serviceTag | Service Tag of workstation/server |
wsManufacturer | Workstation Manufacturer |
proCount | Processor Count of workstation/server |
proType | Processor Type of workstation/server |
proSpeed | Processor Speed (in MHz) of workstation/server |
proManufacturer | Processor Manufacturer of workstation/server |
ramSize | RAM details (in MB) of workstation/server |
virtualCapacity | Virtual Memory (in MB) of workstation/server |
osName | Operating System Name of workstation/server |
osServicePack | Operating System ServicePack of workstation/server |
resTag | Resource Tag of workstation/server |
resSlNo | Resource Serial No. of workstation/server |
barCode | Bar Code of workstation/server |
location | Location of workstation/server |
vendor | Vendor of workstation/server |
acqDate | Acquisition Date of workstation/server (Supported Format:yyyy-MM-dd) |
expiryDate | Expiry Date of workstation/server (Supported Format:yyyy-MM-dd) |
warrantyExpDate | Warranty Expiry Date of workstation/server (Supported Format:yyyy-MM-dd) |
assetState | State of the of workstation/server |
assetToAssociate | Associate the asset to other assets.(Valid only for Asset State 'In Use'). |
associateToUser | Associate the asset to user.(Valid only for Asset State 'In Use'). |
associateToDepartment | Associate the asset to department.(Valid only for Asset State 'In Use'). |
UDF Column Aliases | UDF aliases name should be specified |
macAddress | MAC Address of workstation/server |
nicInfo | Nic Info of workstation/server |
netAddress | Net Address of workstation/server |
domain | Domain of workstation/server |
dnsServer | DNS Server of workstation/server |
gateway | Default Gateway of workstation/server |
dhcpEnabled | is DHCP Enabled for workstation/server. Values allowed: true, false. Default value: false. |
monitorType | Monitor Type of workstation/server |
monitorSerialNumber | Serial Number of the monitor. |
monitorManufacturer | Monitor manufacturer details |
mouseType | Mouse Type of workstation/server |
mouseSerialNumber | Serial Number of mouse |
mouseManufacturer | Mouse manufacturer details |
keyboardType | Keyboard Type of workstation/server |
keyboardSerialNumber | Serial Number of keyboard |
keyboardManufacturer | Keyboard manufacturer details |
username | Login Name for SDP Authentication |
password | Password for SDP Authentication |
DOMAIN_NAME | Domain Name to which the user belongs |
logonDomainName | Authentication Mode [AD or Local Authentication]. AD_AUTH refers to Active Directory Authentication. Local Authentication or empty value refers to Local Authentication. |
注意:
'assetName' 必须是唯一的,不能重复或被编辑。
如果指定 'ServiceTag',则所提供的信息将被视为具有该服务标签的资产(工作站/服务器)的属性,而不是所指定的资产名的资产信息。
产品类型由 'assetType' 来指定,是必填项。
资产的产品由 'productName'来指定。
如果指定的 'model' 或 'productName' 无效或者为空值,则型号将被视为 'Unknown ProductType' ,比如: Unknown Workstation.
如果指定的 'site' 无效,该工作站/服务器将被关联到'Not associated to any site.'
如果指定的 'vendor' 无效,并且执行操作的技术员具有添加厂商的权限,则将添加所指定的新厂商。
资源状态由'assetState'来指定。
如果工作站/服务器的资源状态为'In Use', 则该工作站/服务器可以关联到部门、用户或资产。它们的值分别由 'assetToAssociate','associateToUser' 或 'associateToDepartment'来指定。
如果工作站/服务器的资源状态为'In Use',而所指定的字段( 'assetToAssociate','associateToUser' or 'associateToDepartment')的值无效,则该资产的状态将被设置为 'In Store'
如果工作站/服务器的资源状态为disposed (报废),则该资产不能指定用户和部门。
如果工作站/服务器的资源状态为disposed (报废),则该资产不能指派到其它资产。
操作的技术员,如果具有访问权限限制,则只能为他所关联的地点,创建/更新资产。
操作的技术员,如果具有访问权限限制,则只能指派/关联属于他所在地点的资产。
要配置工作站的附加字段,请指定属性为 'asset_标签名' (如:自定义附加字段的标签名为test,则属性名为:asset_test)
添加工作站/服务器
要访问添加工作站/服务器的示例表单,请点击这里。其操作类型为 'AddAsset' 。
如果添加成功,则返回 成功信息,并显示所添加的'资源ID'和'资源名称' 。
以下情况,将返回失败信息:
必填项没有指定值。
具有访问限制的技术员,尝试添加新的工作站或服务器。
更新工作站/服务器
要访问更新工作站/服务器的示例表单,请点击这里,其操作类型为 'UpdateAsset' ,将使用所提供的信息,更新已有的资产。
当更新成功时,将返回操作状态,点击这里查看XML应答消息。
保存工作站/服务器
保存工作站/服务器的示例表单,请点击这里。
它将执行'SaveAsset'的操作。如果已经有符合条件的资产存在,则更新该资产,否则,则以所提供的信息添加新的资产。
对资产的操作,需要在HttpRequest 请求参数中设置如下属性,并且应确保'operation'动作为 'AddAsset','UpdateAsset' 或 'SaveAsset'。
属性 | 说明 |
targetURL= "/servlets/AssetServlet" | Target URL for adding/updating asset |
assetName | Name of the asset |
assetType | Type of asset |
productName | Product Name of the asset |
siteName | Site to which asset is associated |
assetTag | Asset Tag |
resSlNo | Serial No. of the asset |
barCode | Bar Code of asset |
location | Location of asset |
purchaseCost | Purchase Cost of the asset |
vendor | Vendor of asset |
acqDate | Acquisition Date of asset |
expiryDate | Expiry Date of asset |
warrantyExpDate | Warranty Expiry Date of asset |
assetState | State of the of asset |
assetToAssociate | Associate the asset to other assets.(Valid only for Asset State 'In Use'). |
associateToUser | Associate the asset to user.(Valid only for Asset State 'In Use'). |
associateToDepartment | Associate the asset to department.(Valid only for Asset State 'In Use'). |
username | Login Name for SDP Authentication |
password | Password for SDP Authentication |
DOMAIN_NAME | Domain Name to which the user belongs |
logonDomainName | Authentication Mode [AD or Local Authentication]. AD_AUTH refers to Active Directory Authentication. Local Authentication or empty value refers to Local Authentication. |
注意:
'assetName' 必须是唯一的,不能重复或被编辑。
产品类型由 'assetType' 来指定,是必填项。
资产的产品由 'productName'来指定。
如果指定的 'model' 或 'productName' 无效或者为空值,则型号将被视为 'Unknown ProductType' ,比如: Unknown Workstation.
如果指定的 'site' 无效,该资产将被关联到'Not associated to any site.'
如果指定的 'vendor' 无效,并且执行操作的技术员具有添加厂商的权限,则将添加所指定的新厂商。
资源状态由'assetState'来指定。
如果工作站/服务器的资源状态为'In Use', 则该工作站/服务器可以关联到部门、用户或资产。它们的值分别由 'assetToAssociate','associateToUser' 或 'associateToDepartment'来指定。
如果工作站/服务器的资源状态为'In Use',而所指定的字段( 'assetToAssociate','associateToUser' or 'associateToDepartment')的值无效,则该资产的状态将被设置为 'In Store'
如果资产的资源状态为disposed (报废),则该资产不能指定用户和部门。
如果资产的资源状态为disposed (报废),则该资产不能指派到其它资产。
操作的技术员,如果具有访问权限限制,则只能为他所关联的地点,创建/更新资产。
操作的技术员,如果具有访问权限限制,则只能指派/关联属于他所在地点的资产。
添加资产
点击这里 访问示例表单。它执行'AddAsset'的操作。
更新资产
点击这里访问更新资产的示例表单。它执行 'UpdateAsset' 的操作。
Save Asset
The sample form to Save Workstation/Server can be accessed 点击这里访问保存资产的示例表单。它执行'SaveAsset '的操作。
要删除资产,需要在HTTP的请求参数中定义以下属性,并将operation定义为'DeleteAsset'.
属性 | 说明 |
targetURL="/servlets/AssetServlet" | target URL for deleting asset |
assetName | Name of the asset |
assetType | type of asset |
username | Login Name for SDP Authentication |
password | Password for SDP Authentication |
DOMAIN_NAME | Domain Name to which the user belongs. |
logonDomainName | Authentication Mode [AD or Local Authentication]. AD_AUTH refers to Active Directory Authentication. Local Authentication or empty value refers to Local Authentication. |
点击这里访问示例表单。
操作成功后,返回 成功消息。