Shared parameter APIs

Create new Data Type

This API creates a new Data Type

curl -X POST \
  'https://{TSA_HOSTNAME}/cam/api/v1/datatypes?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  --insecure \
  -d '{
    "name": "DemoOneType",
    "label": "Demo One Type",
    "description": "Datatype for DemoOne",
    "attributes": [
        {
            "name": "hostip",
            "default": "0.0.0.0",
            "regex": "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+",
            "type": "string",
            "required": "true",
            "secured": "false",
            "label": "Host IP address",
            "hidden": "false",
            "immutable": "false"
        },
        {
            "name": "port",
            "description": "Port number",
            "default": "80",
            "range": {
                "min": "80",
                "max": "9999"
            },
            "type": "counter",
            "required": "true",
            "secured": "false",
            "label": "Port",
            "hidden": "false",
            "immutable": "false"
        },
        {
            "name": "username",
            "default": "admin",
            "description": "User name",
            "hidden": false,
            "immutable": false,
            "label": "User Name",
            "required": true,
            "secured": false,
            "type": "string"
        },
        {
            "name": "password",
            "description": "Password for the host",
            "hidden": false,
            "immutable": false,
            "label": "Password",
            "regex": "[\\w]{8}",
            "required": true,
            "secured": true,
            "type": "password"
        }
    ]
}';
  • ROLE:

    ADMINISTRATOR

  • Params:

    {
      name : [string],
      label: [string],
      description : [string],
      attributes : [
      {
        name: [string],
        default: [string],
        type: [string],
        label: [string],
        required: [boolean],
        hidden: [boolean],
        immutable: [boolean],
        secured: [boolean]
      }
     ]
    }
    
  • Success Response:

    • Code: 200 Content: { id : 1, name : "LDAPServer", description: "LDAP server data type", attributes: [...] }
  • Error Response:

    • Code: 400 BAD REQUEST Content: { error : "Data type ${name} already defined." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }

List all Data Types

This API lists all available Data Types.

curl -X GET \
  'https://{TSA_HOSTNAME}/cam/api/v1/datatypes?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  --insecure
  • ROLE:

    ADMINISTRATOR

  • Success Response:

    • Code: 200 Content: [{ id : 1, name : "LDAPServer", description: "LDAP server data type", attributes: [...] }, ...]

Lookup Data Objects (implicit or explicit) for the Data Types specified in the request

curl -X POST \
  'https://{TSA_HOSTNAME}/cam/api/v1/datatypes/lookup?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
  "datatypes" : [
    "DemoOneType"
  ]
}'
  • ROLE:

    tenantMember

  • Params:

    {
      datatypes : [datatype_name1, datatype_name2, ...]
    }
    
  • Success Response:

    • Code: 200 Content:

      Example

      [
        {
          "name": "datatype_name1",
          "label": "datatype_label1",
          "dataobjects": [
          {
          "id": "1234567890",
          "name" : "dataobject name",
          "datatype": "datatype_name1",
          "provider": "IBM"
           }
         ]
        }
      ]
      

Resolve the Data Type variables for the template parameters

POST /datatypes/resolve
  • ROLE:

    tenantMember

  • Params:

    Example:

    {
       "input_dataobjects": [
       {
         "id": "1234567890",
         "name" : "dataobject name",
         "datatype": "datatype_name1",
         "provider": "IBM"
       }
      ],
       "parameters": {
       "template_input_params": [
       {
         "name": "param1",
         "type": "string",
         "default": "${ContentRuntime.output1}",
        }
       ]
      }
    }
    
  • Success Response:

    • Code: 200 Content: { template_input_params: [{ name: 'param1', type: 'string', default: 'output1 value'}]}

Update Data Type

curl -X PUT \
  'https://{TSA_HOSTNAME}/cam/api/v1/datatypes/{{DATATYPE_ID}}?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{"description": "updated description"}'
  • ROLE:

    ADMINISTRATOR

  • URL params:

    datatype ID or datatype name

  • Params:

    The following parameters are optional, for example, if you only want to update the 'attributes' the request body can contain only the 'attributes'.

    {
      name : [string],
      label: [string],
      description: [string],
      attributes:[
       {
        name: [string],
        default: [string],
        type: [string],
        label: [string],
        required: [boolean],
        hidden: [boolean],
        immutable: [boolean],
        secured: [boolean]
        }
      ]
    }
    
  • Success Response:

    • Code: 200 Content: { id : 1, name : "LDAPServer", description: "LDAP server data type", attributes: [...] }
  • Error Response:

    • Code: 400 BAD REQUEST Content: { error : "Data type ${name} already defined." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }

Delete Data Type

