Variablegroups - Add
Add a variable group.
POST https://{instance}/{collection}/{project}/_apis/distributedtask/variablegroups?api-version=4.1-preview.1
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
collection
|
path | True |
string |
The name of the Team Foundation Server collection. |
|
instance
|
path | True |
string |
TFS server name ({server:port}) |
|
project
|
path | True |
string |
Project ID or project name |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '4.1-preview.1' to use this version of the api. |
Request Body
| Name | Type | Description |
|---|---|---|
| description |
string |
Sets description of the variable group. |
| name |
string |
Sets name of the variable group. |
| providerData |
Sets provider data. |
|
| type |
string |
Sets type of the variable group. |
| variables |
<string,
Variable |
Sets variables contained in the variable group. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
successful operation |
Security
accessToken
Personal access token. Use any value for the user name and the token as the password.
Type:
basic
Examples
Add a variable group
Sample request
POST https://{instance}/{collection}/DGDemo/_apis/distributedtask/variablegroups?api-version=4.1-preview.1
{
"variables": {
"key1": {
"value": "value1"
},
"key2": {
"value": "value2",
"isSecret": true
}
},
"type": "Vsts",
"name": "TestVariableGroup1",
"description": "A test variable group"
}
Sample response
{
"variables": {
"key1": {
"value": "value1"
},
"key2": {
"value": null,
"isSecret": true
}
},
"id": 1,
"type": "Vsts",
"name": "TestVariableGroup1",
"description": "A test variable group",
"createdBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
},
"createdOn": "2017-12-12T06:35:51.6933333Z",
"modifiedBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
},
"modifiedOn": "2017-12-12T06:35:51.6933333Z"
}
Definitions
| Name | Description |
|---|---|
|
Identity |
|
|
Reference |
The class to represent a collection of REST reference links. |
|
Variable |
A variable group is a collection of related variables. |
|
Variable |
|
|
Variable |
Defines provider data of the variable group. |
|
Variable |
IdentityRef
| Name | Type | Description |
|---|---|---|
| _links |
This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. |
|
| descriptor |
string |
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Collections. |
| directoryAlias |
string |
|
| displayName |
string |
This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. |
| id |
string |
|
| imageUrl |
string |
|
| inactive |
boolean |
|
| isAadIdentity |
boolean |
|
| isContainer |
boolean |
|
| profileUrl |
string |
|
| uniqueName |
string |
|
| url |
string |
This url is the full route to the source resource of this graph subject. |
ReferenceLinks
The class to represent a collection of REST reference links.
| Name | Type | Description |
|---|---|---|
| links |
object |
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |
VariableGroup
A variable group is a collection of related variables.
| Name | Type | Description |
|---|---|---|
| createdBy |
Gets or sets the identity who created the variable group. |
|
| createdOn |
string (date-time) |
Gets or sets the time when variable group was created. |
| description |
string |
Gets or sets description of the variable group. |
| id |
integer (int32) |
Gets or sets id of the variable group. |
| modifiedBy |
Gets or sets the identity who modified the variable group. |
|
| modifiedOn |
string (date-time) |
Gets or sets the time when variable group was modified |
| name |
string |
Gets or sets name of the variable group. |
| providerData |
Gets or sets provider data. |
|
| type |
string |
Gets or sets type of the variable group. |
| variables |
<string,
Variable |
Gets or sets variables contained in the variable group. |
VariableGroupParameters
| Name | Type | Description |
|---|---|---|
| description |
string |
Sets description of the variable group. |
| name |
string |
Sets name of the variable group. |
| providerData |
Sets provider data. |
|
| type |
string |
Sets type of the variable group. |
| variables |
<string,
Variable |
Sets variables contained in the variable group. |
VariableGroupProviderData
Defines provider data of the variable group.
VariableValue
| Name | Type | Description |
|---|---|---|
| isSecret |
boolean |
|
| value |
string |