Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger Evaluation via API like from CLI #38

Closed
thikoen opened this issue Sep 7, 2021 · 2 comments
Closed

Trigger Evaluation via API like from CLI #38

thikoen opened this issue Sep 7, 2021 · 2 comments

Comments

@thikoen
Copy link

thikoen commented Sep 7, 2021

Hello,
I just have a quick question:
When i try "keptn trigger evaluation ..." from CLI everything works as expected and i dont need a starttime for that.
When trying with the API i didnt find a direct trigger event, just the "start-evaluation" type event where i need a time or timeframe. Is it possible to trigger without a starttime like i would do it via CLI? What is the equivalent event type to "trigger evaluation"?
Thanks and kind regards
Thilo

@pcjeffmac
Copy link
Contributor

When calling the API to trigger an evaluation, you call the event API endpoint.
${keptn_endpoint}/v1/event

In the payload, (JSON body)
You set the type to trigger the evaluation.
"type": "sh.keptn.event.${stage}.evaluation.triggered"

Here is a sample of a full json payload.

{
"data": {
"teststrategy" : "manual",
"project": "${project}",
"stage": "${stage}",
"service": "${service}",
"monitoring": "${monitoring}",
"labels": {
"buildId" : "${tag}",
"jobname" : "${JOB_NAME}",
"buildNumber": "${BUILD_NUMBER}",
"joburl" : "${BUILD_URL}"
},
"status": "succeeded",
"result": "pass",
"test": {
"start": "${starttime}",
"end" : "${endtime}"
},
"evaluation": {
"start": "${starttime}",
"end": "${endtime}"
},
"image" : "${image}",
"tag" : "${tag}",
},
"datacontenttype": "application/json",
"source": "Jenkins",
"specversion": "1.0",
"type": "sh.keptn.event.${stage}.evaluation.triggered"
}

Thanks,

@christian-kreuzberger-dtx
Copy link
Contributor

Duplicate of #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants