Use custom attributes

You can use the API custom attribute definitions to create, update, or delete a field for an APPLICATION, PARTNER, COMPROFILE, or FLOW resource.

After creating a custom attribute definition for a specific resource, a new field displays in the custom attributes section of either the API or the Central Governance UI, where:

  • For each custom attribute definition with an APPLICATION scope, a field is created in the Central Governance UI.
  • PARTNER and FLOW custom attributes are managed exclusively from the API.

Custom attribute definitions resource

A custom attribute definition is uniquely identified by scope and name, where the name is the new field to create in the entity, and the maximum length defines the upper limit of the value that can be entered in this field.

Create a custom attribute definition for APPLICATION

This example sets the name of the new field to custom_attr1, the entity type to APPLICATION, and that the length of the value entered in this field cannot exceed 100 characters.

POST /api/v2/customattibutedefinitions

{

  "name": "custom_attr1",

  "description": "My custom attribute",

  "scope": "APPLICATION",

  "tags": [

    "tag1","tag2"

  ],

  "maxLength": 100

}

Retrieve a custom attribute definition

GET /api/v2/customattibutedefinitions?tags=tag1

Delete a custom attribute definition

To delete a custom attribute definition when the custom attribute value is used in a flow, set the _forced parameter to true.

DELETE /api/v2/customattibutedefinitions?name=custom_attr2&_forced=true

Filter the custom attribute definitions to be deleted by name or tags. You cannot use the DELETE command without parameters.

Update a custom attribute definition

You can change the description and tags for custom attribute definitions.

PUT /api/v2/customattibutedefinitions/eefed3e4-c00a-4874-9f66-ba14af092e43&_forced=true

{

  "name": "custom_attr1",

  "description": "My custom attribute new description",

  "scope": "APPLICATION",

  "tags": [

    "tag1",”tag2”

  ],

  "maxLength": 100

}

Update a custom attribute value using the API applications resource

You can use the API applications resource to set the value of a custom attribute in an application.

PUT /api/v2/applications/478051f1-e440-4009-8d67-4c25055e792f

{

    "name": "app1",

    "contact": {},

    "host": "qaf-cg-3.lab.buch.axway.int",

    "productTypes": [

      "Transfer CFT"

    ],

    "products": [

      {

        "businessId": "d36cd79e-d47a-48cf-ba62-5f73a4324292",

        "name": "qaf-cg-3_perf"

      }

    ],

    "customAttributes": {

      "custom_attr1": "directory1/conf"

    }

  }

You can also update the custom attribute value for an application from the Central Governance user interface.

Retrieve an application where the custom attribute has a specific value

Use the following syntax to filter for applications that use a custom attribute that has a specific value:

GET /applications?customAttributeFilter="<custAttrName1>=<AttrValue>&<custAttrName2>=<AttrValue>"

Example

To retrieve all applications that have a custom_attr1 with a value of directory1/conf:

GET /applications?customAttributeFilter="custom_attr1=directory1/conf"

Create a custom attribute definition for PARTNER

POST /api/v2/customattibutedefinitions

{ "name": "custom_attr_partner",

  "description": "My custom partner attribute",

  "scope": "PARTNER",

  "tags": [

 "tag1","tag2"

 ],

 "maxLength": 50

}

Create a custom attribute definition for COMPROFILE

The following example illustrates adding a new field named com_profile_owner, where the entity type is COMPROFILE, and the tags (tag1, tag2) allow you to search for this resource. The definition additionally specifies that the maximum length of this field's value cannot exceed 100 characters.

POST /api/v2/customattibutedefinitions

{ "name": "com_profile_owner",

"description": "Person in charge for this communication profile",

"scope": "COMPROFILE",

"tags": [

"tag1","tag2"

],

"maxLength": 100

}

You can then use this custom attribute definition in a partner or product communication profile.

Note The new custom attribute field does not appear when retrieving the communication profile if you have not yet assigned a value to the field (e.g. John in the following example).

POST /api/v2/products/product_businessID/communicationprofiles

{

"customAttributes": {

"com_profile_owner": "John",

},

"name": "sftp1",

"type": "SERVER",

"protocol": "SFTP",

"enabled": true,

"clientAuthentication": "PUBLIC_KEY",

"fipsEnabled": false,

"keyAlias": "John.pub.p8",

"keyContent": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0udXQyAGXxyhHdRsh+UCXtEnKmWWQ95UlourzvqB0NG2RxjgNRUNWwYji/EqvsnjTH+A/k26XqEWOQFwyecjfCpC0Yu5jaHEKwP2s0tq1OLjvUNYQsUovtqDQYyNHt6SOzYT44AZ9w5jomD8KLfhoVt1/wilfJiFcRi26ABFCcLdhRd3Ct74rd8pCdujYwJLlwEGJ060HyPYqrx2iKVVkC+0tJGlpAMZbU6lbQbOej1fbxvY2lBGeGJRReFgR0H3Szr5hMKp32wMiuqeiH2LvFMRg3H+W63H5pDnsnQ+agizEyPWftH9VnPV1wKz6ZZUd42via89hhstw2wDWlm0CwIDAQAB",

"hosts": [

"h2"

],

"port": 2

}

