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 the retrieval, creation, complete update, and partial update of Project Streams.

...

Include Page

...

titleBase URL for Project Stream REST API

...

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

REST V1 Authentication
REST V1 Authentication

Table of Contents
maxLevel2

Each function returns a JSON/JSONs of Project Stream objects. The Project Stream object has these attributes:

...

Back to Top

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. 

Info
titleAPI URL

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

Parameters

...

Parameter

...

Type

...

Required

...

Description

...

projectid

...

Response Codes

...

HTTP Code

...

Description

...

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

...

themeEclipse
titleProject Stream- 11101

...

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. 

Info
titleAPI URL

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

Request

Parameter
Type
Required
Description

projectid

URLYesThis is a URL parameter for the Project Id which is searched to find and return a Stream
streamidURLYesThis is a URL parameter for the Project Stream Id which will be returned from the corresponding Project

Include Page
REST V1 Project Stream Response
REST V1 Project Stream Response

Response Codes

HTTP Code
Description
200Project Stream was found and returned
400Bad request
401Unauthorized
404Project Stream not found
500Unexpected 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

Code Block
themeEclipse
titleProject Stream- 11101
{
   "description": "Stream Descriptin",
   "isActive": true,
   "streamName": "FirstStream",
   "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
   "attribute3": "three",
   "attribute2": "two",
   "attribute1": "one",
   "streamId": 11101
}

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 Descriptin",
   "isActive": true,
   "streamName": "FirstStream",
   "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
   "attribute3": "three",
   "attribute2": "two",
   "attribute1": "one",
   "streamId": 11101
}

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 Descriptin",
   "isActive": true,
   "streamName": "FirstStream",
   "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
   "attribute3": "three",
   "attribute2": "two",
   "attribute1": "one",
   "streamId": 11101
}

Back to Top

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}

Examples:
To search by code only:

http://host:port/flexdeploy/rest/v1/project/{projectid}/stream?streamName={name}

Tip

The query parameters are not case sensitive. Searching by name=NAME is the same as searching by name=name.

Parameters

...

Parameter

...

Type

...

Required

...

Description

...

Response Codes

...

HTTP Code

...

Description

...

Example

If we had a Project (10002) with the following streams

Code BlockthemeEclipsetitleProject

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}

Examples:
To search by code only:

http://host:port/flexdeploy/rest/v1/project/{projectid}/stream?streamName={name}


Tip

The query parameters are not case sensitive. Searching by name=NAME is the same as searching by name=name.

Request

Parameter
Type
Required
Description
projectIdURLYesThis is a URL path parameter for the Project Id which specifies the project which will be queried for Streams.
streamNameURLNoThis is a URL query parameter for the name which is used to search the Streams of the queried Project.

Include Page
REST V1 Project Stream Response
REST V1 Project Stream Response

Response Codes

HTTP Code
Description
200Project Stream found and returned
400Bad request
401Unauthorized
404Project with specified not found
500Unexpected internal server error

Example

If we had a Project (10002) with the following streams

Code Block
themeEclipse
titleProject 10002 Streams
[
      {
      "description": "PUTted",
      "streamName": "PATCHStream1",
      "isActive": true,
      "streamId": 10003,
      "attribute2": "two",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "three",
      "attribute1": "PATCHoneStotle"
   },
      {
      "description": "123",
      "streamName": "PostStream1",
      "isActive": true,
      "streamId": 10201,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   },
      {
      "description": "123",
      "streamName": "Stream2",
      "isActive": true,
      "streamId": 10004,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   },
      {
      "description": "123",
      "streamName": "Stream4",
      "isActive": true,
      "streamId": 10101,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   },
      {
      "description": "123",
      "streamName": "Stream5",
      "isActive": true,
      "streamId": 10102,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   }
]

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/v1/project/{projectid}/stream?streamName=Stream5

The GET request would return the  following JSON Project Stream object

Code Block
themeEclipse
titleProject Stream "Stream5"
{
      "description": "123",
      "streamName": "Stream5",
      "isActive": true,
      "streamId": 10102,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   }
Back to Top

POST

This POST service will create a new Project Stream with the same attributes as the given JSON object.

