From 0ac7e6729d4763b1fce8cb3540b2b8d0d20b2ed8 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Mon, 15 Apr 2019 17:56:53 +1200 Subject: Update API to support typed CI variables Update API endpoints and docs about project level variables, group level variables, pipeline variables, and pipeline schedule variables to support variable types. --- doc/api/pipeline_schedules.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc/api/pipeline_schedules.md') diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md index 50d9e007ecc..1c8acf41e09 100644 --- a/doc/api/pipeline_schedules.md +++ b/doc/api/pipeline_schedules.md @@ -88,6 +88,7 @@ curl --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gitlab.example.com/ "variables": [ { "key": "TEST_VARIABLE_1", + "variable_type": "env_var", "value": "TEST_1" } ] @@ -296,6 +297,7 @@ POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | | `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed | | `value` | string | yes | The `value` of a variable | +| `variable_type` | string | no | The type of variable, must be one of env_var or file (default: `env_var`) | ```sh curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "key=NEW_VARIABLE" --form "value=new value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables" @@ -304,6 +306,7 @@ curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "key=N ```json { "key": "NEW_VARIABLE", + "variable_type": "env_var", "value": "new value" } ``` @@ -322,6 +325,7 @@ PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | | `key` | string | yes | The `key` of a variable | | `value` | string | yes | The `value` of a variable | +| `variable_type` | string | no | The type of variable, must be one of env_var or file | ```sh curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "value=updated value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE" @@ -331,6 +335,7 @@ curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "value= { "key": "NEW_VARIABLE", "value": "updated value" + "variable_type": "env_var", } ``` -- cgit v1.2.1 From 4170c49be379a66bc7f965ff3c1291e1e433282c Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 24 Apr 2019 15:30:30 +1200 Subject: Update API docs with accepted variable type values Be explicit that currently supported types are `env_var` end `file` and that `env_var` is the default. --- doc/api/pipeline_schedules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/api/pipeline_schedules.md') diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md index 1c8acf41e09..90b0537eca0 100644 --- a/doc/api/pipeline_schedules.md +++ b/doc/api/pipeline_schedules.md @@ -297,7 +297,7 @@ POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | | `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed | | `value` | string | yes | The `value` of a variable | -| `variable_type` | string | no | The type of variable, must be one of env_var or file (default: `env_var`) | +| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` | ```sh curl --request POST --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "key=NEW_VARIABLE" --form "value=new value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables" -- cgit v1.2.1 From 84bce2d954f6b633dab6ee56fd3c04338dd55c9a Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Mon, 29 Apr 2019 14:19:50 +1200 Subject: Update API docs to unify CI variable type explanations --- doc/api/pipeline_schedules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/api/pipeline_schedules.md') diff --git a/doc/api/pipeline_schedules.md b/doc/api/pipeline_schedules.md index 90b0537eca0..470e55425f8 100644 --- a/doc/api/pipeline_schedules.md +++ b/doc/api/pipeline_schedules.md @@ -325,7 +325,7 @@ PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables/:key | `pipeline_schedule_id` | integer | yes | The pipeline schedule id | | `key` | string | yes | The `key` of a variable | | `value` | string | yes | The `value` of a variable | -| `variable_type` | string | no | The type of variable, must be one of env_var or file | +| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` | ```sh curl --request PUT --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" --form "value=updated value" "https://gitlab.example.com/api/v4/projects/29/pipeline_schedules/13/variables/NEW_VARIABLE" -- cgit v1.2.1