{
   "apiVersion":"0.0.1",
   "swaggerVersion":"1.2",
   "basePath":"{{Protocol}}://{{Host}}",
   "resourcePath":"/tasks",
   "produces":[
      "application/json"
   ],
   "apis":[
      {
         "path":"/tasks/compaction/keyspace_compaction/{keyspace}",
         "operations":[
            {
               "method":"POST",
               "summary":"Forces major compaction of a single keyspace asynchronously, returns uuid which can be used to check progress with task manager",
               "type":"string",
               "nickname":"force_keyspace_compaction_async",
               "produces":[
                  "application/json"
               ],
               "parameters":[
                  {
                     "name":"keyspace",
                     "description":"The keyspace to query about",
                     "required":true,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"path"
                  },
                  {
                     "name":"cf",
                     "description":"Comma-separated table (column family) names",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"query"
                  },
                  {
                     "name":"flush_memtables",
                     "description":"Controls flushing of memtables before compaction (true by default). Set to \"false\" to skip automatic flushing of memtables before compaction, e.g. when tables were flushed explicitly before invoking the compaction api.",
                     "required":false,
                     "allowMultiple":false,
                     "type":"boolean",
                     "paramType":"query"
                  },
                  {
                     "name":"consider_only_existing_data",
                     "description":"Set to \"true\" to flush all memtables and force tombstone garbage collection to check only the sstables being compacted (false by default). The memtable, commitlog and other uncompacted sstables will not be checked during tombstone garbage collection.",
                     "required":false,
                     "allowMultiple":false,
                     "type":"boolean",
                     "paramType":"query"
                  }
               ]
            }
         ]
      },
      {
         "path":"/tasks/compaction/keyspace_cleanup/{keyspace}",
         "operations":[
            {
               "method":"POST",
               "summary":"Trigger a cleanup of keys on a single keyspace asynchronously, returns uuid which can be used to check progress with task manager",
               "type": "string",
               "nickname":"force_keyspace_cleanup_async",
               "produces":[
                  "application/json"
               ],
               "parameters":[
                  {
                     "name":"keyspace",
                     "description":"The keyspace to query about",
                     "required":true,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"path"
                  },
                  {
                     "name":"cf",
                     "description":"Comma-separated table (column family) names",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"query"
                  }
               ]
            }
         ]
      },
      {
         "path":"/tasks/compaction/keyspace_offstrategy_compaction/{keyspace}",
         "operations":[
            {
               "method":"POST",
               "summary":"Perform offstrategy compaction, if needed, in a single keyspace asynchronously, returns uuid which can be used to check progress with task manager",
               "type":"string",
               "nickname":"perform_keyspace_offstrategy_compaction_async",
               "produces":[
                  "application/json"
               ],
               "parameters":[
                  {
                     "name":"keyspace",
                     "description":"The keyspace to operate on",
                     "required":true,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"path"
                  },
                  {
                     "name":"cf",
                     "description":"Comma-separated table (column family) names",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"query"
                  }
               ]
            }
         ]
      },
      {
         "path":"/tasks/compaction/keyspace_scrub/{keyspace}",
         "operations":[
            {
               "method":"GET",
               "summary":"Scrub (deserialize + reserialize at the latest version, resolving corruptions if any) the given keyspace asynchronously, returns uuid which can be used to check progress with task manager. If columnFamilies array is empty, all CFs are scrubbed. Scrubbed CFs will be snapshotted first, if disableSnapshot is false. Scrub has the following modes: Abort (default) - abort scrub if corruption is detected; Skip (same as `skip_corrupted=true`) skip over corrupt data, omitting them from the output; Segregate - segregate data into multiple sstables if needed, such that each sstable contains data with valid order; Validate - read (no rewrite) and validate data, logging any problems found.",
               "type": "string",
               "nickname":"scrub_async",
               "produces":[
                  "application/json"
               ],
               "parameters":[
                  {
                     "name":"disable_snapshot",
                     "description":"When set to true, disable snapshot",
                     "required":false,
                     "allowMultiple":false,
                     "type":"boolean",
                     "paramType":"query"
                  },
                  {
                     "name":"skip_corrupted",
                     "description":"When set to true, skip corrupted",
                     "required":false,
                     "allowMultiple":false,
                     "type":"boolean",
                     "paramType":"query"
                  },
                  {
                     "name":"scrub_mode",
                     "description":"How to handle corrupt data (overrides 'skip_corrupted'); ",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "enum":[
                        "ABORT",
                        "SKIP",
                        "SEGREGATE",
                        "VALIDATE"
                     ],
                     "paramType":"query"
                  },
                  {
                     "name":"quarantine_mode",
                     "description":"Controls whether to scrub quarantined sstables (default INCLUDE)",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "enum":[
                        "INCLUDE",
                        "EXCLUDE",
                        "ONLY"
                     ],
                     "paramType":"query"
                  },
                  {
                     "name":"keyspace",
                     "description":"The keyspace to query about",
                     "required":true,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"path"
                  },
                  {
                     "name":"cf",
                     "description":"Comma-separated table (column family) names",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"query"
                  }
               ]
            }
         ]
      },
      {
         "path":"/tasks/compaction/keyspace_upgrade_sstables/{keyspace}",
         "operations":[
            {
               "method":"GET",
               "summary":"Rewrite all sstables to the latest version. Unlike scrub, it doesn't skip bad rows and do not snapshot sstables first asynchronously, returns uuid which can be used to check progress with task manager.",
               "type": "string",
               "nickname":"upgrade_sstables_async",
               "produces":[
                  "application/json"
               ],
               "parameters":[
                  {
                     "name":"keyspace",
                     "description":"The keyspace",
                     "required":true,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"path"
                  },
                  {
                     "name":"exclude_current_version",
                     "description":"When set to true exclude current version",
                     "required":false,
                     "allowMultiple":false,
                     "type":"boolean",
                     "paramType":"query"
                  },
                  {
                     "name":"cf",
                     "description":"Comma-separated table (column family) names",
                     "required":false,
                     "allowMultiple":false,
                     "type":"string",
                     "paramType":"query"
                  }
               ]
            }
         ]
      }
   ]
}
