From 59ea4d93a6286a8b76bf874e4c0fba6f8104feeb Mon Sep 17 00:00:00 2001 From: Yaron Dayagi Date: Thu, 26 Jun 2025 09:33:25 +0300 Subject: [PATCH] merge mtv workflows into one FLPATH-2325 https://issues.redhat.com/browse/FLPATH-2325 Signed-off-by: Yaron Dayagi --- README.md | 1 - workflows/mtv-migration/README.md | 48 +++- workflows/mtv-migration/mtv.svg | 2 +- workflows/mtv-migration/mtv.sw.yaml | 170 ++++++++++-- .../mtv-migration/schemas/mtv-input.json | 42 +++ workflows/mtv-plan/README.md | 47 ---- workflows/mtv-plan/application.properties | 13 - workflows/mtv-plan/argfile.conf | 3 - workflows/mtv-plan/mtv.svg | 1 - workflows/mtv-plan/mtv.sw.yaml | 127 --------- workflows/mtv-plan/schemas/mtv-input.json | 67 ----- .../schemas/workflow-output-schema.json | 12 - workflows/mtv-plan/secret.properties | 1 - workflows/mtv-plan/specs/mtv.yaml | 242 ------------------ 14 files changed, 233 insertions(+), 543 deletions(-) delete mode 100644 workflows/mtv-plan/README.md delete mode 100644 workflows/mtv-plan/application.properties delete mode 100644 workflows/mtv-plan/argfile.conf delete mode 100644 workflows/mtv-plan/mtv.svg delete mode 100644 workflows/mtv-plan/mtv.sw.yaml delete mode 100644 workflows/mtv-plan/schemas/mtv-input.json delete mode 100644 workflows/mtv-plan/schemas/workflow-output-schema.json delete mode 100644 workflows/mtv-plan/secret.properties delete mode 100644 workflows/mtv-plan/specs/mtv.yaml diff --git a/README.md b/README.md index 85463635..cab63255 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ This repository contains multiple workflows. Each workflow is represented by a d | `move2kube` | Workflow for Move2Kube tasks and transformation. | | `mta-v7.x` | Migration toolkit for applications, version 7.x. | | `mtv-migration` | Migration tasks using Migration Toolkit for Virtualization (MTV). | -| `mtv-plan` | Planning workflows for Migration Toolkit for Virtualization. | | `request-vm-cnv` | Requests and provisions VMs using Container Native Virtualization (CNV). | Each workflow is organized in its own directory, containing the following components: diff --git a/workflows/mtv-migration/README.md b/workflows/mtv-migration/README.md index 2d669f28..ef2e5be5 100644 --- a/workflows/mtv-migration/README.md +++ b/workflows/mtv-migration/README.md @@ -1,10 +1,11 @@ > **🚨 Deprecation Notice: 🚨** > From Orchestrator release version 1.7, Workflow Types will be retired. All workflows will act as infrastructure workflows, and no workflow will act as an assesment workflow.
-> This workflow is a continuation of an assessment workflow. Therfore, that workflow will be obsolete and won't server as a perliminary to this one. +> This workflow is a continuation of an assessment workflow. Therfore, that workflow will be obsolete and won't server as a perliminary to this one. See [examples](#how-to-run). # MTV migration workflow - MTV Migration execution workflow -This workflow is a continuation of the MTV assessment workflow. It executes an MTV Plan and waits for its final condition. Final condition is either success or failure. It is important to note that we rely on MTV to reach a final state. We do not impose our own timeout. -[MTV Migration Plan documentation](https://docs.redhat.com/en/documentation/migration_toolkit_for_virtualization/2.6/html/installing_and_using_the_migration_toolkit_for_virtualization/migrating-vms-web-console_mtv#creating-migration-plans-ui) +This workflow creates an MTV Plan and an MTV Migration. It waits for the final condition of each resource. Final condition is either success or failure. It is important to note that we rely on MTV to reach a final state. We do not impose our own timeout. +[MTV Migration Plan documentation](https://docs.redhat.com/en/documentation/migration_toolkit_for_virtualization/2.6/html/installing_and_using_the_migration_toolkit_for_virtualization/migrating-vms-web-console_mtv#creating-migration-plans-ui) +It is possible to execute just one of the stages: Plan or Migrate. The input variable `operation` determines whether to perform just one of the stages or perform both (sequentially). ## Prerequisite * Access to an OCP cluster with MTV operator (Openshift Migration Toolkit for Virtualization) installed. The cluster credentials must allow creating the resources listed above. @@ -27,10 +28,47 @@ Application properties can be initialized from environment variables before runn See [official installation guide](https://github.com/rhdhorchestrator/serverless-workflows/blob/main/deploy/docs/main/mtv-migration) ## How to run -Example of POST to trigger the flow (see input schema [mtv-input.json](./schema/mtv-input.json)): +Example of POST to trigger Plan and Migrate (see input schema [mtv-input.json](./schema/mtv-input.json)): +```bash +curl -X POST -H "Content-Type: application/json" http://localhost:8080/mtv-plan -d '{ + "migrationName": "my-vms", + "migrationNamespace": "openshift-mtv", + "operation": "PLAN_AND_MIGRATE", + "sourceProvider": "vmware", + "destinationProvider": "host", + "storageMap": "vmware-z976z", + "networkMap": "vmware-zqpl7", + "vms": [ + { + "name": "haproxy", + "id": "vm-5932" + } + ] +}' +``` +Example of POST to trigger just Migrate (see input schema [mtv-input.json](./schema/mtv-input.json)): ```bash curl -X POST -H "Content-Type: application/json" http://localhost:8080/mtv-migration -d '{ "migrationName": "my-vms", - "migrationNamespace": "openshift-mtv" + "migrationNamespace": "openshift-mtv", + "operation": "MIGRATE" }' ``` +Example of POST to trigger just Plan (see input schema [mtv-input.json](./schema/mtv-input.json)): +```bash +curl -X POST -H "Content-Type: application/json" http://localhost:8080/mtv-plan -d '{ + "migrationName": "my-vms", + "migrationNamespace": "openshift-mtv", + "operation": "PLAN", + "sourceProvider": "vmware", + "destinationProvider": "host", + "storageMap": "vmware-z976z", + "networkMap": "vmware-zqpl7", + "vms": [ + { + "name": "haproxy", + "id": "vm-5932" + } + ] +}' +``` \ No newline at end of file diff --git a/workflows/mtv-migration/mtv.svg b/workflows/mtv-migration/mtv.svg index 96f49c03..3632c287 100644 --- a/workflows/mtv-migration/mtv.svg +++ b/workflows/mtv-migration/mtv.svg @@ -1 +1 @@ -StartCreateMigrationGetMigrationCheckMigrationStat us MigrationFailureEndMigrationSuccessfu l EndMigrationFailure MigrationFailure MigrationSucce... MigrationSucce... \ No newline at end of file +StartSelectOperationCreatePlanGetPlanCheckPlanStatusPlanFailureEndPlanReadyEndNextOperationCreateMigrationGetMigrationCheckMigrationStat us MigrationFailureEndMigrationSuccessfu l EndPlanFailure PlanFailure PlanReady PlanReady Migrate Migrate MigrationFailure MigrationFailure MigrationSucce... MigrationSucce... JustMigrate JustMigrate \ No newline at end of file diff --git a/workflows/mtv-migration/mtv.sw.yaml b/workflows/mtv-migration/mtv.sw.yaml index 2bde0ee5..753fb12c 100644 --- a/workflows/mtv-migration/mtv.sw.yaml +++ b/workflows/mtv-migration/mtv.sw.yaml @@ -1,6 +1,6 @@ specVersion: "0.8" id: mtv-migration -version: '1.0' +version: "1.0" name: MTV migration workflow description: workflow executes a plan by creating a migration and waiting for it to be successful or failed annotations: @@ -12,41 +12,165 @@ extensions: - extensionid: workflow-uri-definitions definitions: notifications: "https://raw.githubusercontent.com/rhdhorchestrator/serverless-workflows/main/workflows/shared/specs/notifications-openapi.yaml" -start: CreateMigration +start: SelectOperation functions: - name: createNotification operation: notifications#createNotification + - name: createPlan + type: rest + operation: "specs/mtv.yaml#createPlan" + - name: getPlan + type: rest + operation: "specs/mtv.yaml#getPlan" - name: createMigration type: rest - operation: 'specs/mtv.yaml#createMigration' + operation: "specs/mtv.yaml#createMigration" - name: getMigration type: rest - operation: 'specs/mtv.yaml#getMigration' + operation: "specs/mtv.yaml#getMigration" + - name: getPlanError + type: expression + operation: .getStatusResult.status.conditions | map(select(.category == "Error" or .category == "Critical"))[0].message - name: getMigrationError type: expression operation: .getStatusResult.status.conditions | map(select(.category == "Error" or .category == "Critical" or .type == "Failed"))[0].message - - name: successResult + - name: successMigrate type: expression operation: '{ - "result": { - "message": "MTV migration " + .migrationName + " succeeded", - "outputs":[] - } + "result": { + "message": "MTV migration " + .migrationName + " succeeded", + "outputs":[] + } }' - - name: errorResult + - name: errorMigrate type: expression operation: '{ - "result": { - "message": "MTV migration " + .migrationName + " failed.", - "outputs":[ - { - "key":"Error", - "value": .migrationErrorMessage - } - ] - } + "result": { + "message": "MTV migration " + .migrationName + " failed.", + "outputs":[ + { + "key":"Error", + "value": .migrationErrorMessage + } + ] + } }' states: + - name: SelectOperation + type: switch + dataConditions: + - name: JustMigrate + condition: .operation == "MIGRATE" + transition: CreateMigration + defaultCondition: + transition: CreatePlan + - name: CreatePlan + type: operation + actions: + - functionRef: + refName: createPlan + arguments: + namespace: .migrationNamespace + apiVersion: "forklift.konveyor.io/v1beta1" + kind: Plan + metadata: + name: .migrationName + namespace: .migrationNamespace + spec: + map: + network: + name: .networkMap + namespace: .migrationNamespace + storage: + name: .storageMap + namespace: .migrationNamespace + provider: + destination: + name: .destinationProvider + namespace: .migrationNamespace + source: + name: .sourceProvider + namespace: .migrationNamespace + targetNamespace: .migrationNamespace + vms: .vms + transition: GetPlan + - name: GetPlan + type: operation + actions: + - name: getPlan + actionDataFilter: + toStateData: .getStatusResult + functionRef: + refName: getPlan + arguments: + namespace: .migrationNamespace + plan: .migrationName + sleep: + before: PT10S + transition: CheckPlanStatus + - name: CheckPlanStatus + type: switch + dataConditions: + - name: PlanFailure + condition: .getStatusResult.status.conditions | map(select(.category == "Error" or .category == "Critical")) | length > 0 + transition: PlanFailure + - name: PlanReady + condition: .getStatusResult.status.conditions | map(select(.type == "Ready")) | length > 0 + transition: NextOperation + defaultCondition: + transition: + nextState: GetPlan + - name: PlanFailure + type: operation + metadata: + errorMessage: '"MTV plan " + .migrationName + " is not ready for migration"' + actions: + - name: setPlanErrorMessage + actionDataFilter: + toStateData: .planErrorMessage + functionRef: + refName: getPlanError + - name: createNotification + functionRef: + refName: createNotification + arguments: + recipients: + type: "entity" + entityRef: .recipients + payload: + title: "MTV plan is not ready for migration" + description: '"MTV plan " + .migrationName + " is not ready for migration. Error: " + .planErrorMessage' + topic: "MTV plan assessment workflow" + severity: "critical" + stateDataFilter: + output: "{result: {message: .planErrorMessage}}" + end: true + - name: PlanReady + type: operation + actions: + - name: createNotification + functionRef: + refName: createNotification + arguments: + recipients: + type: "entity" + entityRef: .recipients + payload: + title: "MTV plan is ready for migration" + description: '"MTV plan " + .migrationName + " is ready for migration"' + topic: "MTV plan assessment workflow" + severity: "normal" + stateDataFilter: + output: '{result: {message: "MTV plan successful", "outputs": [] }}' + end: true + - name: NextOperation + type: switch + dataConditions: + - name: Migrate + condition: .operation == "PLAN_AND_MIGRATE" + transition: CreateMigration + defaultCondition: + transition: PlanReady - name: CreateMigration type: operation actions: @@ -93,7 +217,7 @@ states: - name: MigrationFailure type: operation metadata: - errorMessage: '"MTV migration " + .migrationName + " failed"' + errorMessage: '"MTV migration " + .migrationName + " failed"' actions: - name: setMigrationErrorMessage actionDataFilter: @@ -114,7 +238,7 @@ states: severity: "critical" - name: setOutput functionRef: - refName: errorResult + refName: errorMigrate end: true - name: MigrationSuccessful type: operation @@ -133,5 +257,5 @@ states: severity: "normal" - name: setOutput functionRef: - refName: successResult - end: true \ No newline at end of file + refName: successMigrate + end: true diff --git a/workflows/mtv-migration/schemas/mtv-input.json b/workflows/mtv-migration/schemas/mtv-input.json index d8e94a55..22042fdf 100644 --- a/workflows/mtv-migration/schemas/mtv-input.json +++ b/workflows/mtv-migration/schemas/mtv-input.json @@ -10,6 +10,48 @@ "type": "string", "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" }, + "operation": { + "type": "string", + "enum": [ + "PLAN,MIGRATE,PLAN_AND_MIGRATE" + ], + "description": "create a plan and then migrate or perform just one of the two stages" + }, + "sourceProvider": { + "type": "string", + "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" + }, + "destinationProvider": { + "type": "string", + "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" + }, + "storageMap": { + "type": "string", + "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" + }, + "networkMap": { + "type": "string", + "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" + }, + "vms": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "minItems": 1 + }, "recipients": { "type": "array", "items": { diff --git a/workflows/mtv-plan/README.md b/workflows/mtv-plan/README.md deleted file mode 100644 index 0abe3c82..00000000 --- a/workflows/mtv-plan/README.md +++ /dev/null @@ -1,47 +0,0 @@ -> **🚨 Deprecation Notice: 🚨** -> From Orchestrator release version 1.7, Workflow Types will be retired. All workflows will act as infrastructure workflows, and no workflow will act as an assesment workflow.
-> This workflow, being an assessment workflow, will be obsolete and irrelevant. - -# MTV assessment - MTV Plan assessment workflow -This workflow is an assessment workflow type, that creates an MTV Plan resource and waits for its final condition. Final condition is either success or failure. It is important to note that we rely on MTV to reach a final state. We do not impose our own timeout. -[MTV Migration Plan documentation](https://docs.redhat.com/en/documentation/migration_toolkit_for_virtualization/2.6/html/installing_and_using_the_migration_toolkit_for_virtualization/migrating-vms-web-console_mtv#creating-migration-plans-ui) - -## Prerequisite -* Access to an OCP cluster with MTV operator (Openshift Migration Toolkit for Virtualization) installed. The cluster credentials must allow creating the resources listed above. - -## Workflow diagram -![MTV Plan workflow diagram](https://github.com/rhdhorchestrator/serverless-workflows/blob/main/mtv-plan/mtv.svg?raw=true) - -## Workflow application configuration -Application properties can be initialized from environment variables before running the application: - -| Environment variable | Description | Mandatory | Default value | -|-----------------------|-------------|-----------|---------------| -| `BACKSTAGE_NOTIFICATIONS_URL` | The backstage server URL for notifications | ✅ | | -| `NOTIFICATIONS_BEARER_TOKEN` | The authorization bearer token to use to send notifications | ✅ | | -| `OCP_API_SERVER_URL` | The OpensShift API Server URL | ✅ | | -| `OCP_API_SERVER_TOKEN`| The OpensShift API Server Token | ✅ | | - -## Installation - -See [official installation guide](https://github.com/rhdhorchestrator/serverless-workflows/blob/main/deploy/docs/main/mtv-plan) - - -## How to run -Example of POST to trigger the flow (see input schema [mtv-input.json](./schema/mtv-input.json)): -```bash -curl -X POST -H "Content-Type: application/json" http://localhost:8080/mtv-plan -d '{ - "migrationName": "my-vms", - "migrationNamespace": "openshift-mtv", - "sourceProvider": "vmware", - "destinationProvider": "host", - "storageMap": "vmware-z976z", - "networkMap": "vmware-zqpl7", - "vms": [ - { - "name": "haproxy", - "id": "vm-5932" - } - ] -}' -``` diff --git a/workflows/mtv-plan/application.properties b/workflows/mtv-plan/application.properties deleted file mode 100644 index c47f7cf0..00000000 --- a/workflows/mtv-plan/application.properties +++ /dev/null @@ -1,13 +0,0 @@ -quarkus.rest-client.notifications.url=${BACKSTAGE_NOTIFICATIONS_URL} -quarkus.openapi-generator.notifications.auth.BearerToken.bearer-token=${NOTIFICATIONS_BEARER_TOKEN} -quarkus.rest-client.mtv_yaml.url=${OCP_API_SERVER_URL} -quarkus.openapi-generator.mtv_yaml.auth.BearerToken.bearer-token=${OCP_API_SERVER_TOKEN} -quarkus.tls.trust-all=true -quarkus.kubernetes-client.trust-certs=true - -# This property is used to select the log level, which controls the amount -# of information logged on HTTP requests based on the severity of the events. -# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. -# and see https://quarkus.io/guides/logging for documentation -quarkus.log.category."org.apache.http".level=INFO -quarkus.log.level=INFO \ No newline at end of file diff --git a/workflows/mtv-plan/argfile.conf b/workflows/mtv-plan/argfile.conf deleted file mode 100644 index d0b5d487..00000000 --- a/workflows/mtv-plan/argfile.conf +++ /dev/null @@ -1,3 +0,0 @@ -FLOW_NAME=MTV plan workflow -FLOW_SUMMARY=MTV plan assessment workflow -FLOW_DESCRIPTION=An assessment workflow that creates a plan and waits for it to be ready or failed diff --git a/workflows/mtv-plan/mtv.svg b/workflows/mtv-plan/mtv.svg deleted file mode 100644 index 0cbb84c7..00000000 --- a/workflows/mtv-plan/mtv.svg +++ /dev/null @@ -1 +0,0 @@ -StartCreatePlanGetPlanCheckPlanStatusPlanFailureEndPlanReadyEndPlanFailure PlanFailure PlanReady PlanReady \ No newline at end of file diff --git a/workflows/mtv-plan/mtv.sw.yaml b/workflows/mtv-plan/mtv.sw.yaml deleted file mode 100644 index aa5f8482..00000000 --- a/workflows/mtv-plan/mtv.sw.yaml +++ /dev/null @@ -1,127 +0,0 @@ -specVersion: "0.8" -id: mtv-plan -version: "1.0" -name: MTV plan assessment workflow -description: assessment creates a plan and waits for it to be ready or failed -annotations: - - "workflow-type/assessment" -dataInputSchema: schemas/mtv-input.json -extensions: - - extensionid: workflow-uri-definitions - definitions: - notifications: "https://raw.githubusercontent.com/rhdhorchestrator/serverless-workflows/main/workflows/shared/specs/notifications-openapi.yaml" - - extensionid: workflow-output-schema - outputSchema: schemas/workflow-output-schema.json -start: CreatePlan -functions: - - name: createNotification - operation: notifications#createNotification - - name: createPlan - type: rest - operation: "specs/mtv.yaml#createPlan" - - name: getPlan - type: rest - operation: "specs/mtv.yaml#getPlan" - - name: getPlanError - type: expression - operation: .getStatusResult.status.conditions | map(select(.category == "Error" or .category == "Critical"))[0].message -states: - - name: CreatePlan - type: operation - actions: - - functionRef: - refName: createPlan - arguments: - namespace: .migrationNamespace - apiVersion: "forklift.konveyor.io/v1beta1" - kind: Plan - metadata: - name: .migrationName - namespace: .migrationNamespace - spec: - map: - network: - name: .networkMap - namespace: .migrationNamespace - storage: - name: .storageMap - namespace: .migrationNamespace - provider: - destination: - name: .destinationProvider - namespace: .migrationNamespace - source: - name: .sourceProvider - namespace: .migrationNamespace - targetNamespace: .migrationNamespace - vms: .vms - transition: GetPlan - - name: GetPlan - type: operation - actions: - - name: getPlan - actionDataFilter: - toStateData: .getStatusResult - functionRef: - refName: getPlan - arguments: - namespace: .migrationNamespace - plan: .migrationName - sleep: - before: PT10S - transition: CheckPlanStatus - - name: CheckPlanStatus - type: switch - dataConditions: - - name: PlanFailure - condition: .getStatusResult.status.conditions | map(select(.category == "Error" or .category == "Critical")) | length > 0 - transition: PlanFailure - - name: PlanReady - condition: .getStatusResult.status.conditions | map(select(.type == "Ready")) | length > 0 - transition: PlanReady - defaultCondition: - transition: - nextState: GetPlan - - name: PlanFailure - type: operation - metadata: - errorMessage: '"MTV plan " + .migrationName + " is not ready for migration"' - actions: - - name: setPlanErrorMessage - actionDataFilter: - toStateData: .planErrorMessage - functionRef: - refName: getPlanError - - name: createNotification - functionRef: - refName: createNotification - arguments: - recipients: - type: "entity" - entityRef: .recipients - payload: - title: "MTV plan is not ready for migration" - description: '"MTV plan " + .migrationName + " is not ready for migration. Error: " + .planErrorMessage' - topic: "MTV plan assessment workflow" - severity: "critical" - stateDataFilter: - output: '{result: {message: .planErrorMessage}}' - end: true - - name: PlanReady - type: operation - actions: - - name: createNotification - functionRef: - refName: createNotification - arguments: - recipients: - type: "entity" - entityRef: .recipients - payload: - title: "MTV plan is ready for migration" - description: '"MTV plan " + .migrationName + " is ready for migration"' - topic: "MTV plan assessment workflow" - severity: "normal" - stateDataFilter: - output: '{result: {message: "MTV plan successful", "nextWorkflows": [{id: "mtv-migration", name: "MTV migration workflow"}], "outputs": [] }}' - end: true diff --git a/workflows/mtv-plan/schemas/mtv-input.json b/workflows/mtv-plan/schemas/mtv-input.json deleted file mode 100644 index a275f338..00000000 --- a/workflows/mtv-plan/schemas/mtv-input.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "migrationName": { - "type": "string", - "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" - }, - "migrationNamespace": { - "type": "string", - "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" - }, - "sourceProvider": { - "type": "string", - "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" - }, - "destinationProvider": { - "type": "string", - "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" - }, - "storageMap": { - "type": "string", - "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" - }, - "networkMap": { - "type": "string", - "pattern": "[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*" - }, - "vms": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "required": [ - "name", - "id" - ] - }, - "minItems": 1 - }, - "recipients": { - "type": "array", - "items": { - "type": "string", - "pattern": "^(user|group):[a-z0-9]([-a-z0-9]*[a-z0-9])?/([a-z0-9]([-a-z0-9]*[a-z0-9])?)$" - }, - "minItems": 1 - } - }, - "required": [ - "migrationName", - "migrationNamespace", - "sourceProvider", - "destinationProvider", - "storageMap", - "networkMap", - "vms", - "recipients" - ] -} \ No newline at end of file diff --git a/workflows/mtv-plan/schemas/workflow-output-schema.json b/workflows/mtv-plan/schemas/workflow-output-schema.json deleted file mode 100644 index 8d3c7005..00000000 --- a/workflows/mtv-plan/schemas/workflow-output-schema.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "WorkflowResult", - "description": "Schema of workflow output", - "type": "object", - "properties": { - "result": { - "$ref": "../shared/schemas/workflow-result-schema.json", - "type": "object" - } - } -} \ No newline at end of file diff --git a/workflows/mtv-plan/secret.properties b/workflows/mtv-plan/secret.properties deleted file mode 100644 index 4550a6db..00000000 --- a/workflows/mtv-plan/secret.properties +++ /dev/null @@ -1 +0,0 @@ -NOTIFICATIONS_BEARER_TOKEN= \ No newline at end of file diff --git a/workflows/mtv-plan/specs/mtv.yaml b/workflows/mtv-plan/specs/mtv.yaml deleted file mode 100644 index b322aafe..00000000 --- a/workflows/mtv-plan/specs/mtv.yaml +++ /dev/null @@ -1,242 +0,0 @@ - openapi: 3.0.0 - info: - title: MTV Kubernetes API - version: v1beta1 - paths: - /apis/forklift.konveyor.io/v1beta1/namespaces/{namespace}/migrations/{migration}: - get: - tags: - - forklift_konveyor_io_v1beta1 - description: get a resource of type Migration in namespace - operationId: getMigration - parameters: - - in: path - name: namespace - required: true - schema: - type: string - - in: path - name: migration - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Migration' - "401": - description: Unauthorized - security: - - BearerToken: [] - /apis/forklift.konveyor.io/v1beta1/namespaces/{namespace}/plans/{plan}: - get: - tags: - - forklift_konveyor_io_v1beta1 - description: get a resource of type Plan in namespace - operationId: getPlan - parameters: - - in: path - name: namespace - required: true - schema: - type: string - - in: path - name: plan - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Plan' - "401": - description: Unauthorized - security: - - BearerToken: [] - /apis/forklift.konveyor.io/v1beta1/namespaces/{namespace}/plans: - post: - tags: - - forklift_konveyor_io_v1beta1 - description: create a resource of type Plan in namespace - operationId: createPlan - parameters: - - in: path - name: namespace - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Plan' - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Plan' - "201": - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Plan' - "202": - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Plan' - "401": - description: Unauthorized - security: - - BearerToken: [] - /apis/forklift.konveyor.io/v1beta1/namespaces/{namespace}/migrations: - post: - tags: - - forklift_konveyor_io_v1beta1 - description: create a resource of type Migration in namespace - operationId: createMigration - parameters: - - in: path - name: namespace - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Migration' - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Migration' - "201": - description: Created - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Migration' - "202": - description: Accepted - content: - application/json: - schema: - $ref: '#/components/schemas/forklift.konveyor.io.v1.beta1.Migration' - "401": - description: Unauthorized - security: - - BearerToken: [] - components: - schemas: - K8sResource: - type: object - properties: - name: - type: string - namespace: - type: string - K8sConditions: - type: array - items: - type: object - properties: - status: - type: string - type: - type: string - category: - type: string - message: - type: string - forklift.konveyor.io.v1beta1.Vm: - type: object - properties: - id: - type: string - name: - type: string - forklift.konveyor.io.v1beta1.Vms: - type: array - items: - $ref: '#/components/schemas/forklift.konveyor.io.v1beta1.Vm' - forklift.konveyor.io.v1beta1.Map: - type: object - properties: - network: - $ref: '#/components/schemas/K8sResource' - storage: - $ref: '#/components/schemas/K8sResource' - forklift.konveyor.io.v1beta1.Provider: - type: object - properties: - destination: - $ref: '#/components/schemas/K8sResource' - source: - $ref: '#/components/schemas/K8sResource' - forklift.konveyor.io.v1.beta1.Plan: - type: object - properties: - apiVersion: - type: string - kind: - type: string - metadata: - $ref: '#/components/schemas/K8sResource' - spec: - type: object - properties: - map: - $ref: '#/components/schemas/forklift.konveyor.io.v1beta1.Map' - provider: - $ref: '#/components/schemas/forklift.konveyor.io.v1beta1.Provider' - targetNamespace: - type: string - vms: - $ref: '#/components/schemas/forklift.konveyor.io.v1beta1.Vms' - status: - type: object - properties: - conditions: - $ref: '#/components/schemas/K8sConditions' - forklift.konveyor.io.v1.beta1.Migration: - type: object - properties: - apiVersion: - type: string - kind: - type: string - metadata: - $ref: '#/components/schemas/K8sResource' - spec: - type: object - properties: - plan: - type: object - properties: - name: - type: string - namespace: - type: string - status: - type: object - properties: - conditions: - $ref: '#/components/schemas/K8sConditions' - securitySchemes: - BearerToken: - type: http - scheme: bearer - description: Bearer Token authentication