Forum Discussion

nickamon's avatar
nickamon
Icon for Nimbostratus rankNimbostratus
Dec 13, 2023

iControl Rest Create Portal Access Resource with Caption

Hi,

I am using the iControl REST API to create a portal-access resource but there doesn't seem to a attribute of the resource that allows setting the Caption field in the "Customization Settings for English" panel in the UI.  Where can I update this field.  For exampe, I updated this field manually and set a caption in the UI (Access -> Connectivity/VPN: Portal Access : Portal Access Lists -> MyPortalSite) then if I use the REST API to retrieve the resource, the caption is not part of the properties returned from the resource:

 

{
  "kind": "tm:apm:resource:portal-access:portal-accessstate",
  "name": "test-ssh",
  "partition": "local-only",
  "fullPath": "/local-only/test-ssh",
  "generation": 316,
  "selfLink": "https://localhost/mgmt/tm/apm/resource/portal-access/~local-only~test-ssh?expandSubcollections=true",
  "aclOrder": 9,
  "applicationUri": "https://1.1.1.1:2222/ssh/host/1.1.1.1",
  "cssPatching": "false",
  "customizationGroup": "/local-only/test-ssh_resource_web_app_customization",
  "customizationGroupReference": {
    "link": "https://localhost/mgmt/tm/apm/policy/customization-group/~local-only~test-ssh_resource_web_app_customization"
  },
  "ephemeralAuth": "false",
  "flashPatching": "false",
  "htmlPatching": "true",
  "javaPatching": "false",
  "javascriptPatching": "true",
  "linkType": "uri",
  "locationSpecific": "true",
  "patchingType": "full-patch",
  "pathMatchCase": "true",
  "proxyPort": 0,
  "publishOnWebtop": "true",
  "schemePatching": "true",
  "itemsReference": {
    "link": "https://localhost/mgmt/tm/apm/resource/portal-access/~local-only~test-ssh/items",
    "isSubcollection": true,
    "items": [
      {
        "kind": "tm:apm:resource:portal-access:items:itemsstate",
        "name": "item",
        "fullPath": "item",
        "generation": 1,
        "selfLink": "https://localhost/mgmt/tm/apm/resource/portal-access/~local-only~test-ssh/items/item",
        "clientCachingType": "default",
        "compressionType": "gzip",
        "homeTab": "true",
        "host": "1.1.1.1",
        "linkType": "uri",
        "log": "none",
        "order": 1,
        "paths": "/*",
        "port": 2222,
        "scheme": "https",
        "sessionTimeout": "true",
        "sessionUpdate": "true",
        "subnet": "0.0.0.0/0"
      }
    ]
  }
}

 

I check the related customizationGroup resource and that also doesn't contain the caption field.  My goal is to set the caption so a user-friendly label shows up on the webtop.

 

Thanks!

2 Replies

  • The customization system in APM is complicated by the simultaneous support of multiple languages, so you can have a multi-lingual caption depeding on the user's desired language. This multi-language caption information is stored inside an XML file that is linked from the cache-path property (same as all other config objects that refer to files). For example:

    apm policy customization-group /Common/webssh-direct_webssh_resource_customization {
    cache-path /config/filestore/files_d/Common_d/customization_group_d/:Common:webssh-direct_webssh_resource_customization_118064_2
    revision 2
    source /Common/standard
    type resource-webssh
    }

    And the associated cache-path file contents:

    <?xml version="1.0" encoding="UTF-8"?>
    <customization_group name="default_resource_webssh" type="resource_webssh">
    <item language="en">
    <image></image>
    <caption>webssh-direct</caption>
    </item>
    </customization_group>

    You may have to create the file object first (just in the filesystem), then refer to it in the customization group. When doing this kind of thing in TMSH because the resource-item and customization-group are interdependent, you have to create them in a single transaction. I'm not certain if iControl works this same way or requires this transaction treatment.

    • abrahamf5's avatar
      abrahamf5
      Icon for Employee rankEmployee

      Here are the step I followed for an automated approach

      1. Create the xml file that contains the customization details
        1. The best way to do this is to create the resource and manually make the modifications you wish to see
        2. Get the path to the xml file from the customization-group object associated with the above policy resource from the appropriate entry in the bigip.conf file (cache-path attribute)
        3. Copy the xml file.
      2. Upload the xml file to the bigip using "/mgmt/shared/file-transfer/uploads/<file_name>" endpoint
      3. When creating (or modifying) the customization-group object for the resource, use the "local-path" attribute to reference the file uploaded to BigIP in the step above
          "local-path" : "/var/config/rest/downloads/<file_name from step 2> "
      4. "Apply Policy changes"