Create a custom attribute definition for FLOW

POST /api/v2/customattibutedefinitions

{ "name": "source_approved_flow",

 "description": "Source Transfer CFT user approves the flow",

 "scope": "FLOW",

 "tags": [

 "flow1","flow2"

 ],

 "maxLength": 80

}

Use custom attributes in a flow

You can use the application custom attribute as a variable in any text field for a flow's source or for target properties.

The syntax is:

{%application.custom_attribute_name%}

When the flow is deployed, for each application in the source or target, the variable is replaced by the application-specific value.

The text field can also contain characters other than the custom attribute.

After deploying the flow, each time an application is edited you are warned about the potential impact if one of the custom attributes that is used in a flow is changed.

Example

  1. Create a flow with applications a1 and a2 as source, and the application a3 as target. The working directory field takes a different value for each application:
    • a1 has a custom attribute custom_attr1 set to "directory1/conf"
    • a2 has a custom attribute custom_attr1 that is not set
    • The flow has a custom attribute source_approved_flow set to “approved”.

  2. On the Transfer CFT linked to the application a1, the value directory1/conf/txt is deployed. On the Transfer CFTs linked to a2 and a3, no value is deployed. Furthermore, when the flow is deployed, the value given to the flow custom attribute is not deployed.

POST /flows

{

"customAttributes": {

"source_approved_flow": "approved",

},

    "name": "flow_custom_attributes",

    "sources": {

      "type": "APPLICATION",

      "parts": [

        {

          "part": {

            "businessId": "a6d3ebd6-222f-4cfd-b16c-c33dcdb3cb95",

            "name": "a1"

          },

          "selectedLinks": [

            {

              "businessId": "51801433-eb48-47c1-a680-22e9a5740105",

              "name": "CFTcgcore3-01"

            }

          ]

        },

        {

          "part": {

            "businessId": "bf8f8c16-9243-404c-8f27-b17a4c08c92e",

            "name": "a2"

          },

          "selectedLinks": [

            {

              "businessId": "0119f93d-adba-4083-a614-a529d6f2ca56",

              "name": "CFTcgcore3-02"

            }

          ]

        }

      ],

      "step": {

        "commonProperties": {

          "transfer": {

          },

          "file": {

            "physicalFile": "File",

            "path": "",

            "workingDir": "{%application.custom_attr1%}/txt",

            "fileList": "",

            "archiveName": "",

            "sentFileName": "",

            "fileType": "Binary",

            "fileTypeOS400": "D",

            "fileTypeZOS": "auto",

            "fileTypeHPNonStop": "B",

            "recordFormat": " ",

            "endOfRecordChar": "Both",

            "ignoreEOFChar": false,

            "encoding": "ascii",

            "encodingCharset": "",

            "transcoding": "ascii",

            "transcodingCharset": "",

            "transcodingTable": "",

            "encodingOS400": "ebcdic",

            "encodingOS400Charset": "",

            "transcodingOS400": "none",

            "transcodingOS400Charset": "",

            "transcodingOS400Table": "",

            "encodingZOS": "ebcdic",

            "encodingZOSCharset": "",

            "transcodingZOS": "none",

            "transcodingZOSCharset": "",

            "transcodingZOSTable": "",

            "encodingHPNonStop": "ascii",

            "encodingHPNonStopCharset": "",

            "transcodingHPNonStop": "none",

            "transcodingHPNonStopCharset": "",

            "transcodingHPNonStopTable": "",

            "unpaddingChar": "",

            "maxRecordLength": "0",

            "defaultMaxRecordLength": true,

            "filter": "",

            "filterType": "NONE",

            "enableCustomProperties": false

          },

          "script": {

          }

        },

        "middlewareIds": [

          "51801433-eb48-47c1-a680-22e9a5740105",

          "0119f93d-adba-4083-a614-a529d6f2ca56"

        ],

        "routes": [],

        "propertiesForSources": [],

        "propertiesForTargets": []

      }

    },

    "targets": {

      "type": "APPLICATION",

      "parts": [

        {

          "part": {

            "businessId": "e6de466b-4bce-4a72-83c2-e8cd49c91d51",

            "name": "a3"

          },

          "selectedLinks": [

            {

              "businessId": "76b4bd5a-3d0d-460c-bc46-dbe605c21dae",

              "name": "CFTcgcore3-03"

            }

          ]

        }

      ],

      "step": {

        "commonProperties": {

          "transfer": {

          },

          "file": {

          },

          "script": {

          }

        },

        "middlewareIds": [

          "76b4bd5a-3d0d-460c-bc46-dbe605c21dae"

        ],

        "routes": [],

        "propertiesForSources": [],

        "propertiesForTargets": []

      }

    },

    "protocols": [

      {

        "id": 1,

        "protocol": "PESIT",

        "direction": "SENDER_PUSH_FILE",

        "properties": {

          "securityProfile": "NONE",

          "defaultIdentifier": "flow_idf",

          "showComprofiles": "false",

          "networkProtocol": "TCP"

        }

      }

    ]

  }

 

 

Central Governance | Document Directory

Related Links