How to find UUIDs of an instance and database?
Hi,
First of all, do Cache instance and databases have UUIDs? If so, is there a simple way to obtain these from command line?
Thanks,
Raghu
Hi,
First of all, do Cache instance and databases have UUIDs? If so, is there a simple way to obtain these from command line?
Thanks,
Raghu
The instance is assigned a GUID that you can retrieve using the InstanceGUID() method of the %SYS.System class:
USER>w ##class(%SYS.System).InstanceGUID() C74E6F76-F21F-11E6-9BB8-A860B607521C
Databases are not assigned such an identifier.
Thanks for quick response.
Now, I am trying to run the following code on a Linux box as follows (CACHE is the instance name):
"csession CACHE -U"%SYS" "w ##class(%SYS.System).InstanceGUID()"
but it results in "<INVALID ARGUMENT>". Is this correct way of running objectscript code on Linux? Sorry if this comes across as a silly question but I am just getting familiar with Cache and its concepts.
Thanks,
Raghu
First run:
Then:
As %SYS is a % package it is available in every namespace.
As the last argument, you should use routine or classmethod, not command.
You can get an output from a Caché routine provided it do some output to its principal device (= stdout), e.g. (approach #1):
as there is no way to pass an arbitrary text from COS routine to OS directly. To bypass it, just incorporate into your shell script a calling sequence like this (approach #2):
After calling it, you will get output.txt like this:
(Missing 'halt' command causes an error). All you have to do is to parse an output. To avoid this, you may want to write a small wrapper in COS that will provide an output as you need it, than you'll be able to follow an approach #1.
HTH.
Just to complete an exercise:
Excellent. Thanks to everyone who chimed in. Much appreciated.
Raghu.