Hi Chad, This works. Thank you.
Regards, Shwetha On Thursday, January 9, 2025 at 12:15:54 PM UTC+5:30 Chad Wilson wrote: > Hi Shwetha > > If you want to get your pipelines into config repositories, the right API > to use is the export API: > https://api.gocd.org/current/#export-pipeline-config-to-config-repo-format > i.e > > /go/api/admin/export/pipelines/<pipelineName>?plugin_id=json.config.plugin > > The "raw" JSON API format of GoCD pipelines you refer to below predates > configuration repositories and the format differs, as you've observed. The > export API delegates to the individual plugin type to determine what a > given pipeline looks like in its own format. > > This API is the equivalent to using the download/export button for an > individual pipeline from the UI: > > [image: image.png] > > -Chad > > On Thu, 9 Jan 2025 at 14:33, SHWETHA H R <[email protected]> wrote: > >> Hello, >> >> We have GoCD pipelines configured in our current set up and we want to >> move these pipeline json configuration files to BitBucket and set up a >> config repository and import these pipelines in the new GoCD. >> >> We have used GoCD API to export these pipelines. But the pipeline json >> configuration looks different from the manually download one. >> >> The one that is downloaded from the UI works fine with the config >> repository, but the API one is not working. I see there is an attribute >> parameter being used within the materials and it is not there in the >> manually downloaded one. This is causing the issue. >> >> "materials": [ >> { >> "attributes": { >> "url": "<repo_url>", >> "branch": "master", >> "shallow_clone": false, >> "filter": { >> "ignore": [], >> "includes": [] >> }, >> "auto_update": true >> }, >> "type": "git" >> } >> ] >> >> We are following https://api.gocd.org/24.1.0/#get-pipeline-config to >> fetch the pipeline config. >> >> It is difficult to download so many pipelines manually and make changes >> in each and every pipeline. >> Please let us know if there is any change that we need to make in the API >> call to export it without the attributes parameter or please share the API >> document that supports config repository. >> >> Thanks and Regards, >> Shwetha >> >> -- >> You received this message because you are subscribed to the Google Groups >> "go-cd" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion visit >> https://groups.google.com/d/msgid/go-cd/2a76b98f-86c1-48bc-9101-47a1ee021100n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/go-cd/2a76b98f-86c1-48bc-9101-47a1ee021100n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/go-cd/90735e3e-b5d6-4ddf-bb4f-3898e43cac7fn%40googlegroups.com.
