Update Fleet Server host by ID

PUT /api/fleet/fleet_server_hosts/{itemId}

Headers

  • kbn-xsrf string Required

    Kibana's anti Cross-Site Request Forgery token. Can be any string value.

application/json; Elastic-Api-Version=2023-10-31

Body

Responses

PUT /api/fleet/fleet_server_hosts/{itemId}
curl \
 --request PUT 'http://localhost:5622/api/fleet/fleet_server_hosts/{itemId}' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
 --header "kbn-xsrf: string"
Request examples
# Headers
kbn-xsrf: string

# Payload
{
  "host_urls": [
    "string"
  ],
  "is_default": true,
  "is_internal": true,
  "name": "string",
  "proxy_id": "string"
}
Response examples (200)
{
  "item": {
    "host_urls": [
      "string"
    ],
    "id": "string",
    "is_default": true,
    "is_internal": true,
    "is_preconfigured": true,
    "name": "string",
    "proxy_id": "string"
  }
}
Response examples (400)
{
  "error": "string",
  "message": "string",
  "statusCode": 42.0
}





Headers

  • kbn-xsrf string Required

    Kibana's anti Cross-Site Request Forgery token. Can be any string value.

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31

    OK

    Hide response attributes Show response attributes object
  • 400 application/json; Elastic-Api-Version=2023-10-31

    Generic Error

    Hide response attributes Show response attributes object
POST /api/fleet/service_tokens
curl \
 --request POST 'http://localhost:5622/api/fleet/service_tokens' \
 --header "Authorization: $API_KEY" \
 --header "kbn-xsrf: string"
Response examples (200)
{
  "name": "string",
  "value": "string"
}
Response examples (400)
{
  "error": "string",
  "message": "string",
  "statusCode": 42.0
}



















Headers

  • The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

Query parameters

  • If true and the response contains any privileges that are associated with deprecated features, they are omitted in favor of details about the appropriate replacement feature privileges.

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31

    Indicates a successful call.

GET /api/security/role
curl \
 --request GET 'http://localhost:5622/api/security/role' \
 --header "Authorization: $API_KEY" \
 --header "elastic-api-version: 2023-10-31"
Response examples (200)
[
  {
    "name": "my_kibana_role",
    "kibana": [
      {
        "base": [
          "all"
        ],
        "spaces": [
          "*"
        ],
        "feature": {}
      }
    ],
    "metadata": {
      "version": 1
    },
    "description": "My kibana role description",
    "elasticsearch": {
      "run_as": [],
      "cluster": [],
      "indices": []
    },
    "transient_metadata": {
      "enabled": true
    }
  },
  {
    "name": "my_admin_role",
    "kibana": [],
    "metadata": {
      "version": 1
    },
    "description": "My admin role description",
    "elasticsearch": {
      "cluster": [
        "all"
      ],
      "indices": [
        {
          "names": [
            "index1",
            "index2"
          ],
          "query": "{\\\"match\\\": {\\\"title\\\": \\\"foo\\\"}}",
          "privileges": [
            "all"
          ],
          "field_security": {
            "grant": [
              "title",
              "body"
            ]
          }
        }
      ]
    },
    "transient_metadata": {
      "enabled": true
    }
  }
]



























































































































































































































































































































































































































































































































































































































































































































Get a paginated list of SLOs

GET /s/{spaceId}/api/observability/slos

You must have the read privileges for the SLOs feature in the Observability section of the Kibana feature privileges.

Headers

  • kbn-xsrf string Required

    Cross-site request forgery protection

Path parameters

  • spaceId string Required

    An identifier for the space. If /s/ and the identifier are omitted from the path, the default space is used.

