why isn't api registered when component is created

699 Views Asked by At

I have created a backstage scaffolding template to create a Spring boot rest service deployed to AWS EKS. When a component is created from it in backstage the api is not registered in backstage: the component builds using github actions, is deployed to AWS EKS and is registered in backstage.

catalog-info.yaml includes

spec:
  type: service
  lifecycle: experimental
  owner: "team-a"
  system: experimental-portal
  providesApis:
    - stephendemo16
  consumesApis:
    - petstore

To experiment I added petstore under consumesApis and it is registered in backstage.

I have a backstage yaml file greeting-api.yaml defining my API

apiVersion: backstage.io/v1alpha1
kind: API
metadata:
  name: stephendemo16
  description: try using template
spec:
  type: openapi
  lifecycle: experimental
  owner: lab49-poc
  definition:
    $text: https://github.com/xxxx/stephendemo16/blob/master/src/main/resources/api-docs.yaml

This references the openapi spec api-docs.yaml

openapi: 3.0.1
info:
  title: OpenAPI definition
  version: v0
servers:
- url: http://localhost:8080
  description: Generated server url
paths:
  /greeting:
    get:
      tags:
      - greeting-controller
      operationId: greeting
      parameters:
      - name: name
        in: query
        required: false
        schema:
          type: string
          default: World
      responses:
        "200":
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Greeting'
components:
  schemas:
    Greeting:
      type: object
      properties:
        id:
          type: integer
          format: int64
        content:
          type: string

Why isn't the api registered when the component is created?

BTW Backstage is installed on AWS ECS.

0

There are 0 best solutions below