Skip to content

Commit

Permalink
update swagger spec for enums (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pespiri authored Dec 5, 2023
1 parent 468f2f0 commit 33a4171
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 50 deletions.
1 change: 1 addition & 0 deletions api/buildsecrets/models/build_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type BuildSecret struct {
// - Consistent = Secret value is set
//
// required: false
// enum: Pending,Consistent
// example: Consistent
Status string `json:"status"`
}
6 changes: 5 additions & 1 deletion api/deployments/models/component_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Component struct {
// Type of component
//
// required: true
// enum: component,job
// example: component
Type string `json:"type"`

Expand All @@ -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"`

Expand Down Expand Up @@ -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"`

Expand Down Expand Up @@ -196,6 +199,7 @@ type ComponentSummary struct {
// Type of component
//
// required: true
// enum: component,job
// example: component
Type string `json:"type"`

Expand Down Expand Up @@ -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"`
}
Expand Down
1 change: 1 addition & 0 deletions api/deployments/models/deployment_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
4 changes: 2 additions & 2 deletions api/deployments/models/scheduled_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down Expand Up @@ -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"`

Expand Down
2 changes: 1 addition & 1 deletion api/environments/models/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
2 changes: 1 addition & 1 deletion api/environments/models/environment_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
6 changes: 3 additions & 3 deletions api/jobs/models/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`

Expand Down
3 changes: 2 additions & 1 deletion api/jobs/models/job_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions api/jobs/models/job_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`

Expand Down
3 changes: 1 addition & 2 deletions api/jobs/models/pipeline_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions api/jobs/models/pipeline_run_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions api/jobs/models/pipeline_run_task_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/jobs/models/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
1 change: 1 addition & 0 deletions api/privateimagehubs/models/image_hub_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ImageHubSecret struct {
// - Consistent = Secret value is set
//
// required: false
// enum: Pending,Consistent
// example: Consistent
Status string `json:"status"`
}
4 changes: 3 additions & 1 deletion api/secrets/models/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"`

Expand Down
3 changes: 2 additions & 1 deletion api/secrets/models/secret_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Loading

0 comments on commit 33a4171

Please sign in to comment.