原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/usage-api.html, 原文档版权归 www.elastic.co 所有

Usage APIedit

Provides usage information about the installed X-Pack features.

Requestedit

GET /_xpack/usage

Descriptionedit

This API provides information about which features are currently enabled and available under the current license and some usage statistics.

Query parametersedit

master_timeout
(Optional, time units) Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.

Examplesedit

GET /_xpack/usage
{
  "security" : {
    "available" : true,
    "enabled" : false,
    "ssl" : {
      "http" : {
        "enabled" : false
      },
      "transport" : {
        "enabled" : false
      }
    }
  },
  "monitoring" : {
    "available" : true,
    "enabled" : true,
    "collection_enabled" : false,
    "enabled_exporters" : {
      "local" : 1
    }
  },
  "watcher" : {
    "available" : true,
    "enabled" : true,
    "execution" : {
      "actions" : {
        "_all" : {
          "total" : 0,
          "total_time_in_ms" : 0
        }
      }
    },
    "watch" : {
      "input" : {
        "_all" : {
          "total" : 0,
          "active" : 0
        }
      },
      "trigger" : {
        "_all" : {
          "total" : 0,
          "active" : 0
        }
      }
    },
    "count" : {
      "total" : 0,
      "active" : 0
    }
  },
  "graph" : {
    "available" : true,
    "enabled" : true
  },
  "ml" : {
    "available" : true,
    "enabled" : true,
    "jobs" : {
      "_all" : {
        "count" : 0,
        "detectors" : {
          ...
        },
        "created_by" : { },
        "model_size" : {
          ...
        },
        "forecasts" : {
          "total" : 0,
          "forecasted_jobs" : 0
        }
      }
    },
    "datafeeds" : {
      "_all" : {
        "count" : 0
      }
    },
    "data_frame_analytics_jobs" : {
      "_all" : {
        "count" : 0
      }
    },
    "inference" : {
      "ingest_processors" : {
        "_all" : {
          "num_docs_processed" : {
            "max" : 0,
            "sum" : 0,
            "min" : 0
          },
          "pipelines" : {
            "count" : 0
          },
          "num_failures" : {
            "max" : 0,
            "sum" : 0,
            "min" : 0
          },
          "time_ms" : {
            "max" : 0,
            "sum" : 0,
            "min" : 0
          }
        }
      },
      "trained_models" : {
        "_all" : {
          "count" : 0
        }
      }
    },
    "node_count" : 1
  },
  "logstash" : {
    "available" : true,
    "enabled" : true
  },
  "eql" : {
    "available" : true,
    "enabled" : true
  },
  "sql" : {
    "available" : true,
    "enabled" : true,
    "features" : {
      "having" : 0,
      "subselect" : 0,
      "limit" : 0,
      "orderby" : 0,
      "where" : 0,
      "join" : 0,
      "groupby" : 0,
      "command" : 0,
      "local" : 0
    },
    "queries" : {
      "rest" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "cli" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "canvas" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "odbc" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "jdbc" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "odbc32" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "odbc64" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "_all" : {
        "total" : 0,
        "paging" : 0,
        "failed" : 0
      },
      "translate" : {
        "count" : 0
      }
    }
  },
  "rollup" : {
    "available" : true,
    "enabled" : true
  },
  "ilm" : {
    "policy_count" : 3,
    "policy_stats" : [
      ...
    ]
  },
  "slm" : {
    "available" : true,
    "enabled" : true
  },
  "ccr" : {
    "available" : true,
    "enabled" : true,
    "follower_indices_count" : 0,
    "auto_follow_patterns_count" : 0
  },
  "enrich" : {
    "available" : true,
    "enabled" : true
  },
  "transform" : {
    "available" : true,
    "enabled" : true
  },
  "flattened" : {
    "available" : true,
    "enabled" : true,
    "field_count" : 0
  },
  "vectors" : {
    "available" : true,
    "enabled" : true,
    "dense_vector_fields_count" : 0,
    "dense_vector_dims_avg_count" : 0,
    "sparse_vector_fields_count" : 0
  },
  "voting_only" : {
    "available" : true,
    "enabled" : true
  },
  "frozen_indices" : {
    "available" : true,
    "enabled" : true,
    "indices_count" : 0
  },
  "spatial" : {
    "available" : true,
    "enabled" : true
  },
  "analytics" : {
    "available" : true,
    "enabled" : true,
    ...
  }
}