Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
7. Operations
7.1. Starting and Stopping a Resource Link kopierenLink in die Zwischenablage kopiert!
start() function.
Example 13. Simple Start
operations method to list the available operations.
Example 14. Starting an Array 1
Example 15. Starting an Array 2
7.2. Scheduling Operations Link kopierenLink in die Zwischenablage kopiert!
Example 16. Immediate Operation
- The resource ID
- The operation name
- A delay period, meaning when in the future to start the operation (optional)
- A repeat interval and count (optional)
- A timeout period (optional)
- Configuration parameters, if required by the operation
- A description of the scheduled operation (optional)
Example 17. Scheduled Operation Example
rhqadmin@localhost:7080$ exec -f /export/myscripts/test.js
ResourceOperationSchedule:
resource: Resource[id=10008, uuid=e11390ec-34c4-49df-a4b6-c37c516f545c, type={RHQAgent}RHQ Agent, key=server.example.com RHQ Agent, name=RHQ Agent, parent=server.example.com, version=3.1.2]
rhqadmin@localhost:7080$ exec -f /export/myscripts/test.js
ResourceOperationSchedule:
resource: Resource[id=10008, uuid=e11390ec-34c4-49df-a4b6-c37c516f545c, type={RHQAgent}RHQ Agent, key=server.example.com RHQ Agent, name=RHQ Agent, parent=server.example.com, version=3.1.2]
7.3. Retrieving the Results of an Operation Link kopierenLink in die Zwischenablage kopiert!
fetchResults(true) method can be used to return the results of the operation as part of the search for the operation history.
Example 18. Printing the Results of a Process Scan
if (args.length != 1) {
throw "we need a resource id as an argument";
}
var platform = ResourceManager.getResource(args[0]);
if (args.length != 1) {
throw "we need a resource id as an argument";
}
var platform = ResourceManager.getResource(args[0]);
fetchResults(true), which is required to include the operation result data and not just the status- a sort method, in this case
addSortStartTime
} else {
pretty.print(operations.get(0).getResults());
break;
}
} else {
pretty.print(operations.get(0).getResults());
break;
}
7.4. Checking a Resource's Operations History Link kopierenLink in die Zwischenablage kopiert!
Example 19. Viewing the Operation History
Configuration objects in the results table.