Cisco UCS Director Open Automation 開発者ガイド、リリース 4.1
変更トラッキング API
変更トラッキング API
発行日;2014/02/05   |   ドキュメントご利用ガイド   |   ダウンロード ;   この章 pdf   ,   ドキュメント全体 pdf    |   フィードバック

変更トラッキング API


変更トラッキング API

変更トラッキング API を使用して、モジュール経由で行った変更をトラッキングし、変更内容をデータベースに記録できます。

コンストラクタは ChangeTrackingAPI です。


import org.apache.log4j.Logger;

import com.cloupia.model.cIM.ChangeRecord;
import com.cloupia.service.cIM.inframgr.AbstractScheduleTask;
import com.cloupia.service.cIM.inframgr.FeatureContainer;
import com.cloupia.service.cIM.inframgr.cmdb.ChangeTrackingAPI;

 * This is a simple example demonstrating how to implement a scheduled task.  This task is executed
 * every 5 mins and simply makes a logging statement and increments the number of times it's been
 * executed.  It removes itself from the system once it has been executed twice.  It also
 * demonstrates how you can use the change tracking APIs to track changes made to the system.
public class DummyScheduleTask extends AbstractScheduleTask {
	private static Logger logger = Logger.getLogger(DummyScheduleTask.class);
	private int numTimesExecuted = 0;
	private static final long TWO_MINS = 60*1000*2;
	private static final int MAX_TIMES_EXECUTED = 2;

	public DummyScheduleTask() {

	public void execute(long lastExecution) throws Exception {"vxvxvxvxvx - dummyTask has been executed " + numTimesExecuted + " times.");
		if (numTimesExecuted == MAX_TIMES_EXECUTED) {"vxvxvxvxvx - removing dummyTask");
			FooModule module = (FooModule) FeatureContainer.getInstance().getModuleById("foo");
			//NOTE: Use getTaskName() and NOT getScheduleTaskName(), it's really important
			//We distinguish the two: getTaskName is used internally by the system, where we do 
			//some extra stuff to ensure uniqueness of the task name (prepend moduleID), so we need to
			//make sure to use this when removing tasks!
			//use the static ChangeTrackingAPI to create an instance of ChangeRecord, these are just values you'd like have
			//tracked and store in the changes DB
			ChangeRecord rec = ChangeTrackingAPI.create("openAutoDeveloper", ChangeRecord.CHANGE_TYPE_DELETE, "Dummy Task removed from System",
	                "foo dummy task");
			//insert the record like so

	public long getFrequency() {
		return TWO_MINS;

	protected String getScheduleTaskName() {
		//usually good idea to name your task something descriptive
		return "dummyTask";




変更トラッキング レコード(CMDB)を Cisco UCS Director GUI で表示するには、[管理] > [統合] > [レコードの変更] の順に選択します。