...
...
...
Project Properties can be accessed Project Properties can be accessed and modified through this API using three services: GET,PUT, and PATCH. These three services allow for the retrieval, complete update, and partial update of Project Properties.
...
Include Page |
---|
...
title | Base URL for Project Properties REST API |
---|
...
http://host:port/flexdeploy/rest/project/{projectid}
|
Table of Contents | |||
---|---|---|---|
|
Each function returns a JSON of Project Property objects. The Project Property object has these attributes:
...
GET
GET
There is one implementation which will find a list of Project Properties associated with the URL specified Project and return the JSON representation of the list of Project Properties.
GET by ID
This GET service will find list of Project Properties associated with the given Project and return the JSON representation of the list.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/project/{projectid}/property |
...
Request
Parameter | Type | Required | Description |
---|---|---|---|
projectid | URL | Yes | This is a URL parameter for the Project Id which is searched to find and return the Properties associated with it. |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Project was found and it's its properties returned |
400 | Bad request |
401Unauthorized | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project was not found with the specified project id |
500 | Unexpected internal server error |
Example
If we had a Project in our database with an Id of 11101 and
the following properties.we run a GET request at the following URL: http://host:port/flexdeploy/rest/v1/project/11101
The GET request would return the following JSON Project Property list
Code Block | ||||||
---|---|---|---|---|---|---|
| {
| |||||
[ { "propertyName": "Approved Check Script",FD_PARTIAL_FILE_EXCLUDES", "propertyValue": "MyCheckScriptjava", }, { "propertyName"credentialId": "ServiceNow Password"null, "propertyValue "isExpression": false "Password" }, { { "propertyName": "ServiceNow PortFD_PARTIAL_FILE_INCLUDES", "propertyValue": "MyPortsql" }, { "propertyNamecredentialId": "ServiceNow URL"null, "propertyValue "isExpression": false "MyURL" }, { { "propertyName": "ServiceNow User Name"FDJDBC_PROPERTY_REPLACEMENT_DEFAULT", "propertyValue": "true", "propertyValuecredentialId": null, "MyUserNameisExpression": false } |
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/project/{11101}
The GET request would return the following JSON Project Property list
Code Block | ||||
---|---|---|---|---|
| ||||
[ }, { { "propertyName": "Approved Check Script",FDJDBC_RETRY_COUNT_DEFAULT", "propertyValue": "MyCheckScript" }, 5, { "propertyNamecredentialId": "ServiceNow Password"null, "propertyValue "isExpression": "*****" false }, { { "propertyName": "ServiceNow PortFDJDBC_SQL_EXTENSIONS", "propertyValue": "MyPort"seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc", }, "credentialId": {null, "isExpression": false }, "propertyName": "ServiceNow URL", { "propertyValuepropertyName": "MyURL" }, {FDJDBC_SQL_ROOT_TARGET_FOLDER", "propertyNamepropertyValue": "/sql"ServiceNow, User Name", "propertyValuecredentialId": null, "MyUserNameisExpression": false } ] |
,
{
"propertyName": "JDBC_ALTERNATE_SCHEMA_PASS",
"propertyValue": "*****",
"credentialId": 49384,
"isExpression": false
}
] |
PUT
This PUT service will update the propertyValue of each property in the project associated with the Project id specified in the URL.
Info | ||||
---|---|---|---|---|
| ||||
http://host:port/flexdeploy/rest/v1/project/{projectid} | ||||
Code Block | ||||
| ||||
[
{
"propertyName": "Approved Check Script",
"propertyValue": "Put1"
},
{
"propertyName": "ServiceNow Password",
"propertyValue": "Put2"
},
{
"propertyName": "ServiceNow Port",
"propertyValue": "Put3"
},
{
"propertyName": "ServiceNow URL", /property |
Request
Attributes | Type | Required | Description |
---|---|---|---|
projectid | URL | Yes | This is the Id of the Project which will have it's Properties updated. |
properties | List<PropertyValuePojo> | Yes | This is the list of properties being set for the project. Attributes for a property object are described below |
PropertyValuePojo
Attributes | Type | Required | Description |
---|---|---|---|
propertyName | String | Yes | This is the key name of the property |
propertyValue | String | No | This is the value that the property with the associated propertyName will be updated to |
credentialId | Long | No | The id of the credential associated to this property. Applicable only for encrypted properties |
isExpression | Boolean | No | Is the propertyValue a groovy expression? @Since 5.3.0.1 |
Tip |
---|
All unlisted properties for the project will default to null for PUT requests. |
Response Codes
HTTP Code | Description |
---|---|
200 | Project was found and its Properties were updated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project not found |
500 | Unexpected internal server error |
Example
If we had an Project in our database with a Project Id of 25262 and the following Properties
Code Block | ||||
---|---|---|---|---|
| ||||
[ { " |
...
propertyName": " |
...
FD_PARTIAL_FILE_EXCLUDES", "propertyValue": "java", "credentialId": null, "isExpression": false }, { |
...
"propertyName": " |
...
FD_PARTIAL_FILE_INCLUDES", "propertyValue": " |
...
", |
...
Parameters
...
This is the name of the type of the single property associated with it. (Can be many)
...
Note: unlisted properties will default to null.
Response Codes
...
...
...
Example
If we had an Project in our database with a Project Id of 25262 and the following Properties
Code Block | ||||
---|---|---|---|---|
| ||||
[ "credentialId": null, "isExpression": false }, { "propertyName": "FDJDBC_PROPERTY_REPLACEMENT_DEFAULT", "propertyValue": "true", "credentialId": null, "isExpression": false }, { "propertyName": "FDJDBC_RETRY_COUNT_DEFAULT", { "propertyValue": 5, "propertyNamecredentialId": "Approved Check Script", "propertyValue": "MyCheckScript"null, "isExpression": false }, { { "propertyName": "ServiceNow PasswordFDJDBC_SQL_EXTENSIONS", "propertyValue": "MyPassword" }, {seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc", "propertyNamecredentialId": "ServiceNow Port"null, "propertyValue "isExpression": false "MyPort" }, { { "propertyName": "ServiceNow URLFDJDBC_SQL_ROOT_TARGET_FOLDER", "propertyValue": "MyURL/sql", }, "credentialId": null, { "isExpression": false }, { "propertyName": "ServiceNow User NameJDBC_ALTERNATE_SCHEMA_PASS", "propertyValue": "MyUserName*****" , "credentialId": 49384, "isExpression": false } ] |
When we run a PUT request at the following URL: http://host:port/flexdeploy/rest/v1/project/
{25262
}
And the PUT request receives the following JSON Project Properties list
Code Block | ||||
---|---|---|---|---|
| ||||
[ { { "propertyName": "Approved Check Script",FD_PARTIAL_FILE_EXCLUDES", "propertyValue": "Put1java", }, "credentialId": { null, "isExpression": false "}, { "propertyName": "ServiceNow PasswordFD_PARTIAL_FILE_INCLUDES", "propertyValue": "Put2sql", }, "credentialId": null, "isExpression": false { }, "propertyName": "ServiceNow Port",{ "propertyValue": "Put3" }, {propertyName": "FDJDBC_PROPERTY_REPLACEMENT_DEFAULT", "propertyValue": "true", "credentialId": null, "isExpression": false }, { "propertyName": "FDJDBC_RETRY_COUNT_DEFAULT", "propertyValue": 5, "credentialId": null, "isExpression": false }, { "propertyName": "FDJDBC_SQL_EXTENSIONS", "propertyValue": "seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc", "credentialId": null, "isExpression": false }, { "propertyName": "JDBC_ALTERNATE_SCHEMA_PASS", "propertyValue": "", "credentialId": 71422, "isExpression": false } ] |
The PUT request would then update the Project Properties of the Project with Id 25262 and return the following JSON Project Properties list.
Code Block | ||||
---|---|---|---|---|
| ||||
[
{
"propertyName": "FD_PARTIAL_FILE_EXCLUDES",
"propertyValue": "java",
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FD_PARTIAL_FILE_INCLUDES",
"propertyValue": "sql",
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FDJDBC_PROPERTY_REPLACEMENT_DEFAULT",
"propertyValue": "true",
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FDJDBC_RETRY_COUNT_DEFAULT",
"propertyValue": 5,
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FDJDBC_SQL_EXTENSIONS",
"propertyValue": "seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc",
"credentialId": null,
"isExpression": false
},
{
"propertyName": "FDJDBC_SQL_ROOT_TARGET_FOLDER",
"propertyValue": null,
"credentialId": null,
"isExpression": false
},
{
"propertyName": "JDBC_ALTERNATE_SCHEMA_PASS",
"propertyValue": "*****",
"credentialId": 71422,
"isExpression": false
}
] |
PATCH
This PATCH service will update an existing Project's Properties with the information passed through a JSON object. If a property is not listed it will not be updated in the Project.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/v1/project/{projectid}/property |
Request
Attributes | Type | Required | Description |
---|---|---|---|
projectId | URL | Yes | This is the Id of the Project which will have it's Properties updated. |
properties | List<PropertyValuePojo> | Yes | This is the list of properties being set for the project. Attributes for a property object are described below |
PropertyValuePojo
Attributes | Type | Required | Description |
---|---|---|---|
propertyName | String | Yes | This is the key name of the property |
propertyValue | String | No | This is the value that the property with the associated propertyName will be updated to |
credentialId | Long | No | The id of the credential associated to this property. Applicable only for encrypted properties |
isExpression | Boolean | No | Is the propertyValue a groovy expression? @Since 5.3.0.1 |
Include Page | ||||
---|---|---|---|---|
|
Response Codes
HTTP Code | Description |
---|---|
200 | Project was found and its Properties were updated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project not found |
500 | Unexpected internal server error |
Example
If we had a Project in our database with an Id of 12723 and had the following attributes
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "propertyName": " |
...
FD_PARTIAL_FILE_EXCLUDES", "propertyValue": " |
...
java", |
...
"credentialId": null, "isExpression": false |
...
}, |
...
{ " |
...
propertyName": " |
...
The PUT request would then update the Project Properties of the Project with Id 25262 and return the following JSON Project Properties list.
...
theme | Eclipse |
---|---|
title | Project Properties PUT Return JSON |
...
FD_PARTIAL_FILE_INCLUDES", " |
...
propertyValue": "sql" |
...
, |
...
|
...
" |
...
credentialId": null, " |
...
isExpression": false }, { |
...
"propertyName": " |
...
FDJDBC_PROPERTY_REPLACEMENT_DEFAULT", "propertyValue": "true", "credentialId": null, " |
...
isExpression": |
...
false }, { |
...
"propertyName": " |
...
FDJDBC_RETRY_COUNT_DEFAULT", "propertyValue": |
...
5, |
...
"credentialId": null, "isExpression": false |
...
}, |
...
{ " |
...
propertyName": " |
...
FDJDBC_SQL_EXTENSIONS", " |
...
propertyValue": " |
...
seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc", " |
...
credentialId": |
...
PATCH
This PATCH service will update an existing Project's Properties with the information passed through a JSON object. If a property is not listed it will not be updated in the Project.
Info | ||
---|---|---|
| ||
http://host:port/flexdeploy/rest/project/{projectid} |
Parameters
This is the name of the type of the single property associated with it. (Can be many)
Response Codes
Example
If we had a Project in our database with an Id of 12723 and had the following attributesnull,
"isExpression": false
},
{
"propertyName": "FDJDBC_SQL_ROOT_TARGET_FOLDER",
"propertyValue": null,
"credentialId": null,
"isExpression": false
},
{
"propertyName": "JDBC_ALTERNATE_SCHEMA_PASS",
"propertyValue": "*****",
"credentialId": 71422,
"isExpression": false
}
] |
When we run a PATCH request at the following URL: http://host:port/flexdeploy/rest/v1/project/12723
And the PATCH request receives the following JSON Project Properties object,
Code Block | ||||
---|---|---|---|---|
| ||||
[ { {"propertyName": "FD_PARTIAL_FILE_EXCLUDES", "propertyNamepropertyValue": "java"Approved, Check Script", "propertyValuecredentialId": null, "MyCheckScriptisExpression": false }, { { "propertyName": "ServiceNow PasswordFDJDBC_SQL_ROOT_TARGET_FOLDER", "propertyValue": "MyPassword/targetfolder", }, "credentialId": { null, "isExpression": false }, { "propertyName": "JDBC_ALTERNATE_SCHEMA_PASS", "propertyValue"ServiceNow: Port"", "credentialId": 80855, "isExpression": false "propertyValue": "MyPort" }, { } ] |
The PATCH request would then update the specified Project's Properties and return the following JSON object
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "propertyName": "ServiceNow URL", "propertyValue": "MyURL" }, {FD_PARTIAL_FILE_EXCLUDES", "propertyNamepropertyValue": "java"ServiceNow, User Name", "propertyValuecredentialId": null, "MyUserNameisExpression": false } ] |
When we run a PATCH request at the following URL
http://host:port/flexdeploy/rest/project/{12723}
And the PATCH request receives the following JSON Project Properties object,
Code Block | ||||
---|---|---|---|---|
| ||||
[ }, { "propertyName": "ServiceNow URL",FD_PARTIAL_FILE_INCLUDES", "propertyValue": "sql", "propertyValue"credentialId": null, "isExpression": "PatchedURL"false }, { { "propertyName": "ServiceNow User NameFDJDBC_PROPERTY_REPLACEMENT_DEFAULT", "propertyValue": "PatchedUserNametrue", } ] |
The PATCH request would then update the specified Project's Properties and return the following JSON object
Code Block | ||||
---|---|---|---|---|
| ||||
[ "credentialId": null, "isExpression": false }, { "propertyName": "Approved Check Script",FDJDBC_RETRY_COUNT_DEFAULT", "propertyValue": 5, "propertyValue"credentialId": null, "isExpression": false "MyCheckScript" }, { { "propertyName": "ServiceNow PasswordFDJDBC_SQL_EXTENSIONS", "propertyValue": "MyPassword" }, {seq,tbl,idx,typ,tps,tpb,sql,pkh,plb,pks,pkb,pls,pck,fnc,trg,spc,bdy,prc", "propertyNamecredentialId": "ServiceNow Port"null, "propertyValue "isExpression": false "MyPort" }, { { "propertyName": "ServiceNow URLFDJDBC_SQL_ROOT_TARGET_FOLDER", "propertyValue": "PatchedURL/targetfolder", }, "credentialId": null, "isExpression": false }, { "propertyName": "ServiceNow User NameJDBC_ALTERNATE_SCHEMA_PASS", "propertyValue": "PatchedUserName*****", "credentialId": 80855, "isExpression": false } ] |