Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

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:

Code Block
themeEclipse
titleProject Stream- 11101
{
   "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:

Code Block
themeEclipse
titleProject Stream GET Return JSON
{
   "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.

Info
titleAPI 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}

...

If the POST request receives the following JSON Project Stream object at the URL http://host:port/flexdeploy/rest/v1/project/10237/stream,

Code Block
themeEclipse
titlePOST JSON
{
      "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:

Code Block
themeEclipse
titleProject Stream Post Return JSON
{
      "description": "123",
      "streamName": "NewStream",
      "isActive": true,
      "streamId": 12723,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   }

Populate Files

Info

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.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/project/{projectid}/stream/{streamid}/populate

Request

AttributeTypeRequiredDescription
projectIdURLYesThe project where files are being populated
streamIdURLYesThe stream to populate files from
sortAllAfterPopulateBooleanNoWhether files should be sorted after populating. Defaults to false
inactivateMissingFilesBoolean NoWhether 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
201Files were populated
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
404Project or Stream not found
500Unexpected 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:

Code Block
themeEclipse
titleProject Stream POST Request JSON
{
      "sortAllAfterPopulate": false,
	  "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:

Code Block
titleProject Stream POST Return JSON
10

PUT

...

Code Block
themeEclipse
titleProject Stream PUT Return JSON
{
      "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.

Info
titleAPI URL

http://host:port/flexdeploy/rest/v1/project/{projectid}/stream/{streamid}

...