Backstage
    Preparing search index...

    A client for interacting with the Backstage software catalog through its API.

    interface CatalogApi {
        addLocation(
            location: AddLocationRequest,
            options?: CatalogRequestOptions,
        ): Promise<AddLocationResponse>;
        analyzeLocation(
            location: AnalyzeLocationRequest,
            options?: CatalogRequestOptions,
        ): Promise<AnalyzeLocationResponse>;
        getEntities(
            request?: GetEntitiesRequest,
            options?: CatalogRequestOptions,
        ): Promise<GetEntitiesResponse>;
        getEntitiesByRefs(
            request: GetEntitiesByRefsRequest,
            options?: CatalogRequestOptions,
        ): Promise<GetEntitiesByRefsResponse>;
        getEntityAncestors(
            request: GetEntityAncestorsRequest,
            options?: CatalogRequestOptions,
        ): Promise<GetEntityAncestorsResponse>;
        getEntityByRef(
            entityRef: string | CompoundEntityRef,
            options?: CatalogRequestOptions,
        ): Promise<Entity | undefined>;
        getEntityFacets(
            request: GetEntityFacetsRequest,
            options?: CatalogRequestOptions,
        ): Promise<GetEntityFacetsResponse>;
        getLocationByEntity(
            entityRef: string | CompoundEntityRef,
            options?: CatalogRequestOptions,
        ): Promise<Location | undefined>;
        getLocationById(
            id: string,
            options?: CatalogRequestOptions,
        ): Promise<Location | undefined>;
        getLocationByRef(
            locationRef: string,
            options?: CatalogRequestOptions,
        ): Promise<Location | undefined>;
        getLocations(
            request?: {},
            options?: CatalogRequestOptions,
        ): Promise<GetLocationsResponse>;
        queryEntities(
            request?: QueryEntitiesRequest,
            options?: CatalogRequestOptions,
        ): Promise<QueryEntitiesResponse>;
        refreshEntity(
            entityRef: string,
            options?: CatalogRequestOptions,
        ): Promise<void>;
        removeEntityByUid(
            uid: string,
            options?: CatalogRequestOptions,
        ): Promise<void>;
        removeLocationById(
            id: string,
            options?: CatalogRequestOptions,
        ): Promise<void>;
        streamEntities(
            request?: StreamEntitiesRequest,
            options?: CatalogRequestOptions,
        ): AsyncIterable<Entity[]>;
        validateEntity(
            entity: Entity,
            locationRef: string,
            options?: CatalogRequestOptions,
        ): Promise<ValidateEntityResponse>;
    }
    Index

    Methods

    • Gets paginated entities from the catalog.

      Parameters

      Returns Promise<QueryEntitiesResponse>

      const response = await catalogClient.queryEntities({
      filter: [{ kind: 'group' }],
      limit: 20,
      fullTextFilter: {
      term: 'A',
      },
      orderFields: { field: 'metadata.name', order: 'asc' },
      });

      this will match all entities of type group having a name starting with 'A', ordered by name ascending.

      The response will contain a maximum of 20 entities. In case more than 20 entities exist, the response will contain a nextCursor property that can be used to fetch the next batch of entities.

      const secondBatchResponse = await catalogClient
      .queryEntities({ cursor: response.nextCursor });

      secondBatchResponse will contain the next batch of (maximum) 20 entities, together with a prevCursor property, useful to fetch the previous batch.