Page MenuHomeSoftware Heritage
Paste P240

Index template for swh-scheduler task to archive
ActivePublic

Authored by ardumont on Mar 21 2018, 5:09 PM.
{
"order": 0,
"index_patterns": ["swh-tasks-*"],
"settings": {
"index": {
"number_of_shards": "1",
"codec": "best_compression",
"refresh_interval": "30s"
}
},
"mappings" : {
"task" : {
"_source" : { "enabled": true},
"properties": {
"task_id": {"type": "double"},
"task_policy": {"type": "text"},
"task_status": {"type": "text"},
"task_run_id": {"type": "double"},
"arguments": {
"type": "object",
"properties" : {
"args": {"type": "nested"},
"kwargs": {"type": "object"}
}
},
"type": {"type": "text"},
"backend_id": {"type": "text"},
"metadata": {
"type": "object",
"enabled" : false
},
"scheduled": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"
},
"started": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"
},
"ended": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"
}
}
}
},
"aliases": {}
}

Event Timeline

Sounds about right:

$ curl -i -H'Content-Type: application/json' -d@${SWH_ENVIRONMENT_HOME}/swh-scheduler/data/elastic-template.json -XPUT http://localhost:9200/_template/template_swh_tasks
HTTP/1.1 100 Continue

HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 21

{"acknowledged":true}%
$ curl  http://localhost:9200/_template/template_swh_tasks  | jq . 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   835  100   835    0     0     66      0  0:00:12  0:00:12 --:--:--   249
{
  "template_swh_tasks": {
    "order": 0,
    "index_patterns": [
      "swh-tasks-*"
    ],
    "settings": {
      "index": {
        "number_of_shards": "1",
        "codec": "best_compression",
        "refresh_interval": "30s"
      }
    },
    "mappings": {
      "task": {
        "_source": {
          "enabled": true
        },
        "properties": {
          "task_id": {
            "type": "double"
          },
          "task_policy": {
            "type": "text"
          },
          "task_status": {
            "type": "text"
          },
          "task_run_id": {
            "type": "double"
          },
          "arguments": {
            "type": "object",
            "enabled": false
          },
          "type": {
            "type": "text"
          },
          "backend_id": {
            "type": "text"
          },
          "metadata": {
            "type": "object",
            "enabled": false
          },
          "scheduled": {
            "type": "date",
            "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"
          },
          "started": {
            "type": "date",
            "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"
          },
          "ended": {
            "type": "date",
            "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||strict_date_optional_time||epoch_millis"
          }
        }
      }
    },
    "aliases": {}
  }
}
ardumont changed the title of this paste from wip - index template for swh-scheduler task to Index template for swh-scheduler task to archive.Mar 22 2018, 2:19 PM