curl -X DELETE \
  'https://{TSA_HOSTNAME}/cam/api/v1/datatypes/{{DATATYPE_ID}}?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
  • ROLE:

    ADMINISTRATOR

  • URL params:

    datatype ID or datatype name

  • Success Response:

    • Code: 201 Content: None
  • Error Response:

    • Code: 404 NOT FOUND Content: { error : "Data type ${id} does not exist." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }

Create new Data Object for specific namespace

This API creates a new Data Object.

curl -X POST \
  'https://{TSA_HOSTNAME}/cam/api/v1/dataobjects?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  --insecure \
  -d '{
  "datatype": "DemoOneType",
  "name": "DemoOneObject",
  "namespaceId": "{{NAMESPACE}}",
  "label": "DemoOneObject",
  "attributes": [
    {
      "name": "hostip",
      "value": "127.0.0.1"
    },
    {
      "name": "port",
      "value": 587
    },
    {
      "name": "username",
      "value": "user1"
    },
    {
      "name": "password",
      "value": "test1234"
    }
  ]
}'
  • ROLE:

    ADMINISTRATOR

  • Success Response:

    • Code: 200 Content: { id : 1, name : "LDAPServer.production", description: "My LDAP server for production", attributes:[...] }
  • Error Response:

    • Code: 400 BAD REQUEST Content: { error : "Data object ${name} already defined." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }

Optionally, you can add cloudOE_spaceGuid=${NAMESPACE} query parameter to create the Data Object in the namespace that NAMESPACE resolves to.

Retrieve Data Object

curl -X GET
'https://{TSA_HOSTNAME}/cam/api/v1/dataobjects?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}'
-H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}'
-H 'Content-Type: application/json'
-H 'cache-control: no-cache'
  • ROLE:

    ADMINISTRATOR

  • URL params:

    dataobject ID

  • Success Response:

    • Note: The attributes are merged with the datatype's attributes.
    • Code: 200 Content:
     {
       "id" : 1,
       "name": "production",
       "label": "Production LDAP server",
       "datatype": "com.ibm.cam.ldapserver",
       description: "My LDAP server for production",
       attributes:[
       {
        "name": "ipaddress",
        "value": "127.0.0.1",
        "default": "",
        "type": "string",
        "required": "true",
        "secured": "false",
        "label": "IP address",
        "hidden": "false",
        "immutable": "false"
        },
        {
         "name": "port",
         "value": "367",
         "default": "",
         "type": "string",
         "required": "true",
         "secured": "false",
         "label": "Port",
         "hidden": "false",
         "immutable": "false"
         }
        ]
     }
    
  • Error Response:

    • Code: 400 BAD REQUEST Content: { error : "Data object ${name} already defined." }

    Or

    • Code: 404 NOT FOUND Content: { error : "Data object ${id} does not exist." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }

Optionally, you can add cloudOE_spaceGuid=${NAMESPACE} query parameter to create the Data Object in the namespace that NAMESPACE resolves to.

Update Data Object

curl -X PUT \
  'https://{TSA_HOSTNAME}/cam/api/v1/dataobjects/{{Dataobjects_ID}}?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{"description": "updated description"}'
  • ROLE:

    ADMINISTRATOR

  • URL params:

    dataobject ID

  • Params:

    {
      name: [string],
      label: [string],
      datatype: [string],
      description: [string],
      attributes:[
       {
        // attribute definition
        ...
       }
      ]
    }
    
  • Success Response:

    • Code: 200 Content: { id : 1, name : "LDAPServer.production", description: "My LDAP server for production", attributes:[...] }
  • Error Response:

    • Code: 400 BAD REQUEST Content: { error : "Data object ${name} already defined." }

    Or

    • Code: 404 NOT FOUND Content: { error : "Data object ${id} does not exist." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }

Optionally, you can pass cloudOE_spaceGuid=${NAMESPACE} in the query parameter to change the namespace of the Data Object. The modified namespace value is the value that NAMESPACE resolves to.

Delete Data Object

curl -X DELETE \
  'https://{TSA_HOSTNAME}/cam/api/v1/dataobjects/{{Dataobjects_ID}}?ace_orgGuid=all&cloudOE_spaceGuid=default&tenantId={{TSA_TENANT_ID}}' \
  -H 'Authorization: Bearer {{TSA_BEARER_TOKEN}}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'
  • ROLE:

    ADMINISTRATOR

  • URL params:

    dataobject ID

  • Success Response:

    • Code: 200 Content: { id : 1, name : "LDAPServer.production", description: "My LDAP server for production", attributes:[...] }
  • Error Response:

    • Code: 404 NOT FOUND Content: { error : "Data object ${id} does not exist." }

    Or

    • Code: 401 UNAUTHORIZED Content: { error : "You are unauthorized to make this request." }