DX NetOps

  • 1.  Spectrum REST Using Partial Attribute Name

    Posted 01-25-2016 02:25 PM

    I understand I can use REST to retrieve specific attributes for a specific device.  Is there a way to get all attributes whose name contains "_thresh" for a specific device (or collection)?  This would give me all of the threshold attributes for the device preventing me from needing to "pick" a specific list of attributes.  If I cannot do this from a device query is there a way using either CLI or REST to get a list of the attributes (with the corresponding code value) that I can, then, use to do the device query?



  • 2.  Re: Spectrum REST Using Partial Attribute Name

    Posted 01-28-2016 04:55 PM

    The only thing I can think of is if you are in vnmsh and you know what model type you want attributes for try this:

     

    [spectrum@sp00primls vnmsh]$ ./connect
    
    Starting CLI Local Server VnmShd
    SPECTRUM Command Line Interface 10.1.0.000
    
    Copyright 2016 CA Technologies All Rights Reserved
    
    CA Technologies
    One CA Plaza
    Islandia, NY  11749 USA
    +1 (800) 225-5224
    
    connect: successful sp00primls
    current landscape is 0x100000
    
    WARNING:  CLI is a powerful tool that allows a user to make changes
    directly to the SPECTRUM knowledge-base without the error checking
    provided by OneClick.  Please read the accompanying CLI user
    documentation before using the create, destroy, or update commands.
    
    [spectrum@sp00primls vnmsh]$ export CLIMNAMEWIDTH=64
    
    [spectrum@sp00primls vnmsh]$ ./show models | grep -i Online
    0x100008    OnLineBackup                                                      0x10403    OnLineBackup
    
    [spectrum@sp00primls vnmsh]$ ./show attributes mh=0x100008 | grep -i 'backup'
    0x10000    Modeltype_Name                                        OnLineBackup
    0x1006e    Model_Name                                            OnLineBackup
    0x1154b    Normal_View_Type                                      OnLineBackup/CsObConfig.30
    0x11a6d    BackupNow                                             FALSE
    0x11a6e    AutomaticBackups                                      FALSE
    0x11a6f    CompressBackup                                        TRUE
    0x11a70    BackupIntervalHour                                    24
    0x11a71    BackupIntervalMinute                                  0
    0x11a72    BackupFileNamePrefix                                  db_
    0x11a73    BackupDirectory                                       /opt/spectrum/SS-DB-Backup
    0x11a75    NextBackupDateTime                                    0
    0x11a76    BackupStatus                                          0
    0x11a77    BackupNumber                                          0
    [spectrum@sp00primls vnmsh]$
    

     

    Basically I'm looking at all backup attributes for the OnLineBackup model. Note the grep looks for case-insensitive 'backup'. You will get some attributes with the phrase in it which doesn't apply (like the first 3 in the list) but at least you see the others!

     

    Hope this helps.