Query parameters

  • kqlQuery string

    A valid kql query to filter the SLO with

  • page integer

    The page to use for pagination, must be greater or equal than 1

    Default value is 1.

  • perPage integer

    Number of SLOs returned by page

    Maximum value is 5000. Default value is 25.

  • sortBy string

    Sort by field

    Values are sli_value, status, error_budget_consumed, or error_budget_remaining. Default value is status.

  • Sort order

    Values are asc or desc. Default value is asc.

  • hideStale boolean

    Hide stale SLOs from the list as defined by stale SLO threshold in SLO settings

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31

    Successful request

    Hide response attributes Show response attributes object
    • page number
    • perPage number
    • results array[object]
      Hide results attributes Show results attributes object
      • budgetingMethod string Required

        The budgeting method to use when computing the rollup data.

        Values are occurrences or timeslices.

      • createdAt string Required

        The creation date

      • description string Required

        The description of the SLO.

      • enabled boolean Required

        Indicate if the SLO is enabled

      • groupBy string | array[string] Required

        optional group by field or fields to use to generate an SLO per distinct value

      • id string Required

        The identifier of the SLO.

      • indicator object Required

        One of:

        Defines properties for a custom query indicator type

        Hide attributes Show attributes
      • instanceId string Required

        the value derived from the groupBy field, if present, otherwise '*'

      • name string Required

        The name of the SLO.

      • objective object Required

        Defines properties for the SLO objective

        Hide objective attributes Show objective attributes object
        • target number Required

          the target objective between 0 and 1 excluded

          Minimum value is 0, maximum value is 100.

        • the target objective for each slice when using a timeslices budgeting method

          Minimum value is 0, maximum value is 100.

        • the duration of each slice when using a timeslices budgeting method, as {duraton}{unit}

      • revision number Required

        The SLO revision

      • settings object Required

        Defines properties for SLO settings.

        Hide settings attributes Show settings attributes object
        • Configure how often the transform runs, default 1m

          Default value is 1m.

        • Prevents the transform from backfilling data when it starts.

          Default value is false.

        • The synch delay to apply to the transform. Default 1m

          Default value is 1m.

      • summary object Required

        The SLO computed data

        Hide summary attributes Show summary attributes object
        • errorBudget object Required
          Hide errorBudget attributes Show errorBudget attributes object
          • consumed number Required

            The error budget consummed, as a percentage of the initial value.

          • initial number Required

            The initial error budget, as 1 - objective

          • isEstimated boolean Required

            Only for SLO defined with occurrences budgeting method and calendar aligned time window.

          • remaining number Required

            The error budget remaining, as a percentage of the initial value.

        • sliValue number Required
        • status string Required

          Values are NO_DATA, HEALTHY, DEGRADING, or VIOLATED.

      • tags array[string] Required

        List of tags

      • timeWindow object Required

        Defines properties for the SLO time window

        Hide timeWindow attributes Show timeWindow attributes object
        • duration string Required

          the duration formatted as {duration}{unit}. Accepted values for rolling: 7d, 30d, 90d. Accepted values for calendar aligned: 1w (weekly) or 1M (monthly)

        • type string Required

          Indicates weither the time window is a rolling or a calendar aligned time window.

          Values are rolling or calendarAligned.

      • updatedAt string Required

        The last update date

      • version number Required

        The internal SLO version

    • total number
  • 400 application/json; Elastic-Api-Version=2023-10-31

    Bad request

    Hide response attributes Show response attributes object
  • 401 application/json; Elastic-Api-Version=2023-10-31

    Unauthorized response

    Hide response attributes Show response attributes object
  • 403 application/json; Elastic-Api-Version=2023-10-31

    Unauthorized response

    Hide response attributes Show response attributes object
  • 404 application/json; Elastic-Api-Version=2023-10-31

    Not found response

    Hide response attributes Show response attributes object
GET /s/{spaceId}/api/observability/slos
curl \
 --request GET 'http://localhost:5622/s/default/api/observability/slos' \
 --header "Authorization: $API_KEY" \
 --header "kbn-xsrf: string"
