Ich muss herausfinden, wie man Parameter an diese Pipeline übergibt. ID 3023 und gibt Status 200: < /p>
zurück
Code: Select all
def run_pipeline(PAT):
url="[organization_url]_apis/pipelines/[pipeline_id]/runs?api-version=6.0-preview.1"
headers = {"Content-Type": "application/json; charset=utf-8"}
data={
'id': '3023'
}
request_run_pipeline = requests.post(url, headers=headers, json=data, auth = ('',PAT),verify = False)
return(print(request_run_pipeline.status_code))
< /code>
Jetzt sieht meine Testpipeline mit einem Parameter so aus: < /p>
parameters:
- name: text
type: string
default: test pipeline
trigger:
branches:
include:
- main
steps:
- script: echo ${{ parameters.text }}
displayName: 'run one-line script - write text'