From 51af55f8d5193696a457c475c6c0b243118cbcc3 Mon Sep 17 00:00:00 2001 From: Fredrik Hatletvedt Date: Tue, 5 Dec 2023 11:06:08 +0100 Subject: [PATCH] update swagger spec for enums --- api/buildsecrets/models/build_secret.go | 1 + .../models/component_deployment.go | 6 +- api/deployments/models/deployment_summary.go | 1 + api/deployments/models/scheduled_batch.go | 4 +- api/environments/models/environment.go | 2 +- .../models/environment_summary.go | 2 +- api/jobs/models/job.go | 6 +- api/jobs/models/job_parameters.go | 3 +- api/jobs/models/job_summary.go | 6 +- api/jobs/models/pipeline_run.go | 3 +- api/jobs/models/pipeline_run_task.go | 3 +- api/jobs/models/pipeline_run_task_step.go | 3 +- api/jobs/models/step.go | 2 +- .../models/image_hub_secret.go | 1 + api/secrets/models/secret.go | 4 +- api/secrets/models/secret_parameters.go | 3 +- swaggerui_src/swagger.json | 91 +++++++++++++------ 17 files changed, 91 insertions(+), 50 deletions(-) diff --git a/api/buildsecrets/models/build_secret.go b/api/buildsecrets/models/build_secret.go index 3ce95b4f..ece234d3 100644 --- a/api/buildsecrets/models/build_secret.go +++ b/api/buildsecrets/models/build_secret.go @@ -14,6 +14,7 @@ type BuildSecret struct { // - Consistent = Secret value is set // // required: false + // enum: Pending,Consistent // example: Consistent Status string `json:"status"` } diff --git a/api/deployments/models/component_deployment.go b/api/deployments/models/component_deployment.go index 0ce6f710..9f183195 100644 --- a/api/deployments/models/component_deployment.go +++ b/api/deployments/models/component_deployment.go @@ -21,6 +21,7 @@ type Component struct { // Type of component // // required: true + // enum: component,job // example: component Type string `json:"type"` @@ -30,6 +31,7 @@ type Component struct { // - Consistent = Component is consistent with config // - Restarting = User has triggered restart, but this is not reconciled // + // enum: Stopped,Consistent,Reconciling,Restarting,Outdated // example: Consistent Status string `json:"status"` @@ -159,6 +161,7 @@ type AuxiliaryResourceDeployment struct { // - Reconciling: Waiting for new replicas to enter desired state // - Stopped: Replica count is set to 0 // + // enum: Stopped,Consistent,Reconciling // example: Consistent Status string `json:"status"` @@ -196,6 +199,7 @@ type ComponentSummary struct { // Type of component // // required: true + // enum: component,job // example: component Type string `json:"type"` @@ -269,8 +273,8 @@ type ReplicaStatus struct { // - Running = Container in Running state // - Terminated = Container in Terminated state // - // Enum: Pending,Failing,Running,Terminated,Starting // required: true + // enum: Pending,Failing,Running,Terminated,Starting // example: Running Status string `json:"status"` } diff --git a/api/deployments/models/deployment_summary.go b/api/deployments/models/deployment_summary.go index a4937ca0..d2c137b0 100644 --- a/api/deployments/models/deployment_summary.go +++ b/api/deployments/models/deployment_summary.go @@ -9,6 +9,7 @@ type DeploymentSummaryPipelineJobInfo struct { // Type of pipeline job // // required: false + // enum: build,build-deploy,promote,deploy // example: build-deploy PipelineJobType string `json:"pipelineJobType,omitempty"` diff --git a/api/deployments/models/scheduled_batch.go b/api/deployments/models/scheduled_batch.go index 8fea2d77..be7ad79b 100644 --- a/api/deployments/models/scheduled_batch.go +++ b/api/deployments/models/scheduled_batch.go @@ -30,7 +30,7 @@ type ScheduledJobSummary struct { // Status of the job // // required: true - // Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed + // enum: Running,Succeeded,Failed,Waiting,Stopping,Stopped // example: Waiting Status string `json:"status"` @@ -125,7 +125,7 @@ type ScheduledBatchSummary struct { // Status of the job // // required: true - // Enum: Waiting,Running,Succeeded,Failed + // enum: Waiting,Running,Succeeded,Failed // example: Waiting Status string `json:"status"` diff --git a/api/environments/models/environment.go b/api/environments/models/environment.go index 2ea712c0..b6150c1c 100644 --- a/api/environments/models/environment.go +++ b/api/environments/models/environment.go @@ -20,7 +20,7 @@ type Environment struct { // - Orphan = Environment does not exist in Radix config, but exists in cluster // // required: false - // Enum: Pending,Consistent,Orphan + // enum: Pending,Consistent,Orphan // example: Consistent Status string `json:"status"` diff --git a/api/environments/models/environment_summary.go b/api/environments/models/environment_summary.go index 981b40c5..4cf77b21 100644 --- a/api/environments/models/environment_summary.go +++ b/api/environments/models/environment_summary.go @@ -19,7 +19,7 @@ type EnvironmentSummary struct { // - Orphan = Environment does not exist in Radix config, but exists in cluster // // required: false - // Enum: Pending,Consistent,Orphan + // enum: Pending,Consistent,Orphan // example: Consistent Status string `json:"status"` diff --git a/api/jobs/models/job.go b/api/jobs/models/job.go index 93558ea5..5f5b4343 100644 --- a/api/jobs/models/job.go +++ b/api/jobs/models/job.go @@ -34,7 +34,7 @@ type Job struct { // Image tags names for components - if empty will use default logic // // required: false - // Example: component1: tag1,component2: tag2 + // example: component1: tag1,component2: tag2 ImageTagNames map[string]string `json:"imageTagNames,omitempty"` // Created timestamp @@ -70,14 +70,14 @@ type Job struct { // Status of the job // // required: false - // Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed,StoppedNoChanges + // enum: Queued,Waiting,Running,Succeeded,Failed,Stopped,Stopping,StoppedNoChanges // example: Waiting Status string `json:"status"` // Name of the pipeline // // required: false - // Enum: build,build-deploy,promote,deploy + // enum: build,build-deploy,promote,deploy // example: build-deploy Pipeline string `json:"pipeline"` diff --git a/api/jobs/models/job_parameters.go b/api/jobs/models/job_parameters.go index 78144238..8483cbd1 100644 --- a/api/jobs/models/job_parameters.go +++ b/api/jobs/models/job_parameters.go @@ -34,7 +34,8 @@ type JobParameters struct { ImageTag string // ImageTagNames tags for components - if empty will use default logic - // Example: component1=tag1,component2=tag2 + // + // example: component1=tag1,component2=tag2 ImageTagNames map[string]string } diff --git a/api/jobs/models/job_summary.go b/api/jobs/models/job_summary.go index bb4d67f0..1a414ad7 100644 --- a/api/jobs/models/job_summary.go +++ b/api/jobs/models/job_summary.go @@ -35,7 +35,7 @@ type JobSummary struct { // Image tags names for components - if empty will use default logic // // required: false - // Example: component1: tag1,component2: tag2 + // example: component1: tag1,component2: tag2 ImageTagNames map[string]string `json:"imageTagNames,omitempty"` // Created timestamp @@ -65,14 +65,14 @@ type JobSummary struct { // Status of the job // // required: false - // Enum: Waiting,Running,Succeeded,Stopping,Stopped,Failed,StoppedNoChanges + // enum: Queued,Waiting,Running,Succeeded,Failed,Stopped,Stopping,StoppedNoChanges // example: Waiting Status string `json:"status"` // Name of the pipeline // // required: false - // Enum: build,build-deploy,promote,deploy + // enum: build,build-deploy,promote,deploy // example: build-deploy Pipeline string `json:"pipeline"` diff --git a/api/jobs/models/pipeline_run.go b/api/jobs/models/pipeline_run.go index 90da1227..1fbbdd84 100644 --- a/api/jobs/models/pipeline_run.go +++ b/api/jobs/models/pipeline_run.go @@ -24,8 +24,7 @@ type PipelineRun struct { // Status of the step // // required: false - // Enum: Waiting,Running,Succeeded,Failed - // example: Waiting + // example: Started Status string `json:"status"` // StatusMessage of the task diff --git a/api/jobs/models/pipeline_run_task.go b/api/jobs/models/pipeline_run_task.go index cb0a6b09..236dd3df 100644 --- a/api/jobs/models/pipeline_run_task.go +++ b/api/jobs/models/pipeline_run_task.go @@ -30,8 +30,7 @@ type PipelineRunTask struct { // Status of the task // // required: false - // Enum: Waiting,Running,Succeeded,Failed - // example: Waiting + // example: Running Status string `json:"status"` // StatusMessage of the task diff --git a/api/jobs/models/pipeline_run_task_step.go b/api/jobs/models/pipeline_run_task_step.go index b906d38c..e999cc0b 100644 --- a/api/jobs/models/pipeline_run_task_step.go +++ b/api/jobs/models/pipeline_run_task_step.go @@ -12,8 +12,7 @@ type PipelineRunTaskStep struct { // Status of the task // // required: false - // Enum: Waiting,Running,Succeeded,Failed - // example: Waiting + // example: Completed Status string `json:"status"` // StatusMessage of the task diff --git a/api/jobs/models/step.go b/api/jobs/models/step.go index b3a40749..05d11703 100644 --- a/api/jobs/models/step.go +++ b/api/jobs/models/step.go @@ -12,7 +12,7 @@ type Step struct { // Status of the step // // required: false - // Enum: Waiting,Running,Succeeded,Failed + // enum: Queued,Waiting,Running,Succeeded,Failed,Stopped,StoppedNoChanges // example: Waiting Status string `json:"status"` diff --git a/api/privateimagehubs/models/image_hub_secret.go b/api/privateimagehubs/models/image_hub_secret.go index 03de5da7..73325440 100644 --- a/api/privateimagehubs/models/image_hub_secret.go +++ b/api/privateimagehubs/models/image_hub_secret.go @@ -26,6 +26,7 @@ type ImageHubSecret struct { // - Consistent = Secret value is set // // required: false + // enum: Pending,Consistent // example: Consistent Status string `json:"status"` } diff --git a/api/secrets/models/secret.go b/api/secrets/models/secret.go index d8f8a80d..98014428 100644 --- a/api/secrets/models/secret.go +++ b/api/secrets/models/secret.go @@ -20,7 +20,8 @@ type Secret struct { // Type of the secret // // required: false - // example: csi-az-blob + // enum: generic,client-cert,azure-blob-fuse-volume,csi-azure-blob-volume,csi-azure-key-vault-creds,csi-azure-key-vault-item,client-cert-auth,oauth2-proxy + // example: client-cert Type SecretType `json:"type,omitempty"` // Resource of the secrets @@ -47,6 +48,7 @@ type Secret struct { // - NotAvailable = Secret is available in external secret configuration but not in cluster // // required: false + // enum: Pending,Consistent,NotAvailable,Invalid // example: Consistent Status string `json:"status,omitempty"` diff --git a/api/secrets/models/secret_parameters.go b/api/secrets/models/secret_parameters.go index eb823e24..6d35b323 100644 --- a/api/secrets/models/secret_parameters.go +++ b/api/secrets/models/secret_parameters.go @@ -12,6 +12,7 @@ type SecretParameters struct { // Type of the secret // // required: false - // example: csi-az-blob + // enum: generic,client-cert,azure-blob-fuse-volume,csi-azure-blob-volume,csi-azure-key-vault-creds,csi-azure-key-vault-item,client-cert-auth,oauth2-proxy + // example: azure-blob-fuse-volume Type SecretType `json:"type,omitempty"` } diff --git a/swaggerui_src/swagger.json b/swaggerui_src/swagger.json index 2a899c91..2ecff289 100644 --- a/swaggerui_src/swagger.json +++ b/swaggerui_src/swagger.json @@ -5272,6 +5272,11 @@ "status": { "description": "Status of the auxiliary resource's deployment", "type": "string", + "enum": [ + "Stopped", + "Consistent", + "Reconciling" + ], "x-go-name": "Status", "example": "Consistent" } @@ -5377,6 +5382,10 @@ "status": { "description": "Status of the secret\nPending = Secret value is not set\nConsistent = Secret value is set", "type": "string", + "enum": [ + "Pending", + "Consistent" + ], "x-go-name": "Status", "example": "Consistent" } @@ -5472,12 +5481,23 @@ "status": { "description": "Status of the component", "type": "string", + "enum": [ + "Stopped", + "Consistent", + "Reconciling", + "Restarting", + "Outdated" + ], "x-go-name": "Status", "example": "Consistent" }, "type": { "description": "Type of component", "type": "string", + "enum": [ + "component", + "job" + ], "x-go-name": "Type", "example": "component" }, @@ -5516,6 +5536,10 @@ "type": { "description": "Type of component", "type": "string", + "enum": [ + "component", + "job" + ], "x-go-name": "Type", "example": "component" } @@ -5717,6 +5741,12 @@ "pipelineJobType": { "description": "Type of pipeline job", "type": "string", + "enum": [ + "build", + "build-deploy", + "promote", + "deploy" + ], "x-go-name": "PipelineJobType", "example": "build-deploy" }, @@ -5746,6 +5776,12 @@ "pipelineJobType": { "description": "Type of pipeline job", "type": "string", + "enum": [ + "build", + "build-deploy", + "promote", + "deploy" + ], "x-go-name": "PipelineJobType", "example": "build-deploy" }, @@ -6034,6 +6070,10 @@ "status": { "description": "Status of the secret\nPending = Secret value is not set\nConsistent = Secret value is set", "type": "string", + "enum": [ + "Pending", + "Consistent" + ], "x-go-name": "Status", "example": "Consistent" }, @@ -6156,12 +6196,13 @@ "description": "Status of the job", "type": "string", "enum": [ + "Queued", "Waiting", "Running", "Succeeded", - "Stopping", - "Stopped", "Failed", + "Stopped", + "Stopping", "StoppedNoChanges" ], "x-go-name": "Status", @@ -6282,12 +6323,13 @@ "description": "Status of the job", "type": "string", "enum": [ + "Queued", "Waiting", "Running", "Succeeded", - "Stopping", - "Stopped", "Failed", + "Stopped", + "Stopping", "StoppedNoChanges" ], "x-go-name": "Status", @@ -6509,14 +6551,8 @@ "status": { "description": "Status of the step", "type": "string", - "enum": [ - "Waiting", - "Running", - "Succeeded", - "Failed" - ], "x-go-name": "Status", - "example": "Waiting" + "example": "Started" }, "statusMessage": { "description": "StatusMessage of the task", @@ -6575,14 +6611,8 @@ "status": { "description": "Status of the task", "type": "string", - "enum": [ - "Waiting", - "Running", - "Succeeded", - "Failed" - ], "x-go-name": "Status", - "example": "Waiting" + "example": "Running" }, "statusMessage": { "description": "StatusMessage of the task", @@ -6620,14 +6650,8 @@ "status": { "description": "Status of the task", "type": "string", - "enum": [ - "Waiting", - "Running", - "Succeeded", - "Failed" - ], "x-go-name": "Status", - "example": "Waiting" + "example": "Completed" }, "statusMessage": { "description": "StatusMessage of the task", @@ -7067,12 +7091,12 @@ "description": "Status of the job", "type": "string", "enum": [ - "Waiting", "Running", "Succeeded", + "Failed", + "Waiting", "Stopping", - "Stopped", - "Failed" + "Stopped" ], "x-go-name": "Status", "example": "Waiting" @@ -7127,6 +7151,12 @@ "status": { "description": "Status of the secret\nPending = Secret exists in Radix config, but not in cluster\nConsistent = Secret exists in Radix config and in cluster\nNotAvailable = Secret is available in external secret configuration but not in cluster", "type": "string", + "enum": [ + "Pending", + "Consistent", + "NotAvailable", + "Invalid" + ], "x-go-name": "Status", "example": "Consistent" }, @@ -7236,10 +7266,13 @@ "description": "Status of the step", "type": "string", "enum": [ + "Queued", "Waiting", "Running", "Succeeded", - "Failed" + "Failed", + "Stopped", + "StoppedNoChanges" ], "x-go-name": "Status", "example": "Waiting"