Project Stream API
Project Streams can be accessed and modified through this API using four services: GET, POST, PUT, and PATCH. These four services allow for retrieving, creating, completely updating, and partially updating Project Streams, as well as populating files from a Project Stream.
Authentication - Use Basic Authentication for this API.
GET
There are two implementations of GET. One will find a Project Stream with the given Id and return the JSON representation of the Project Stream. The other will find a list of Project Streams matching the query parameters supplied to it.
GET by ID
This GET service will find a Project Stream with the given Id and return the JSON representation of the object.
API URL
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream/{streamid}
Request
Parameter | Type | Required | Description |
---|---|---|---|
projectid | URL | Yes | This is a URL parameter for the Project Id which is searched to find and return a Stream |
streamid | URL | Yes | This is a URL parameter for the Project Stream Id which will be returned from the corresponding Project |
Response
Attributes | Type | Description |
---|---|---|
description | String | This is a description of the Project Stream |
isActive | Boolean | This is a Boolean that tracks whether or not the Project Stream is active |
attribute1 | String | This is the first attribute of the Project Stream |
attribute2 | String | This is the second attribute of the Project Stream |
attribute3 | String | This is the third attribute of the Project Stream |
versionSyntaxScript | String | This is the version syntax script of the Project Stream |
streamId | Long | This is the unique Id of the Project Stream |
streamName | String | This is the unique name of the Project Stream |
Response Codes
HTTP Code | Description |
---|---|
200 | Project Stream was found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project or Stream not found |
500 | Unexpected internal server error |
Example
If we had a Project Stream in our database with an Id of 11101 belonging to a project with an Id of 10002 and the following attributes:
{ "description": "Stream Description", "isActive": true, "streamName": "FirstStream", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "three", "attribute2": "two", "attribute1": "one", "streamId": 11101, "sequenceNumber": 3 }
When we run a GET request at the following URL:
http://host:port/flexdeploy/rest/v1/project/10002/stream/11101,
The GET request would return the following JSON Project Stream object:
{ "description": "Stream Description", "isActive": true, "streamName": "FirstStream", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "three", "attribute2": "two", "attribute1": "one", "streamId": 11101, "sequenceNumber": 3 }
GET (Using Query Parameters)
This GET service will return a list of Project Streams from the specified project in the form of JSON objects based on the query parameter streamname. Project Streams are only returned if they match all of the specified query parameters and belong to the corresponding Project. If no query parameters are given this request will return the entire list of Streams within the specified Project.
API URLs
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream?
Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters:
streamName={streamName}
isActive={boolean}
Examples:
To search by code only:
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream?streamName={name}
To search by isActive and code:
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream?isActive={boolean}&streamName={name}
The query parameters are not case sensitive. Searching by name=NAME is the same as searching by name=name.
Request
Parameter | Type | Required | Description |
---|---|---|---|
projectId | URL | Yes | This is a URL path parameter for the Project Id which specifies the project which will be queried for Streams. |
streamName | Query - String | No | Contains ignore case search for stream name. |
isActive | Query - Boolean | No | Returns project streams where isActive field matches parameter. |
Response
Attributes | Type | Description |
---|---|---|
description | String | This is a description of the Project Stream |
isActive | Boolean | This is a Boolean that tracks whether or not the Project Stream is active |
attribute1 | String | This is the first attribute of the Project Stream |
attribute2 | String | This is the second attribute of the Project Stream |
attribute3 | String | This is the third attribute of the Project Stream |
versionSyntaxScript | String | This is the version syntax script of the Project Stream |
streamId | Long | This is the unique Id of the Project Stream |
streamName | String | This is the unique name of the Project Stream |
Response Codes
HTTP Code | Description |
---|---|
200 | Search successful and results returned |
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 (10002) with the following streams
[ { "description": "PUTted", "streamName": "PATCHStream1", "isActive": true, "streamId": 10003, "attribute2": "two", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "three", "attribute1": "PATCHoneStotle", "sequenceNumber": 17 }, { "description": "123", "streamName": "PostStream1", "isActive": true, "streamId": 10201, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1", "sequenceNumber": 3 }, { "description": "123", "streamName": "Stream2", "isActive": true, "streamId": 10004, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1", "sequenceNumber": 3 }, { "description": "123", "streamName": "Stream4", "isActive": true, "streamId": 10101, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1", "sequenceNumber": 13 }, { "description": "123", "streamName": "Stream5", "isActive": true, "streamId": 10102, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1", "sequenceNumber": 14 } ]
When we run a GET request at the following URL:
http://host:port/flexdeploy/rest/v1/project/10002/stream?streamName=Stream5,
The GET request would return the following JSON Project Stream object:
{ "description": "123", "streamName": "Stream5", "isActive": true, "streamId": 10102, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1", "sequenceNumber": 14 }
POST
Create Stream
This POST service will create a new Project Stream with the same attributes as the given JSON object.
API URL
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream
Request
Attributes | Type | Required | Description |
---|---|---|---|
description | String | No | This is a description of the Project Stream |
isActive | Boolean | No | This is a Boolean that tracks whether or not the Project Stream is active. If 'null' isActive defaults to 'true' |
attribute1 | String | No | This is the first attribute of the Project Stream |
attribute2 | String | No | This is the second attribute of the Project Stream |
attribute3 | String | No | This is the third attribute of the Project Stream |
versionSyntaxScript | String | Yes | This is the version syntax script of the Project Stream |
streamName | String | Yes | This is the unique name of the Project Stream |
sequenceNumber | Number | No | This is the next sequence number for the stream. This can be used in the version syntax script |
projectId | URL | Yes | This is the Id of the project to add a new Stream to |
Response
Attributes | Type | Description |
---|---|---|
description | String | This is a description of the Project Stream |
isActive | Boolean | This is a Boolean that tracks whether or not the Project Stream is active |
attribute1 | String | This is the first attribute of the Project Stream |
attribute2 | String | This is the second attribute of the Project Stream |
attribute3 | String | This is the third attribute of the Project Stream |
versionSyntaxScript | String | This is the version syntax script of the Project Stream |
streamId | Long | This is the unique Id of the Project Stream |
streamName | String | This is the unique name of the Project Stream |
Response Codes
HTTP Code | Description |
---|---|
201 | Project Stream was created successfully |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project not found |
500 | Unexpected internal server error |
Example
If the POST request receives the following JSON Project Stream object at the URL http://host:port/flexdeploy/rest/v1/project/10237/stream,
{ "description": "123", "streamName": "NewStream", "isActive": true, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1", "sequenceNumber": 4 }
The following Project Stream object will then be created as a new Stream for Project 10237:
{ "description": "123", "streamName": "NewStream", "isActive": true, "streamId": 12723, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1" }
Populate Files
This POST service is available starting with version @5.2.0.1
This POST service will populate files from a given stream. All discovered files will be saved automatically.
API URL
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream/{streamid}/populate
Request
Attribute | Type | Required | Description |
---|---|---|---|
projectId | URL | Yes | The project where files are being populated |
streamId | URL | Yes | The stream to populate files from |
inactivateMissingFiles | Boolean | No | Whether missing files will be inactivated or not. User must have Inactivate Missing Files permission for the requested project. |
Response
The number of project files which were newly populated will be returned in the response.
Response Codes
HTTP Code | Description |
---|---|
201 | Files were populated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project or Stream not found |
500 | Unexpected internal server error |
Example
If we had an Project Stream in our database with a Project Id of 25262, Stream Id of 12321 and we ran a POST request at the following URL:
http://host:port/flexdeploy/rest/v1/project/25262/stream/12321/populate
with the following request JSON:
{ "inactivateMissingFiles": true }
The POST request would then populate files from the Project Stream with Id 12321, automatically saving the populated files, and return the number of files which were newly populated and saved:
10
PUT
This PUT service will update all attributes of a Project Stream with the given Ids based on the attributes of a JSON object parameters.
API URL
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream/{streamid}
Request
Attributes | Type | Required | Description |
---|---|---|---|
description | String | No | This is a description of the Project Stream |
isActive | Boolean | No | This is a Boolean that tracks whether or not the Project Stream is active. If 'null' isActive defaults to 'true' |
attribute1 | String | No | This is the first attribute of the Project Stream |
attribute2 | String | No | This is the second attribute of the Project Stream |
attribute3 | String | No | This is the third attribute of the Project Stream |
versionSyntaxScript | String | No | This is the version syntax script of the Project Stream |
streamId | Long | No | This is the Id of the Project Stream, can pass, but will not change the id of the stream |
streamName | String | No | This is the unique name of the Project Stream |
sequenceNumber | Number | No | This is the next sequence number for the stream. This can be used in the version syntax script |
projectId | URL | Yes | This is the Id of the project to find the stream |
streamid | URL | Yes | This is the Id of the stream which will be updated |
Response
Attributes | Type | Description |
---|---|---|
description | String | This is a description of the Project Stream |
isActive | Boolean | This is a Boolean that tracks whether or not the Project Stream is active |
attribute1 | String | This is the first attribute of the Project Stream |
attribute2 | String | This is the second attribute of the Project Stream |
attribute3 | String | This is the third attribute of the Project Stream |
versionSyntaxScript | String | This is the version syntax script of the Project Stream |
streamId | Long | This is the unique Id of the Project Stream |
streamName | String | This is the unique name of the Project Stream |
Response Codes
HTTP Code | Description |
---|---|
200 | Project Stream was found and updated |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project or Stream not found |
500 | Unexpected internal server error |
Example
If we had an Project Stream in our database with a Project Id of 25262, Stream Id of 12321, and the following attributes:
{ "description": "123", "streamName": "NewStream", "isActive": true, "streamId": 12321, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1" }
When we run a PUT request at the following URL
http://host:port/flexdeploy/rest/v1/project/25262/stream/12321
And the PUT request receives the following JSON Project Stream object,
{ "description": "UpdateDescription", "streamName": "UpdatedStream", "isActive": true, "streamId": 12723, "attribute2": null, "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": null, "attribute1": "1" }
The PUT request would then update the Project Stream with Id 12321 and return the following JSON Project Stream object:
{ "description": "UpdateDescription", "streamName": "UpdatedStream", "isActive": true, "streamId": 12321, "attribute2": null, "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": null, "attribute1": "1" }
PATCH
This PATCH service will update an existing Project Stream with the information passed through a JSON object. If an attribute of the JSON is null, it will not be updated in the Project Stream.
API URL
http://host:port/flexdeploy/rest/v1/project/{projectid}/stream/{streamid}
Request
Attributes | Type | Required | Description |
---|---|---|---|
description | String | No | This is a description of the Project Stream |
isActive | Boolean | No | This is a Boolean that tracks whether or not the Project Stream is active. If 'null' isActive defaults to 'true' |
attribute1 | String | No | This is the first attribute of the Project Stream |
attribute2 | String | No | This is the second attribute of the Project Stream |
attribute3 | String | No | This is the third attribute of the Project Stream |
versionSyntaxScript | String | No | This is the version syntax script of the Project Stream |
streamId | Long | No | This is the unique Id of the Project Stream. This attribute will not cause an error if it is passed, but the stream id won't be changed. |
streamName | String | No | This is the unique name of the Project Stream |
sequenceNumber | Number | No | This is the next sequence number for the stream. This can be used in the version syntax script |
projectId | URL | Yes | This is the Id of the project to find the stream to update |
streamid | URL | Yes | This is the Id of the stream that is being updated |
Response
Attributes | Type | Description |
---|---|---|
description | String | This is a description of the Project Stream |
isActive | Boolean | This is a Boolean that tracks whether or not the Project Stream is active |
attribute1 | String | This is the first attribute of the Project Stream |
attribute2 | String | This is the second attribute of the Project Stream |
attribute3 | String | This is the third attribute of the Project Stream |
versionSyntaxScript | String | This is the version syntax script of the Project Stream |
streamId | Long | This is the unique Id of the Project Stream |
streamName | String | This is the unique name of the Project Stream |
Response Codes
HTTP Code | Description |
---|---|
200 | Project Stream was found and patched |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project or Stream not found |
500 | Unexpected internal server error |
Example
If we had an Project Stream in our database with an Id of 12723 which had the following attributes
{ "description": "123", "streamName": "NewStream", "isActive": true, "streamId": 12723, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1" }
When we run a PATCH request at the following URL
http://host:port/flexdeploy/rest/v1/project/25262/stream/12723
And the PATCH request receives the following JSON Project Stream object,
{ "description": "Patch Description", "streamName": "PatchStream" }
The PATCH request would then update the Project Stream with Id 12723 and return the following JSON Project Stream object:
{ "description": "Patch Description", "streamName": "PatchStream", "isActive": true, "streamId": 12723, "attribute2": "2", "versionSyntaxScript": "\"1.0.\" + SequenceNumber", "attribute3": "3", "attribute1": "1" }
- style