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

Create / Modify / List Templates over Rest API #2233

Closed
unixunion opened this issue May 29, 2016 · 1 comment

Comments

Projects
None yet
4 participants
@unixunion
Copy link

commented May 29, 2016

Issue Type
  • Feature enhancement
Summary

As a Continuous Delivery and Integration automation system developer, I would like to be able to create / modify and list templates that are available within the Go Server through the REST Api, similarly to the how pipelines are created.

I want to create templates and define their stages
list the templates I have created ( plus a description of the template )
I want to modify templates

/K

@varshavaradarajan

This comment has been minimized.

Copy link
Contributor

commented Aug 24, 2016

INDEX:

URL: https://ci.example.com/go/api/admin/templates
Header Accept: application/vnd.go.cd.v1+json

{
  "templates": [
    {
      "name": "template",
      "pipelines": [
       {
         "name": "up42"
       }
      ]
    }
  ]
}

GET
URL: https://ci.example.com/go/api/admin/templates/foo
Header Accept: application/vnd.go.cd.v1+json

{
  "name": "foo",
  "stages": [
    {
      "name": "up42_stage",
      "fetch_materials": true,
      "clean_working_directory": false,
      "never_cleanup_artifacts": false,
      "approval": {
        "type": "success",
        "authorization": {
          "roles": [

          ],
          "users": [

          ]
        }
      },
      "environment_variables": [

      ],
      "jobs": [
        {
          "name": "up42_job",
          "run_instance_count": null,
          "timeout": null,
          "environment_variables": [

          ],
          "resources": [

          ],
          "tasks": [
            {
              "type": "exec",
              "attributes": {
                "run_if": [

                ],
                "on_cancel": null,
                "command": "ls",
                "working_directory": null
              }
            }
          ],
          "tabs": [

          ],
          "artifacts": [

          ],
          "properties": null
        }
      ]
    }
  ]
}

CREATE

URL: https://ci.example.com/go/api/admin/templates
Header Accept: application/vnd.go.cd.v1+json
Header Content-Type: application/json

"name": "template",
 "stages": [
    {
      "name": "my_stage",
      "fetch_materials": true,
      "clean_working_directory": false,
      "never_cleanup_artifacts": false,
      "approval": {
        "type": "success",
        "authorization": {
          "roles": [],
          "users": []
        }
      },
      "environment_variables": [],
      "jobs": [
        {
          "name": "my_job",
          "run_instance_count": null,
          "timeout": 0,
          "environment_variables": [],
          "resources": [
                "Linux",
                "Java"
          ],
          "tasks": [
            {
              "type": "exec",
              "attributes": {
                "run_if": [
                  "passed"
                ],
                "on_cancel": {
                  "type": "exec",
                  "attributes": {
                    "command": "ls",
                    "working_directory": null
                  }
                },
                "command": "sleep",
                "arguments": [
                  "10"
                ],
                "working_directory": null
              }
            }
         ],
          "tabs": [
            {
              "name": "cobertura",
              "path": "target/site/cobertura/*.xml"
            }
          ],
          "artifacts": [
            {
              "source": "target",
              "destination": "result",
              "type": "build"
            },
            {
              "source": "test",
              "destination": "res1",
              "type": "test"
            }
          ],
          "properties": null
        }
      ]
    }
  ]
}'

varshavaradarajan added a commit to varshavaradarajan/gocd that referenced this issue Aug 25, 2016

varshavaradarajan added a commit to varshavaradarajan/gocd that referenced this issue Aug 25, 2016

varshavaradarajan added a commit to varshavaradarajan/gocd that referenced this issue Sep 8, 2016

varshavaradarajan added a commit to varshavaradarajan/gocd that referenced this issue Sep 9, 2016

varshavaradarajan added a commit to varshavaradarajan/gocd that referenced this issue Sep 12, 2016

ketan added a commit that referenced this issue Sep 13, 2016

Merge pull request #2591 from varshavaradarajan/templates-api
Templates API - index, show, create, update. (#2233)

@ketan ketan added this to the Release 16.10 milestone Sep 23, 2016

@zabil zabil modified the milestones: Release 16.11, Release 16.10 Sep 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.