From 4faedfb57aa16c1ef6492b81224b01b69b785f4f Mon Sep 17 00:00:00 2001 From: Lionel Resnik <42772006+lionelresnik@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:13:21 +0300 Subject: [PATCH] OCD-3387 - BE | CI Analysis | Implementation | OpenApi (#528) --- .../oceanCDVerificationParameters.yaml | 16 +++++++++++ .../oceanCDVerificationProvider.yaml | 5 +++- .../oceanCDVerificationProviderJenkins.yaml | 19 +++++++++++++ .../oceanCDVerificationProviderPatch.yaml | 5 +++- .../oceanCDVerificationProviderUpdate.yaml | 5 +++- .../oceanCDVerificationTemplateMetric.yaml | 14 +++++----- ...anCDVerificationTemplateMetricJenkins.yaml | 28 +++++++++++++++++++ ...nCDVerificationTemplateMetricProvider.yaml | 3 ++ 8 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 api/services/ocean/cd/schemas/oceanCDVerificationParameters.yaml create mode 100644 api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderJenkins.yaml create mode 100644 api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricJenkins.yaml diff --git a/api/services/ocean/cd/schemas/oceanCDVerificationParameters.yaml b/api/services/ocean/cd/schemas/oceanCDVerificationParameters.yaml new file mode 100644 index 000000000..2ac1994c5 --- /dev/null +++ b/api/services/ocean/cd/schemas/oceanCDVerificationParameters.yaml @@ -0,0 +1,16 @@ +type: object +title: Ocean CD Verification argument +description: > + Represents Verification Parameters to inject to verification templates when running +properties: + key: + type: string + description: Key of an argument + example: app + value: + type: string + description: Value of an argument + example: my-application +required: + - key + - value \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProvider.yaml b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProvider.yaml index 72445232e..e4c7890fb 100644 --- a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProvider.yaml +++ b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProvider.yaml @@ -26,4 +26,7 @@ properties: $ref: "oceanCDVerificationProviderNewRelic.yaml" cloudWatch: type: object - $ref: "oceanCDVerificationProviderCloudWatch.yaml" \ No newline at end of file + $ref: "oceanCDVerificationProviderCloudWatch.yaml" + jenkins: + type: object + $ref: "oceanCDVerificationProviderJenkins.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderJenkins.yaml b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderJenkins.yaml new file mode 100644 index 000000000..09d28a53b --- /dev/null +++ b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderJenkins.yaml @@ -0,0 +1,19 @@ +type: object +required: + - baseUrl + - username + - apiToken +title: Ocean CD Verification Provider Jenkins +properties: + baseUrl: + type: string + description: The address of the Jenkins server within the cluster. + example: http://localhost:9090 + username: + type: string + description: The Jenkins server’s access username. + example: admin + apiToken: + type: string + description: The Jenkins server’s access apiToken. + example: AbCDeeFFGG \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderPatch.yaml b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderPatch.yaml index da119f52c..2edab54ca 100644 --- a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderPatch.yaml +++ b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderPatch.yaml @@ -22,4 +22,7 @@ properties: $ref: "oceanCDVerificationProviderNewRelic.yaml" cloudWatch: type: object - $ref: "oceanCDVerificationProviderCloudWatch.yaml" \ No newline at end of file + $ref: "oceanCDVerificationProviderCloudWatch.yaml" + jenkins: + type: object + $ref: "oceanCDVerificationProviderJenkins.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderUpdate.yaml b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderUpdate.yaml index 76907b92d..a6b2b773d 100644 --- a/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderUpdate.yaml +++ b/api/services/ocean/cd/schemas/verificationProvider/oceanCDVerificationProviderUpdate.yaml @@ -21,4 +21,7 @@ properties: $ref: "oceanCDVerificationProviderNewRelic.yaml" cloudWatch: type: object - $ref: "oceanCDVerificationProviderCloudWatch.yaml" \ No newline at end of file + $ref: "oceanCDVerificationProviderCloudWatch.yaml" + jenkins: + type: object + $ref: "oceanCDVerificationProviderJenkins.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml index 0d06346bd..70a7b9b30 100644 --- a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml +++ b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml @@ -15,31 +15,31 @@ properties: interval: type: string example: 5m - description: Defines an interval string (30s, 5m, 1h) between each verification measurements. If omitted, will perform a single measurement + description: Defines an interval string (30s, 5m, 1h) between each verification measurements. If omitted, will perform a single measurement. When choosing `Jenkins` as the provider, there is no need to send this variable. initialDelay: type: string - description: How long to wait before starting this metric measurements + description: How long to wait before starting this metric measurements. When choosing `Jenkins` as the provider, there is no need to send this variable. example: 1m count: type: integer - description: The number of times to run the measurement. If both interval and count are omitted, the effective count is 1. If only interval is specified, metric runs indefinitely. If count > 1, interval must be specified + description: The number of times to run the measurement. If both interval and count are omitted, the effective count is 1. If only interval is specified, metric runs indefinitely. If count > 1, interval must be specified. When choosing `Jenkins` as the provider, there is no need to send this variable. example: 10 successCondition: type: string - description: An expression which determines if a measurement is considered successful. The keyword `result` is a variable reference to the value of measurement. Results can be both structured data or primitive. If successCondition is set, then failureCondition is not allowed + description: An expression which determines if a measurement is considered successful. The keyword `result` is a variable reference to the value of measurement. Results can be both structured data or primitive. If successCondition is set, then failureCondition is not allowed. When choosing `Jenkins` as the provider, there is no need to send this variable. example: "result[0] <= 0.95" failureCondition: type: string - description: An expression which determines if a measurement is considered failed. If failureCondition is set, then successCondition is not allowed + description: An expression which determines if a measurement is considered failed. If failureCondition is set, then successCondition is not allowed. When choosing `Jenkins` as the provider, there is no need to send this variable. example: "result[0] >= 1.2" failureLimit: type: integer example: 2 - description: The maximum number of times the measurement is allowed to fail, before the entire metric is considered failed. Default is 0 + description: The maximum number of times the measurement is allowed to fail, before the entire metric is considered failed. Default is 0. When choosing `Jenkins` as the provider, there is no need to send this variable. consecutiveErrorLimit: type: integer example: 4 - description: The maximum number of times the measurement is allowed to error in succession, before the metric is considered error. Default is 4 + description: The maximum number of times the measurement is allowed to error in succession, before the metric is considered error. Default is 4. When choosing `Jenkins` as the provider, there is no need to send this variable. provider: type: object $ref: "oceanCDVerificationTemplateMetricProvider.yaml" diff --git a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricJenkins.yaml b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricJenkins.yaml new file mode 100644 index 000000000..d555245ec --- /dev/null +++ b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricJenkins.yaml @@ -0,0 +1,28 @@ +type: object +required: + - pipelineName + - timeout + - interval +title: Ocean CD Verification Jenkins Metric +properties: + pipelineName: + type: string + description: The Jenkins pipeline name + example: pipelineName + tlsVerification: + type: boolean + example: true + description: Host TLS verification + timeout: + type: string + description: The total jenkins timeout + example: 120s/2m + interval: + type: string + description: The interval time to poll status + example: 5s + parameters: + type: array + description: List of parameters + items: + $ref: "../oceanCDVerificationParameters.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricProvider.yaml b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricProvider.yaml index 601b00c98..7596ad785 100644 --- a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricProvider.yaml +++ b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricProvider.yaml @@ -20,4 +20,7 @@ properties: job: type: object $ref: "oceanCDVerificationTemplateMetricJob.yaml" + jenkins: + type: object + $ref: "oceanCDVerificationTemplateMetricJenkins.yaml"