Create an extension

POST /deployments/extensions

Creates the extension. The extensions API supports two types of usage patterns. A). Specify a download_url, http or https URL, where the extension is currently hosted. This will result in extension being copied to elastic repository. B). Create only the extension metadata using the POST endpoint and then use PUT to upload the extension file. Leave the download_url unspecified in this case.

Body Required

the data that creates the extension

  • name string Required

    The extension name. Only ASCII alphanumeric and [_.-] characters allowed

  • The extension description.

  • The URL to download the extension archive.

  • extension_type string Required

    The extension type.

    Values are plugin or bundle.

  • version string Required

    The Elasticsearch version.

Responses

  • The extension that was just created.

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • id string Required

      The extension ID

    • name string Required

      The extension name.

    • The extension description.

    • url string Required

      The extension URL to be used in the plan.

    • The download URL specified during extension creation.

    • extension_type string Required

      The extension type.

      Values are plugin or bundle.

    • version string Required

      The Elasticsearch version.

    • deployments array[string]

      List of deployments using this extension. Up to only 10000 deployments will be included in the list.

    • The extension file metadata.

      Additional properties are allowed.

      Hide file_metadata attributes Show file_metadata attributes object
      • last_modified_date string(date-time)

        The date and time the extension was last modified.

      • size integer(int64)

        The extension file size in bytes.

      • url string(uri)

        The temporary URL to download the extension file. Usable for verification.

  • Could not download the extension from the specified URL. (code: extensions.request_execution_failed)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is extensions.request_execution_failed.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • Your current session does not have a user id associated with it. (code: extensions.no_user_id)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is extensions.no_user_id.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • An extension already exists with the generated id. Please try again. (code: extensions.id_already_exists)

    Hide headers attribute Show headers attribute
    • The error codes associated with the response

      Value is extensions.id_already_exists.

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

POST /deployments/extensions
curl \
 -X POST https://{{hostname}}/api/v1/deployments/extensions \
 -d '{"name":"string","description":"string","download_url":"string","extension_type":"plugin","version":"string"}'
Request examples
{
  "name": "string",
  "description": "string",
  "download_url": "string",
  "extension_type": "plugin",
  "version": "string"
}
Response examples (201)
# Headers
x-cloud-resource-version: string
x-cloud-resource-created: string
x-cloud-resource-last-modified: string

# Payload
{
  "id": "string",
  "name": "string",
  "description": "string",
  "url": "string",
  "download_url": "string",
  "extension_type": "plugin",
  "version": "string",
  "deployments": [
    "string"
  ],
  "file_metadata": {
    "last_modified_date": "2024-05-04T09:42:00+00:00",
    "size": 42,
    "url": "https://example.com"
  }
}
Response examples (400)
# Headers
x-cloud-error-codes: extensions.request_execution_failed

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (404)
# Headers
x-cloud-error-codes: extensions.no_user_id

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (409)
# Headers
x-cloud-error-codes: extensions.id_already_exists

# Payload
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}