diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index b18506f481735..0266455fb56cf 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -251,7 +251,14 @@ "type": "string" }, "type": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/kibana_saved_object_type" + }, + { + "$ref": "#/components/schemas/elasticsearch_asset_type" + } + ] } }, "required": [ @@ -1689,6 +1696,32 @@ "path" ] }, + "kibana_saved_object_type": { + "title": "Kibana saved object asset type", + "type": "string", + "enum": [ + "dashboard", + "visualization", + "search", + "index-pattern", + "map", + "lens", + "ml-module", + "security-rule" + ] + }, + "elasticsearch_asset_type": { + "title": "Elasticsearch asset type", + "type": "string", + "enum": [ + "component_template", + "ingest_pipeline", + "index_template", + "ilm_policy", + "transform", + "data_stream_ilm_policy" + ] + }, "agent_type": { "type": "string", "title": "Agent type", diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index a9f5855b1ed59..0bc67a311520a 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -162,7 +162,9 @@ paths: id: type: string type: - type: string + oneOf: + - $ref: '#/components/schemas/kibana_saved_object_type' + - $ref: '#/components/schemas/elasticsearch_asset_type' required: - id - type @@ -1059,6 +1061,28 @@ components: - format_version - download - path + kibana_saved_object_type: + title: Kibana saved object asset type + type: string + enum: + - dashboard + - visualization + - search + - index-pattern + - map + - lens + - ml-module + - security-rule + elasticsearch_asset_type: + title: Elasticsearch asset type + type: string + enum: + - component_template + - ingest_pipeline + - index_template + - ilm_policy + - transform + - data_stream_ilm_policy agent_type: type: string title: Agent type diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/elasticsearch_asset_type.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/elasticsearch_asset_type.yaml new file mode 100644 index 0000000000000..19b3328d78346 --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/elasticsearch_asset_type.yaml @@ -0,0 +1,9 @@ +title: Elasticsearch asset type +type: string +enum: + - component_template + - ingest_pipeline + - index_template + - ilm_policy + - transform + - data_stream_ilm_policy diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/kibana_saved_object_type.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/kibana_saved_object_type.yaml new file mode 100644 index 0000000000000..4ec82e7507166 --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/components/schemas/kibana_saved_object_type.yaml @@ -0,0 +1,11 @@ +title: Kibana saved object asset type +type: string +enum: + - dashboard + - visualization + - search + - index-pattern + - map + - lens + - ml-module + - security-rule diff --git a/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml b/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml index e92508a8d14f3..5b534fe3ec51c 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/epm@packages@{pkgkey}.yaml @@ -80,7 +80,9 @@ delete: id: type: string type: - type: string + oneOf: + - $ref: ../components/schemas/kibana_saved_object_type.yaml + - $ref: ../components/schemas/elasticsearch_asset_type.yaml required: - id - type