Active IQ Unified Manager Discussions

Short-list the available ENUM values based on the selection of an ENUM value in previous steps

mmodi
3,443 Views

Hi Guys,

I was wondering if there is a way to short-list the available ENUM values based on the selection of an ENUM value in previous steps ?

Note that this is just simple logic, not relying on the cm_storage database or any other technical components....

Example : List Available Protocols based on the platform type which then further allows selecting the protocol to be storage as the variable.

======== Variable Name : Platform, Type : ENUM


  • File_Storage_Windows
  • File_Storage_UNIX
  • File_Storage_Virtualization
  • Block_Storage

======== Variable Name : PrimaryProtocol, Type : ENUM

  • cifs
  • nfs
  • iscsi
  • fcp

Thanks

Modi

1 ACCEPTED SOLUTION

mmodi
3,443 Views

Thanks Michael,

Is there anything you cannot answer 🙂

======= Meanwhile, I had to replace "EQUALS" with "=" to make the logic work :

select

    'cifs' as protocol

from

    dual

WHERE

    '${Platform}' = "File_Storage_Windows"

union

select

    'nfs' as protocol

from

    dual

WHERE

    '${Platform}' = "File_Storage_UNIX"

    OR '${Platform}' = "File_Storage_ESX_Virtualization"

union

select

    'iscsi' as protocol

from

    dual

WHERE

    '${Platform}' = "Block_Storage"

union

select

    'fcp' as protocol

from

    dual

WHERE

    '${Platform}' = "Block_Storage"

View solution in original post

2 REPLIES 2

mgoddard
3,443 Views

Hi Modi,

You could use an SQL Query to generate a query result based on the input of another variable, to make it a dynamic enum of sorts. You'll need to select from a table but there is an in-built temporary table in MySQL and Oracle for this purpose called 'dual'.

Here's an example that would enable cifs/iscsi for *Windows services, iscsi/nfs/fcp for *ESX and iscsi/nfs for *nix (Linux/Unix). You could use equals if you wand an exact match. Just add another OR to the line to create more services that are enabled for each protocol.

select 'cifs' as protocol from dual WHERE '${service}' LIKE "%Windows" union

select 'iscsi' as protocol from dual WHERE '${service}' LIKE "%Windows" OR '${service}' LIKE "%ESX" OR '${service}' LIKE "%nix" union

select 'nfs' as protocol from dual WHERE '${service}' LIKE "%ESX" OR '${service}' LIKE "%nix" union

select 'fcp' as protocol from dual WHERE '${service}' LIKE "%ESX"

Or for the specific example above:

select 'cifs' as protocol from dual WHERE '${Platform}' EQUALS "File_Storage_Windows" union

select 'nfs' as protocol from dual WHERE '${Platform}' EQUALS "File_Storage_UNIX" OR '${Platform}' EQUALS "File_Storage_Virtualization" union

select 'iscsi' as protocol from dual WHERE '${Platform}' EQUALS "Block_Storage" union

select 'fcp' as protocol from dual WHERE '${Platform}' EQUALS "Block_Storage"

It may be better to use technology-specific names, as ESX virtualization would present data stores differently to Hyper-V virtualization for instance.

Kind Regards,

Michael Goddard.

mmodi
3,444 Views

Thanks Michael,

Is there anything you cannot answer 🙂

======= Meanwhile, I had to replace "EQUALS" with "=" to make the logic work :

select

    'cifs' as protocol

from

    dual

WHERE

    '${Platform}' = "File_Storage_Windows"

union

select

    'nfs' as protocol

from

    dual

WHERE

    '${Platform}' = "File_Storage_UNIX"

    OR '${Platform}' = "File_Storage_ESX_Virtualization"

union

select

    'iscsi' as protocol

from

    dual

WHERE

    '${Platform}' = "Block_Storage"

union

select

    'fcp' as protocol

from

    dual

WHERE

    '${Platform}' = "Block_Storage"

Public