List of Business Services
Is there a way to get the list of Business Services from a command line call? We are trying to see if there is a way we can automate bring down our Inbound Business Services during a fail over.
Thanks
Scott Roth
The Ohio State University Wexner Medical Center
SQL way (query docs, 1 means BS):
Object way:
Constants for Business Host Type (defined in EnsConstants.inc):
Hello Scott,
I was playing around with the EnumerateConfigItems query in the Ens.Config.Production class, and it seems like it might do what you're asking. Below is some basic example code to demonstrate, but of course you should test this out yourself and add proper status checking and error handling before putting it to use.
If you are interested in other fields returned by this query, you can take a closer look at its class reference documentation.
ListBusinessServices() PUBLIC {
Set productionName = "Demo.Loan.FindRateProduction"
Set tStatement = ##class(%SQL.Statement).%New()
Set pStatus = tStatement.%PrepareClassQuery("Ens.Config.Production","EnumerateConfigItems")
Set tResult = tStatement.%Execute(productionName,$$$eHostTypeService)
While tResult.%Next() {
Write !,tResult.%Get("ConfigName")
}
}
Hi,
Check the following code:
II hope it's useful
Best regards,
Francisco Lopez
Is there a way to tell when a Config Item was created within Ens_Config?
Audit table contains all production item changes you can query it once every X minutes/hours to get new changes.
Unfortunately we do not log that Auditing item, as I tried creating a new Operation, but did not see an entry in the Audit log.
Is there anywhere else a Creation Date/Insert date maybe logged for an object?
Enable
%Ensemble/%Production/ModifyConfiguration
in System Audit Events:After that you should see these events:
How do I connect the %SYS to our Production namespace in SQL to tie the date/times to the Class file?
Audit event has a
namespace
property, filter by that.Same for timestamp, audit event timestamp and production class compilation timestamp are probably close to each other.
I meant how do I inner join across namespaces in SQL? I was trying to write a query or use some of the Cache code above to connect the two together for my boss. Thanks
For cross-namespace queries the easiest way is to map packages/globals but that might not be a recommended approach for an audit table.
You can do this:
%SYS.Audit already projects to each namespace, but the data is in a privileged database and requires %Admin_Secure:USE privileges, so better not try to circumvent / confuse that through mappings.
I would not create additional temp tables or mappings to try and cling to SQL as that is meant to run in a single namespace as a query language. This sounds more like a procedural thing for ObjectScript, so a stored procedure that loops through the Production namespaces, retrieves all config items in a local variable and then uses that for querying the audit table after switching to %SYS sounds more appropriate. Rather than a PPG, I'd just collect it in the qHandle local variable passed between Execute() and Fetch() methods for your custom query, unless it risks getting too big