openapi: 3.0.3 info: title: scaffolder version: '1' description: The Backstage backend plugin that helps you create new things license: name: Apache-2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html contact: {} servers: - url: / components: examples: {} headers: {} parameters: createdBy: name: createdBy in: query description: Created by required: false allowReserved: true schema: type: string eventsAfter: name: after in: query description: Offset event ID to stream events after. schema: type: integer kind: name: kind in: path required: true allowReserved: true schema: type: string limit: name: limit in: query description: Number of records to return in the response. required: false allowReserved: true schema: type: integer minimum: 0 namespace: name: namespace in: path required: true allowReserved: true schema: type: string name: name: name in: path required: true allowReserved: true schema: type: string offset: name: offset in: query description: Number of records to skip in the query page. required: false allowReserved: true schema: type: integer minimum: 0 order: name: order in: query description: Order required: false allowReserved: true schema: type: string enum: - asc - desc status: name: status in: query description: Status required: false allowReserved: true schema: type: string taskId: name: taskId in: path required: true allowReserved: true schema: type: string requestBodies: {} responses: ErrorResponse: description: An error response from the backend. content: application/json; charset=utf-8: schema: $ref: '#/components/schemas/Error' schemas: Action: type: object properties: id: type: string description: type: string examples: type: array items: $ref: '#/components/schemas/ActionExample' schema: type: object properties: input: $ref: '#/components/schemas/JsonObject' output: $ref: '#/components/schemas/JsonObject' required: - id description: The response shape for a single action in the `listActions` call to the `scaffolder-backend` ActionExample: type: object properties: description: type: string example: type: string required: - description - example description: A single action example DryRunResult: type: object properties: log: type: array items: type: object properties: body: $ref: '#/components/schemas/JsonObject' directoryContents: type: array items: $ref: '#/components/schemas/SerializedFile' output: $ref: '#/components/schemas/JsonObject' required: - log - directoryContents - output EntityLink: type: object properties: type: type: string description: An optional value to categorize links into specific groups icon: type: string description: An optional semantic key that represents a visual icon. title: type: string description: An optional descriptive title for the link. url: type: string description: The url to the external site, document, etc. required: - url description: A link to external information that is related to the entity. additionalProperties: false EntityMeta: type: object properties: links: type: array items: $ref: '#/components/schemas/EntityLink' description: A list of external hyperlinks related to the entity. tags: type: array items: type: string description: |- A list of single-valued strings, to for example classify catalog entities in various ways. annotations: $ref: '#/components/schemas/MapStringString' labels: $ref: '#/components/schemas/MapStringString' description: type: string description: |- A short (typically relatively few words, on one line) description of the entity. title: type: string description: |- 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. namespace: type: string description: The namespace that the entity belongs to. name: type: string description: |- 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. etag: type: string description: |- 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. uid: type: string description: |- 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. required: - name description: Metadata fields common to all versions/kinds of entity. additionalProperties: {} EntityRelation: type: object properties: targetRef: type: string description: The entity ref of the target of this relation. type: type: string description: The type of the relation. required: - targetRef - type description: A relation of a specific type to another entity in the catalog. additionalProperties: false Entity: type: object properties: relations: type: array items: $ref: '#/components/schemas/EntityRelation' description: The relations that this entity has with other entities. spec: $ref: '#/components/schemas/JsonObject' metadata: $ref: '#/components/schemas/EntityMeta' kind: type: string description: The high level entity type being described. apiVersion: type: string description: |- The version of specification format for this particular entity that this is written against. required: - metadata - kind - apiVersion description: The parts of the format that's common to all versions/kinds of entity. Error: type: object properties: error: type: object properties: name: type: string message: type: string stack: type: string code: type: string required: - name - message request: type: object properties: method: type: string url: type: string required: - method - url response: type: object properties: statusCode: type: number required: - statusCode required: - error - response additionalProperties: {} JsonArray: type: array items: $ref: '#/components/schemas/JsonValue' description: A type representing all allowed JSON array values. JsonObject: type: object properties: {} description: A type representing all allowed JSON object values. additionalProperties: {} JsonPrimitive: oneOf: - type: boolean - type: number - type: string - nullable: true description: A type representing all allowed JSON primitive values. JsonValue: oneOf: - $ref: '#/components/schemas/JsonObject' - $ref: '#/components/schemas/JsonArray' - $ref: '#/components/schemas/JsonPrimitive' description: A type representing all allowed JSON values. ListActionsResponse: type: array items: $ref: '#/components/schemas/Action' description: The response shape for the `listActions` call to the `scaffolder-backend` ListTasksResponse: type: object properties: tasks: type: array items: $ref: '#/components/schemas/SerializedTask' description: The response shape for the `listTasks` call to the `scaffolder-backend` MapStringString: type: object properties: {} additionalProperties: type: string description: Construct a type with a set of properties K of type T ScaffolderScaffoldOptions: type: object properties: templateRef: type: string values: type: object additionalProperties: $ref: '#/components/schemas/JsonValue' secrets: type: object additionalProperties: type: string required: - templateRef - values description: The input options to the `scaffold` method of the `ScaffolderClient`. # come back to this one - done # check generated - done Schema: type: object properties: # $id: # type: string id: type: string # $schema: # type: string # $ref: # type: string title: type: string description: type: string multipleOf: type: number maximum: type: number exclusiveMaximum: oneOf: - type: number - type: boolean minimum: type: number exclusiveMinimum: oneOf: - type: number - type: boolean maxLength: type: integer minLength: type: integer pattern: type: object additionalItems: oneOf: - type: boolean - $ref: '#/components/schemas/Schema' items: oneOf: - $ref: '#/components/schemas/Schema' - type: array items: $ref: '#/components/schemas/Schema' maxItems: type: integer minItems: type: integer uniqueItems: type: boolean maxProperties: type: integer minProperties: type: integer required: oneOf: - type: array items: type: string - type: boolean additionalProperties: oneOf: - type: boolean - $ref: '#/components/schemas/Schema' definitions: type: object additionalProperties: $ref: '#/components/schemas/Schema' properties: type: object additionalProperties: $ref: '#/components/schemas/Schema' patternProperties: type: object additionalProperties: $ref: '#/components/schemas/Schema' dependencies: type: object additionalProperties: oneOf: - $ref: '#/components/schemas/Schema' - type: array items: type: string # const: # type: object # enum: # type: array # items: # type: object type: oneOf: - type: string - type: array items: type: string format: type: string allOf: type: array items: $ref: '#/components/schemas/Schema' anyOf: type: array items: $ref: '#/components/schemas/Schema' oneOf: type: array items: $ref: '#/components/schemas/Schema' not: $ref: '#/components/schemas/Schema' # if: # $ref: '#/components/schemas/Schema' then: $ref: '#/components/schemas/Schema' # else: # $ref: '#/components/schemas/Schema' additionalProperties: {} SerializedFile: type: object properties: path: type: string content: type: string format: byte executable: type: boolean symlink: type: boolean required: - path - content SerializedTaskEvent: type: object properties: id: type: integer isTaskRecoverable: type: boolean taskId: type: string body: $ref: '#/components/schemas/JsonObject' type: $ref: '#/components/schemas/TaskEventType' createdAt: type: string required: - id - taskId - body - type - createdAt description: SerializedTaskEvent SerializedTask: type: object properties: id: type: string spec: $ref: '#/components/schemas/TaskSpec' status: $ref: '#/components/schemas/TaskStatus' createdAt: type: string lastHeartbeatAt: type: string createdBy: type: string secrets: $ref: '#/components/schemas/TaskSecrets' state: $ref: '#/components/schemas/JsonObject' required: - id - spec - status - createdAt description: SerializedTask TaskEventType: type: string description: TaskEventType enum: - completion - log - cancelled - recovered TaskRecovery: type: object # properties: # come back to this one - done # EXPERIMENTAL_strategy: # $ref: '#/components/schemas/TaskRecoverStrategy' description: |- When task didn't have a chance to complete due to system restart you can define the strategy what to do with such tasks, by defining a strategy. By default, it is none, what means to not recover but updating the status from 'processing' to 'failed'. additionalProperties: $ref: '#/components/schemas/TaskRecoverStrategy' TaskRecoverStrategy: type: string description: | - none: not recover, let the task be marked as failed - startOver: do recover, start the execution of the task from the first step. enum: - none - startOver TaskSecrets: type: object properties: backstageToken: type: string description: TaskSecrets additionalProperties: {} TaskSpec: $ref: '#/components/schemas/TaskSpecV1beta3' TaskSpecV1beta3: type: object properties: apiVersion: type: string enum: - "scaffolder.backstage.io/v1beta3" description: The apiVersion string of the TaskSpec. parameters: $ref: '#/components/schemas/JsonObject' description: | This is a JSONSchema which is used to render a form in the frontend to collect user input and validate it against that schema. This can then be used in the `steps` part below to template variables passed from the user into each action in the template. steps: type: array items: $ref: '#/components/schemas/TaskStep' description: | A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying javascript action and some optional input parameters that may or may not have been collected from the end user. output: type: object additionalProperties: $ref: '#/components/schemas/JsonValue' description: | The output is an object where template authors can pull out information from template actions and return them in a known standard way. templateInfo: $ref: '#/components/schemas/TemplateInfo' description: Some information about the template that is stored on the task spec. user: type: object properties: entity: type: object properties: {} description: The decorated entity from the Catalog additionalProperties: {} ref: type: string description: An entity ref for the author of the task description: Some decoration of the author of the task that should be available in the context # come back to this one - done # EXPERIMENTAL_recovery: # $ref: '#/components/schemas/TaskRecovery' # description: How to recover the task after system restart or system crash. required: - apiVersion - parameters - steps - output description: |- A scaffolder task as stored in the database, generated from a v1beta3 apiVersion Template. additionalProperties: $ref: '#/components/schemas/TaskRecovery' TaskStatus: type: string enum: - 'cancelled' - 'completed' - 'failed' - 'open' - 'processing' description: The status of each step of the Task TaskStep: type: object properties: id: type: string description: A unique identifier for this step. name: type: string description: A display name to show the user. action: type: string description: The underlying action ID that will be called as part of running this step. input: $ref: '#/components/schemas/JsonObject' description: Additional data that will be passed to the action. # if: # oneOf: # - type: string # - type: boolean # description: When this is false, or if the templated value string evaluates to something that is falsy the step will be skipped. each: oneOf: - type: string - $ref: '#/components/schemas/JsonArray' description: Run step repeatedly. required: - id - name - action description: An individual step of a scaffolder task, as stored in the database. additionalProperties: {} TemplateEntityStepV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' - type: object properties: id: type: string name: type: string action: type: string input: $ref: '#/components/schemas/JsonObject' # if: # oneOf: # - type: string # - type: boolean # come back to this one - done # backstage:permissions: # $ref: '#/components/schemas/TemplatePermissionsV1beta3' required: - action description: Step that is part of a Template Entity. additionalProperties: {} TemplateEntityV1beta3: allOf: # come back to this one - done - $ref: '#/components/schemas/Entity' - type: object properties: apiVersion: type: string enum: ['scaffolder.backstage.io/v1beta3'] description: The apiVersion string of the TaskSpec. kind: type: string enum: ['Template'] description: The kind of the entity spec: type: object properties: type: type: string description: The type that the Template will create. For example service, website or library. presentation: $ref: '#/components/schemas/TemplatePresentationV1beta3' description: Template specific configuration of the presentation layer. # come back to this one - done # EXPERIMENTAL_recovery: # $ref: '#/components/schemas/TemplateRecoveryV1beta3' # description: Recovery strategy for the template parameters: oneOf: - $ref: '#/components/schemas/TemplateParametersV1beta3' - type: array items: $ref: '#/components/schemas/TemplateParametersV1beta3' description: |- This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend to collect user input and validate it against that schema. This can then be used in the `steps` part below to template variables passed from the user into each action in the template. steps: type: array items: $ref: '#/components/schemas/TemplateEntityStepV1beta3' description: |- A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying javascript action and some optional input parameters that may or may not have been collected from the end user. output: type: object additionalProperties: type: string description: The output is an object where template authors can pull out information from template actions and return them in a known standard way. owner: type: string description: The owner entityRef of the TemplateEntity required: - type - steps description: The specification of the Template Entity additionalProperties: {} required: - apiVersion - kind - spec description: |- Backstage catalog Template kind Entity. Templates are used by the Scaffolder plugin to create new entities, such as Components. TemplateInfo: type: object properties: entityRef: type: string description: The entityRef of the template. baseUrl: type: string description: Where the template is stored, so we can resolve relative paths for things like `fetch:template` paths. entity: type: object description: The Template entity. properties: metadata: # come back to this one - done $ref: '#/components/schemas/EntityMeta' description: The metadata of the Template. required: - entityRef description: |- Information about a template that is stored on a task specification. Includes a stringified entityRef, and the baseUrl which is usually the relative path of the template definition TemplateParameterSchema: type: object properties: title: type: string presentation: $ref: '#/components/schemas/TemplatePresentationV1beta3' description: type: string # come back to this one - done # 'ui:options': # $ref: '#/components/schemas/JsonValue' steps: type: array items: type: object properties: title: $ref: '#/components/schemas/JsonValue' description: $ref: '#/components/schemas/JsonValue' schema: $ref: '#/components/schemas/TemplateParametersV1beta3' required: - title - schema # come back to this one - done # EXPERIMENTAL_formDecorators: # type: array # items: # - type: object # properties: # id: # type: string # input: # $ref: '#/components/schemas/JsonObject' required: - title - steps description: |- The shape of each entry of parameters which gets rendered as a separate step in the wizard input additionalProperties: {} # check generated TemplateParametersV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' # - type: object # properties: # # come back to this one - done # backstage:permissions: # $ref: '#/components/schemas/TemplatePermissionsV1beta3' - type: object additionalProperties: $ref: '#/components/schemas/TemplatePermissionsV1beta3' description: Parameter that is part of a Template Entity. TemplatePermissionsV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' - type: object properties: tags: type: array items: type: string description: Access control properties for parts of a template. TemplatePresentationV1beta3: type: object properties: buttonLabels: type: object properties: backButtonText: type: string description: The text for the button which leads to the previous template page createButtonText: type: string description: The text for the button which starts the execution of the template reviewButtonText: type: string description: The text for the button which opens template's review/summary description: Overrides default buttons' text additionalProperties: false description: The presentation of the template. additionalProperties: {} # check generated TemplateRecoveryV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' - type: object # properties: # # come back to this one - done # EXPERIMENTAL_strategy: # type: string # enum: # - none # - startOver # description: |- # none - not recover, let the task be marked as failed # startOver - do recover, start the execution of the task from the first step. additionalProperties: type: string enum: - none - startOver description: |- none - not recover, let the task be marked as failed startOver - do recover, start the execution of the task from the first step. description: Depends on how you designed your task you might tailor the behaviour for each of them. ValidationError: type: object properties: path: type: array items: oneOf: - type: string - type: integer property: type: string message: type: string schema: oneOf: - type: string - $ref: '#/components/schemas/Schema' instance: type: object name: type: string argument: type: object stack: type: string required: - path - property - message - schema - instance - name - argument - stack securitySchemes: JWT: type: http scheme: bearer bearerFormat: JWT paths: /v2/templates/{namespace}/{kind}/{name}/parameter-schema: get: operationId: GetTemplateParameterSchema description: Get template parameter schema. responses: '200': description: Ok content: application/json: schema: $ref: '#/components/schemas/TemplateParameterSchema' '400': $ref: '#/components/responses/ErrorResponse' default: $ref: '#/components/responses/ErrorResponse' security: - {} - JWT: [] parameters: - $ref: '#/components/parameters/namespace' - $ref: '#/components/parameters/kind' - $ref: '#/components/parameters/name' /v2/actions: get: operationId: ListActions description: Returns a list of all installed actions. responses: '200': description: Ok content: application/json: schema: $ref: '#/components/schemas/ListActionsResponse' security: - {} - JWT: [] parameters: [] /v2/tasks: get: operationId: ListTasks description: Returns a list of tasks, filtering by ownership and/or status if given. responses: '200': description: Ok content: application/json: schema: $ref: '#/components/schemas/ListTasksResponse' security: - {} - JWT: [] parameters: - $ref: '#/components/parameters/createdBy' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/offset' - $ref: '#/components/parameters/order' - $ref: '#/components/parameters/status' post: operationId: Scaffold description: |- Executes the scaffolding of a component, given a template and its parameter values. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ScaffolderScaffoldOptions' responses: '201': description: Created content: application/json: schema: type: object properties: id: type: string '400': description: Validation errors. content: application/json: schema: type: object properties: errors: type: array items: $ref: '#/components/schemas/ValidationError' required: - errors security: - {} - JWT: [] parameters: [] /v2/tasks/{taskId}: get: operationId: GetTask description: Get a task by ID. responses: '200': description: Ok content: application/json: schema: $ref: '#/components/schemas/SerializedTask' security: - {} - JWT: [] parameters: - $ref: '#/components/parameters/taskId' /v2/tasks/{taskId}/cancel: post: operationId: CancelTask description: Sends a signal to a task broker to cancel the running task by taskId. responses: '200': description: Ok content: application/json: schema: type: object properties: status: $ref: '#/components/schemas/TaskStatus' security: - {} - JWT: [] parameters: - $ref: '#/components/parameters/taskId' /v2/tasks/{taskId}/retry: post: operationId: Retry description: Starts the task again from the point where it failed. requestBody: required: true content: application/json: schema: type: object properties: secrets: type: object additionalProperties: type: string responses: '201': description: Ok content: application/json: schema: type: object properties: id: type: string security: - {} - JWT: [] parameters: - $ref: '#/components/parameters/taskId' /v2/tasks/{taskId}/eventstream: get: operationId: StreamLogsEventStream description: Get event stream for a task by ID. responses: '200': description: Ok content: text/event-stream: schema: type: string parameters: - $ref: '#/components/parameters/eventsAfter' - $ref: '#/components/parameters/taskId' /v2/tasks/{taskId}/events: get: operationId: StreamLogsPolling description: Get events for a task by ID. responses: '200': description: Ok content: application/json: schema: type: array items: $ref: '#/components/schemas/SerializedTaskEvent' parameters: - $ref: '#/components/parameters/eventsAfter' - $ref: '#/components/parameters/taskId' /v2/dry-run: post: operationId: DryRun description: Perform a dry-run of a template requestBody: required: true content: application/json: schema: type: object properties: template: $ref: '#/components/schemas/TemplateEntityV1beta3' values: type: object secrets: type: object directoryContents: type: array items: type: object properties: path: type: string base64Content: type: string required: - template - values - directoryContents responses: '200': description: Ok content: application/json: schema: allOf: - $ref: '#/components/schemas/DryRunResult' - type: object properties: steps: type: array items: allOf: - $ref: '#/components/schemas/TemplateEntityStepV1beta3' - type: object properties: id: type: string name: type: string required: - id - name directoryContents: type: array items: type: object properties: path: type: string executable: type: boolean base64Content: type: string required: - path - base64Content '400': description: Validation errors. content: application/json: schema: type: object properties: errors: type: array items: $ref: '#/components/schemas/ValidationError' required: - errors parameters: [] /v2/autocomplete/{provider}/{resource}: post: operationId: Autocomplete description: Perform an autocomplete for the given provider and resource. requestBody: required: true content: application/json: schema: type: object properties: context: type: object additionalProperties: type: string token: type: string required: - context - token responses: '200': description: Ok content: application/json: schema: type: object properties: results: type: array items: type: object properties: title: type: string parameters: - in: path name: provider required: true allowReserved: true schema: type: string - in: path name: resource required: true allowReserved: true schema: type: string