Forum Discussion

Gordon_Johnsto1's avatar
Gordon_Johnsto1
Icon for Nimbostratus rankNimbostratus
Jan 25, 2014

List all partitions via iControl REST API?

Hi,

 

How can I get a list of all the partitions on a device using the iControl REST API? I'm looking for the same output as 'list auth partition' in tmsh.

 

I have tried /mgmt/tm/auth/partition which gives a 404, and /mgmt/tm/sys/folder which only queries the selected partition.

 

Thanks,

 

Gordon.

 

3 Replies

  • Julian_Balog_34's avatar
    Julian_Balog_34
    Historic F5 Account

    Hey Gordon,

    First, you can get a full list of the iControl REST API on a given [xyz] namespace, by calling:

    https://device/mgmt/tm/xyz

    So, for example, on the "/" namespace you would call:

    https://device/mgmt/tm/

    or, for the auth/ namespace:

    http://device/mgmt/tm/auth/

    (This way at least you can have an idea of the available REST API within a namespace).

    Regarding your question, the following API:

    https://device/mgmt/tm/sys/folder

    would give you a full list of the available [folder] partitions (as a JSON array), then if you need details on any of them, e.g. "Common", you would call:

    https://device/mgmt/tm/sys/folder/~Common/

    And you should get a similar response with:

    {
    "kind": "tm:sys:folder:folderstate",
    "name": "Common",
    "subPath": "/",
    "fullPath": "/Common",
    "generation": 1,
    "selfLink": "https://localhost/mgmt/tm/sys/folder/~Common?ver=11.5.0",
    "deviceGroup": "none",
    "hidden": "false",
    "inheritedDevicegroup": "true",
    "inheritedTrafficGroup": "true",
    "noRefCheck": "false",
    "trafficGroup": "/Common/traffic-group-1"
    }
    

    I'm not sure if this answers your question, but please post back if you're looking for a different information.

  • Julian_Balog_34's avatar
    Julian_Balog_34
    Historic F5 Account

    Or, if you would be looking at querying the actual disk partitions, the iControl REST API would be:

    https://device/mgmt/tm/sys/disk/

    and then:

    https://device/mgmt/tm/sys/disk/application-volume/

    which would return a response similar to:

    {
    "kind": "tm:sys:disk:application-volume:application-volumecollectionstate",
    "selfLink": "https://localhost/mgmt/tm/sys/disk/application-volume?ver=11.5.0",
    "items": [
        {
            "kind": "tm:sys:disk:application-volume:application-volumestate",
            "name": "afmdata",
            "fullPath": "afmdata",
            "generation": 52,
            "selfLink": "https://localhost/mgmt/tm/sys/disk/application-volume/afmdata?ver=11.5.0",
            "logicalDisk": "HD1",
            "owner": "afm",
            "preservability": "precious",
            "resizeable": "false",
            "size": 3900
        },
        {
            "kind": "tm:sys:disk:application-volume:application-volumestate",
            "name": "mysqldb_HD1.1",
            "fullPath": "mysqldb_HD1.1",
            "generation": 52,
            "selfLink": "https://localhost/mgmt/tm/sys/disk/application-volume/mysqldb_HD1.1?ver=11.5.0",
            "logicalDisk": "HD1",
            "owner": "mysql",
            "preservability": "precious",
            "resizeable": "false",
            "size": 12288,
            "volumeSetVisibilityRestraint": "HD1.1"
        },
        {
            "kind": "tm:sys:disk:application-volume:application-volumestate",
            "name": "mysqldb_HD1.2",
            "fullPath": "mysqldb_HD1.2",
            "generation": 52,
            "selfLink": "https://localhost/mgmt/tm/sys/disk/application-volume/mysqldb_HD1.2?ver=11.5.0",
            "logicalDisk": "HD1",
            "owner": "mysql",
            "preservability": "precious",
            "resizeable": "false",
            "size": 12288,
            "volumeSetVisibilityRestraint": "HD1.2"
        }
    ]
    }
    
  • Hi Julian,

     

    Thanks very much for the assistance. Do I possibly have something misconfigured in my setup because I get a 404 for /mgmt/tm/auth/ and /mgmt/tm/. I am running 11.4.1 HF1

     

    Other stuff like /mgmt/tm/ltm/pool/ is working just fine.

     

    Regarding the partitions, it is a list configuration partitions I am looking for. I don't think I can do this with /mgmt/tm/sys/folder as that's only listing folders for a particular partition?

     

    Thanks,

     

    Gordon