import { JsonObject } from '@backstage/types'; /** * The parts of the format that's common to all versions/kinds of entity. * * @remarks * * See also: * {@link https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/} * @public */ export type Entity = { /** * The version of specification format for this particular entity that * this is written against. */ apiVersion: string; /** * The high level entity type being described. */ kind: string; /** * Metadata related to the entity. */ metadata: EntityMeta; /** * The specification data describing the entity itself. */ spec?: JsonObject; /** * The relations that this entity has with other entities. */ relations?: EntityRelation[]; }; /** * Metadata fields common to all versions/kinds of entity. * * @remarks * * See also: * {@link https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#objectmeta-v1-meta} * {@link https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/} * * @public */ export type EntityMeta = JsonObject & { /** * A globally unique ID for the entity. * * This field can not be set by the user at creation time, and the server * will reject an attempt to do so. The field will be populated in read * operations. The field can (optionally) be specified when performing * update or delete operations, but the server is free to reject requests * that do so in such a way that it breaks semantics. */ uid?: string; /** * An opaque string that changes for each update operation to any part of * the entity, including metadata. * * This field can not be set by the user at creation time, and the server * will reject an attempt to do so. The field will be populated in read * operations. The field can (optionally) be specified when performing * update or delete operations, and the server will then reject the * operation if it does not match the current stored value. */ etag?: string; /** * The name of the entity. * * Must be unique within the catalog at any given point in time, for any * given namespace + kind pair. This value is part of the technical * identifier of the entity, and as such it will appear in URLs, database * tables, entity references, and similar. It is subject to restrictions * regarding what characters are allowed. * * If you want to use a different, more human readable string with fewer * restrictions on it in user interfaces, see the `title` field below. */ name: string; /** * The namespace that the entity belongs to. */ namespace?: string; /** * A display name of the entity, to be presented in user interfaces instead * of the `name` property above, when available. * * This field is sometimes useful when the `name` is cumbersome or ends up * being perceived as overly technical. The title generally does not have * as stringent format requirements on it, so it may contain special * characters and be more explanatory. Do keep it very short though, and * avoid situations where a title can be confused with the name of another * entity, or where two entities share a title. * * Note that this is only for display purposes, and may be ignored by some * parts of the code. Entity references still always make use of the `name` * property, not the title. */ title?: string; /** * A short (typically relatively few words, on one line) description of the * entity. */ description?: string; /** * Key/value pairs of identifying information attached to the entity. */ labels?: Record; /** * Key/value pairs of non-identifying auxiliary information attached to the * entity. */ annotations?: Record; /** * A list of single-valued strings, to for example classify catalog entities in * various ways. */ tags?: string[]; /** * A list of external hyperlinks related to the entity. */ links?: EntityLink[]; }; /** * A relation of a specific type to another entity in the catalog. * * @public */ export type EntityRelation = { /** * The type of the relation. */ type: string; /** * The entity ref of the target of this relation. */ targetRef: string; }; /** * A link to external information that is related to the entity. * * @public */ export type EntityLink = { /** * The url to the external site, document, etc. */ url: string; /** * An optional descriptive title for the link. */ title?: string; /** * An optional semantic key that represents a visual icon. */ icon?: string; /** * An optional value to categorize links into specific groups */ type?: string; };