Ce contenu n'est pas disponible dans la langue sélectionnée.
12.6. Operations
12.6.1. Starting and Stopping a Resource Copier lienLien copié sur presse-papiers!
Example 12.16. Simple Start
Example 12.17. Starting an Array 1
Example 12.18. Starting an Array 2
12.6.2. Scheduling Operations Copier lienLien copié sur presse-papiers!
Example 12.19. 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 12.20. Scheduled Operation Example
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.3]
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.3]
12.6.3. Retrieving the Results of an Operation Copier lienLien copié sur presse-papiers!
fetchResults(true)
method can be used to return the results of the operation as part of the search for the operation history.
Example 12.21. 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;
}
12.6.4. Checking a Resource's Operations History Copier lienLien copié sur presse-papiers!
Example 12.22. Viewing the Operation History
resource results ----------------------------------------------------------------------------------------------------------------- Resource[id=10008, uuid=e11390ec-34c4-49df-a4b6-c37c516f545c, type={RHQAgent}RHQ Agent, key=server.example.com RHQ Age Configuration[id=13903] Resource[id=10008, uuid=e11390ec-34c4-49df-a4b6-c37c516f545c, type={RHQAgent}RHQ Agent, key=server.example.com RHQ Age Configuration[id=13913] 2 rows
resource results
-----------------------------------------------------------------------------------------------------------------
Resource[id=10008, uuid=e11390ec-34c4-49df-a4b6-c37c516f545c, type={RHQAgent}RHQ Agent, key=server.example.com RHQ Age Configuration[id=13903]
Resource[id=10008, uuid=e11390ec-34c4-49df-a4b6-c37c516f545c, type={RHQAgent}RHQ Agent, key=server.example.com RHQ Age Configuration[id=13913]
2 rows