Info
titleAPI URL

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

Parameters

Request

AttributesTypeRequiredDescription
descriptionStringNoThis is a description of the Project Stream
isActiveBooleanNoThis is a Boolean that tracks whether or not the Project Stream is active. If 'null' isActive defaults to 'true'
attribute1StringNoThis is the first attribute of the Project Stream
attribute2StringNoThis is the second attribute of the Project Stream
attribute3StringNoThis is the third attribute of the Project Stream
versionSyntaxScriptStringYesThis is the version syntax script of the Project Stream
streamNameStringYesThis is the unique name of the Project Stream
projectIdURLYesThis is the Id of the project to add a new Stream to

Response Codes

HTTP

Include Page
REST V1 Project Stream Response
REST V1 Project Stream Response

Response Codes

HTTP Code
Description
201Project Stream was created successfully
400Bad request
401Unauthorized
404Project Stream not found
500Unexpected internal server error

Example

If the POST request receives the following JSON Project Stream object and the project id of 10237

Code Block
themeEclipse
titlePOST JSON
{
      "description": "123",
      "streamName": "NewStream",
      "isActive": true,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
}
The following Project Stream object will then be created as a new Stream for Project

Example

If the POST request receives the following JSON Project Stream object and the project id of 10237

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

Back to Top

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.

Info
titleAPI URL

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


}

The following Project Stream object will then be created as a new Stream for Project 10237

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

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.

Info
titleAPI URL

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

Request

AttributesTypeRequiredDescription
descriptionStringNoThis is a description of the Project Stream
isActiveBooleanNoThis is a Boolean that tracks whether or not the Project Stream is active. If 'null' isActive defaults to 'true'
attribute1StringNoThis is the first attribute of the Project Stream
attribute2StringNoThis is the second attribute of the Project Stream
attribute3StringNoThis is the third attribute of the Project Stream
versionSyntaxScriptStringNoThis is the version syntax script of the Project Stream
streamIdLongNoThis is the Id of the Project Stream, can pass, but will not change the id of the stream
streamNameStringNoThis is the unique name of the Project Stream
projectIdURLYesThis is the Id of the project to find the stream
streamidURLYesThis is the Id of the stream which will be updated

Include Page
REST V1 Project Stream Response
REST V1 Project Stream Response

Response Codes

HTTP Code
Description
200Project Stream was found and updated
400Bad request
401Unauthorized
404Project 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 the following attributes

...

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}

Parameters

Request

AttributesTypeRequiredDescription
descriptionStringNoThis is a description of the Project Stream
isActiveBooleanNoThis is a Boolean that tracks whether or not the Project Stream is active. If 'null' isActive defaults to 'true'
attribute1StringNoThis is the first attribute of the Project Stream
attribute2StringNoThis is the second attribute of the Project Stream
attribute3StringNoThis is the third attribute of the Project Stream
versionSyntaxScriptStringNoThis is the version syntax script of the Project Stream
streamIdLongNoThis is the unique Id of the Project Stream
streamNameStringNoThis is the unique name of the Project Stream
projectIdURLYesThis is the Id of the project to find the stream to update
streamidURL YesThis is the Id of the stream that is being updated

Include Page
REST V1 Project Stream Response
REST V1 Project Stream Response

Response Codes

HTTP Code
Description
200Project Stream was found and patched
400Bad request
401Unauthorized
404

Project Stream not found

500Unexpected internal server error

Example

If we had an Project Stream in our database with an Id of 12723 and had the following attributes

Code Block
themeEclipse
titleEnvironment PATCH JSON
{
      "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/{projectid}/stream/12723

And the PATCH request receives the following JSON Project Stream object,

Code Block
themeEclipse
titleProject Stream PATCH Receive JSON
{
      "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

Code Block
themeEclipse
titleProject Stream PATCH Return JSON
{
      "description": "Patch Description",
      "streamName": "PatchStream",
      "isActive": true,
      "streamId": 12723,
      "attribute2": "2",
      "versionSyntaxScript": "\"1.0.\" + SequenceNumber",
      "attribute3": "3",
      "attribute1": "1"
   }
Back to Top