mirror of https://github.com/coder/coder.git
8.0 KiB
8.0 KiB
Parameters
Get parameters
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/parameters/{scope}/{id} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /parameters/{scope}/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
scope |
path | string | true | Scope |
id |
path | string(uuid) | true | ID |
Enumerated Values
Parameter | Value |
---|---|
scope |
template |
scope |
workspace |
scope |
import_job |
Example responses
200 Response
[
{
"created_at": "2019-08-24T14:15:22Z",
"destination_scheme": "none",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"scope": "template",
"scope_id": "5d3fe357-12dd-4f62-b004-6d1fb3b8454f",
"source_scheme": "none",
"source_value": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | array of codersdk.Parameter |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
[array item] |
array | false | [Parameter represents a set value for the scope.] | |
» created_at |
string(date-time) | false | ||
» destination_scheme |
codersdk.ParameterDestinationScheme | false | ||
» id |
string(uuid) | false | ||
» name |
string | false | ||
» scope |
codersdk.ParameterScope | false | ||
» scope_id |
string(uuid) | false | ||
» source_scheme |
codersdk.ParameterSourceScheme | false | ||
» source_value |
string | false | ||
» updated_at |
string(date-time) | false |
Enumerated Values
Property | Value |
---|---|
destination_scheme |
none |
destination_scheme |
environment_variable |
destination_scheme |
provisioner_variable |
scope |
template |
scope |
workspace |
scope |
import_job |
source_scheme |
none |
source_scheme |
data |
To perform this operation, you must be authenticated. Learn more.
Create parameter
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/parameters/{scope}/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /parameters/{scope}/{id}
Body parameter
{
"copy_from_parameter": "000e07d6-021d-446c-be14-48a9c20bca0b",
"destination_scheme": "none",
"name": "string",
"source_scheme": "none",
"source_value": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
scope |
path | string | true | Scope |
id |
path | string(uuid) | true | ID |
body |
body | codersdk.CreateParameterRequest | true | Parameter request |
Enumerated Values
Parameter | Value |
---|---|
scope |
template |
scope |
workspace |
scope |
import_job |
Example responses
201 Response
{
"created_at": "2019-08-24T14:15:22Z",
"destination_scheme": "none",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"scope": "template",
"scope_id": "5d3fe357-12dd-4f62-b004-6d1fb3b8454f",
"source_scheme": "none",
"source_value": "string",
"updated_at": "2019-08-24T14:15:22Z"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Created | codersdk.Parameter |
To perform this operation, you must be authenticated. Learn more.
Delete parameter
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/parameters/{scope}/{id}/{name} \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
DELETE /parameters/{scope}/{id}/{name}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
scope |
path | string | true | Scope |
id |
path | string(uuid) | true | ID |
name |
path | string | true | Name |
Enumerated Values
Parameter | Value |
---|---|
scope |
template |
scope |
workspace |
scope |
import_job |
Example responses
200 Response
{
"detail": "string",
"message": "string",
"validations": [
{
"detail": "string",
"field": "string"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | codersdk.Response |
To perform this operation, you must be authenticated. Learn more.