Response examples (200)
{
  "page": 1,
  "perPage": 25,
  "results": [
    {
      "budgetingMethod": "occurrences",
      "createdAt": "2023-01-12T10:03:19.000Z",
      "description": "My SLO description",
      "enabled": true,
      "groupBy": [
        [
          "service.name"
        ],
        "service.name",
        [
          "service.name",
          "service.environment"
        ]
      ],
      "id": "8853df00-ae2e-11ed-90af-09bb6422b258",
      "indicator": {
        "params": {
          "dataViewId": "03b80ab3-003d-498b-881c-3beedbaf1162",
          "filter": "field.environment : \"production\" and service.name : \"my-service\"",
          "good": "request.latency <= 150 and request.status_code : \"2xx\"",
          "index": "my-service-*",
          "timestampField": "timestamp",
          "total": "field.environment : \"production\" and service.name : \"my-service\""
        },
        "type": "sli.kql.custom"
      },
      "instanceId": "host-abcde",
      "name": "My Service SLO",
      "objective": {
        "target": 0.99,
        "timesliceTarget": 0.995,
        "timesliceWindow": "5m"
      },
      "revision": 2,
      "settings": {
        "frequency": "5m",
        "preventInitialBackfill": true,
        "syncDelay": "5m"
      },
      "summary": {
        "errorBudget": {
          "consumed": 0.8,
          "initial": 0.02,
          "isEstimated": true,
          "remaining": 0.2
        },
        "sliValue": 0.9836,
        "status": "HEALTHY"
      },
      "tags": [
        "string"
      ],
      "timeWindow": {
        "duration": "30d",
        "type": "rolling"
      },
      "updatedAt": "2023-01-12T10:03:19.000Z",
      "version": 2
    }
  ],
  "total": 34
}
Response examples (400)
{
  "error": "Bad Request",
  "message": "Invalid value 'foo' supplied to: [...]",
  "statusCode": 400
}
Response examples (401)
{
  "error": "Unauthorized",
  "message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastics] for REST request [/_security/_authenticate]]: unable to authenticate user [elastics] for REST request [/_security/_authenticate]",
  "statusCode": 401
}
Response examples (403)
{
  "error": "Unauthorized",
  "message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastics] for REST request [/_security/_authenticate]]: unable to authenticate user [elastics] for REST request [/_security/_authenticate]",
  "statusCode": 403
}
Response examples (404)
{
  "error": "Not Found",
  "message": "SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found",
  "statusCode": 404
}
































Spaces

Manage your Kibana spaces.

Space overview








Get shareable references

POST /api/spaces/_get_shareable_references

Collect references and space contexts for saved objects.

Headers

  • The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json; Elastic-Api-Version=2023-10-31

Body

  • objects array[object] Required
    Hide objects attributes Show objects attributes object
POST /api/spaces/_get_shareable_references
curl \
 --request POST 'http://localhost:5622/api/spaces/_get_shareable_references' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
 --header "elastic-api-version: 2023-10-31" \
 --header "kbn-xsrf: true"
Request examples
# Headers
elastic-api-version: 2023-10-31
kbn-xsrf: true

# Payload
{
  "objects": [
    {
      "id": "string",
      "type": "string"
    }
  ]
}












Headers

  • The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

Path parameters

  • id string Required

    The space identifier.

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31

    Indicates a successful call.

GET /api/spaces/space/{id}
curl \
 --request GET 'http://localhost:5622/api/spaces/space/{id}' \
 --header "Authorization: $API_KEY" \
 --header "elastic-api-version: 2023-10-31"
Response examples (200)
{
  "id": "marketing",
  "name": "Marketing",
  "color": null,
  "imageUrl": "",
  "initials": "MK",
  "solution": "es",
  "description": "This is the Marketing Space",
  "disabledFeatures": []
}

Headers

  • The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • id string Required

    The space identifier. You are unable to change the ID with the update operation.

application/json; Elastic-Api-Version=2023-10-31

Body

  • _reserved boolean
  • color string

    The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.

  • A description for the space.

  • disabledFeatures array[string]

    The list of features that are turned off in the space.

    Default value is [] (empty).

  • id string Required

    The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.

  • imageUrl string

    The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.

  • initials string

    One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.

    Maximum length is 2.

  • name string Required

    The display name for the space.

    Minimum length is 1.

  • solution string

    Values are security, oblt, es, or classic.

Responses

  • Indicates a successful call.

PUT /api/spaces/space/{id}
curl \
 --request PUT 'http://localhost:5622/api/spaces/space/{id}' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
 --header "elastic-api-version: 2023-10-31" \
 --header "kbn-xsrf: true"
Request example
Update the marketing space to remove the imageUrl.
{
  "id": "marketing",
  "name": "Marketing",
  "color": null,
  "imageUrl": "",
  "initials": "MK",
  "description": "This is the Marketing Space",
  "disabledFeatures": []
}