Uploaded image for project: 'FTS'
  1. FTS
  2. FTS-1666

Handle string input for params::job_metadata in REST API

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: fts-rest 3.10.0
    • Component/s: REST API
    • Security Level: Public Data (This ticket is visible to anyone on the internet and will be indexed by search engines)
    • Labels:
      None

      Description

      Starting with version 3.10, FTS-REST expects the params::job_metadata API field to be a JSON object.

      However, the documentation on this is mixed, allowing both string and JSON format. [1]

      Since version 3.10 appends the auth_method to the job metadata, internally, it should be treated as JSON. In case a string is received, it should be converted into a JSON object, attributing the received string to the label key.

      The following submission currently fails.
      Example:

      {
        "files": [
          {
            "sources": [
              "root://eospublic.cern.ch//eos/opstest/dteam/test_512MB"
            ],
            "destinations": [
              "root://eospublic.cern.ch/eos/opstest/dteam/mipatras/file.test"
            ]
          }
        ],
        "params": {
          "job_metadata": "Test Job Submission"
        }
      }
      

      However, sending a JSON object for params::job_metadata will work.
      Example:

       {
        "files": [
          {
            "sources": [
              "root://eospublic.cern.ch//eos/opstest/dteam/test_512MB"
            ],
            "destinations": [
              "root://eospublic.cern.ch/eos/opstest/dteam/mipatras/file.test"
            ]
          }
        ],
        "params": {
          "job_metadata": {
            "label": "Test Job Submission"
          }
        }
      }
      

      [1] http://fts3-docs.web.cern.ch/fts3-docs/fts-rest/docs/bulk.html

        Attachments

          Activity

            People

            Assignee:
            mipatras Mihai Patrascoiu
            Reporter:
            mipatras Mihai Patrascoiu
            Component Watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: