Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Projects Versions can be accessed through this API using the GET service.

Authentication - Use Basic Authentication for this API.

GET

GET by ID

This GET service will find project version for supplied parameters and return a JSON representation of it.

API URL

http://{host:port}/flexdeploy/rest/v1/project/{projectId}/version/{versionid}

Request

Parameter
Required
Type
Description
projectIdYesURLThis is a URL path parameter for the id which is used to find a project.
versionidYesURLThis is a URL path parameter for project version id.

Response

AttributesTypeDescription
projectVersionIdLongThe Identification number of this project version.
projectVersionNameStringThe Name of this project version.
isActiveBoolean A boolean describing whether or not this project version is active.
projectStreamIdLongThe ID of the project stream  associated with this project version.
packageNameStringThe package name associated with this project version.
requestAllFilesBooleanA boolean describing whether or not all files are requested for this project version.
scmRevisionStringA string representation of the SCM revision of this project version. Null if no such revision exists.

Response Codes

HTTP Code

Description

200

Project was found and it's versions returned

400

Bad request

401

Unauthorized

404

Project with the specified Id was not found

500

Unexpected internal server error

Example

If we had the following project versions in a Project with a project.

Version 4281839
[
    {
        packageName: "ALM151",
        isActive: false,
        projectVersionId: 4281839,
        projectStreamId: 3882239,
        projectVersionName: "1.0.45",
        scmRevision: "1710",
        requestAllFiles: false
    },
    {
        packageName: "ALM151",
        isActive: true,
        projectVersionId: 4281805,
        projectStreamId: 3882239,
        projectVersionName: "1.0.44",
        scmRevision: "1709",
        requestAllFiles: false
    },
    {
        packageName: "ALM151",
        isActive: true,
        projectVersionId: 4281769,
        projectStreamId: 3882239,
        projectVersionName: "1.0.43",
        scmRevision: "1709",
        requestAllFiles: false
    }
]

Get by id for 4281839 will return following.

Version 4281839
{
    packageName: "ALM151",
    isActive: false,
    projectVersionId: 4281839,
    projectStreamId: 3882239,
    projectVersionName: "1.0.45",
    scmRevision: "1710",
    requestAllFiles: false
}

GET (Using Query Parameters)

This GET service will find project version for supplied parameters and return a JSON representation of it. Project versions are sorted from newest to oldest.

API URL

http://{host:port}/flexdeploy/rest/v1/project/{projectId}/version?

Query Parameters

  • projectVersionName
  • projectStreamId
  • packageName
  • requestAllFiles
  • scmRevision
  • limit

For example,

http://{host:port}/flexdeploy/rest/v1/project/{projectId}/version?projectVersionName=1.0

Request

Parameter
Required
Type
Description
projectIdYesURLThis is a URL path parameter for the id which is used to find a project.
projectVersionNameNoQuery - String

Starts with search by project version name.

This is searched for using startsWith, so a partial version can be used for the search.

projectStreamIdNoQuery - LongEquals search by project stream id.
packageNameNoQuery - StringEquals search by package name. Only for partial deployment projects.
requestAllFilesNoQuery - BooleanEquals search by whether all files are requested or not. Only for partial deployment projects.
scmRevisionNoQuery - StringEquals search by SCM revision.
limitNoQuery - IntegerLimit results to specific count, if not provided all matching results are returned.

Response

AttributesTypeDescription
projectVersionIdLongThe Identification number of this project version.
projectVersionNameStringThe Name of this project version.
isActiveBoolean A boolean describing whether or not this project version is active.
projectStreamIdLongThe ID of the project stream  associated with this project version.
packageNameStringThe package name associated with this project version.
requestAllFilesBooleanA boolean describing whether or not all files are requested for this project version.
scmRevisionStringA string representation of the SCM revision of this project version. Null if no such revision exists.

Response Codes

HTTP Code

Description

200

Project was found and it's versions returned

400

Bad request

401

Unauthorized

404

Project with the specified Id was not found

500

Unexpected internal server error

Example

If we had the following project versions in a Project with a project ID of 10002:

Versions For Project 10002
[
      {
      "packageName": "1.0.12",
      "isActive": true,
      "requestAllFiles": false,
      "scmevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.12",
      "projectVersionId": 13117
   },
      {
      "packageName": "1.0.11",
      "isActive": false,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.11",
      "projectVersionId": 13101
   },
      {
      "packageName": "1.0.10",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.10",
      "projectVersionId": 12954
   },
      {
      "packageName": "1.0.9",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.9",
      "projectVersionId": 12938
   },
      {
      "packageName": "1.0.8",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.8",
      "projectVersionId": 12922
   },
      {
      "packageName": "1.0.7",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.7",
      "projectVersionId": 12906
   },
      {
      "packageName": "1.0.6",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.6",
      "projectVersionId": 12890
   },
      {
      "packageName": "1.0.5",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.5",
      "projectVersionId": 12870
   },
      {
      "packageName": "1.0.4",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.4",
      "projectVersionId": 12854
   },
      {
      "packageName": "1.0.3",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.3",
      "projectVersionId": 12838
   },
      {
      "packageName": "1.0.2",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.2",
      "projectVersionId": 12820
   },
      {
      "packageName": "1.0.1",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.1",
      "projectVersionId": 12801
   }
]

When we run a request at the following URL:

http://host:port/flexdeploy/rest/v1/project/10002/version

A GET request would be triggered and return the following JSON project versions object

GET JSON Response
[
      {
      "packageName": "1.0.12",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.12",
      "projectVersionId": 13117
   },
      {
      "packageName": "1.0.11",
      "isActive": false,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.11",
      "projectVersionId": 13101
   },
      {
      "packageName": "1.0.10",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.10",
      "projectVersionId": 12954
   },
      {
      "packageName": "1.0.9",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.9",
      "projectVersionId": 12938
   },
      {
      "packageName": "1.0.8",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.8",
      "projectVersionId": 12922
   },
      {
      "packageName": "1.0.7",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.7",
      "projectVersionId": 12906
   },
      {
      "packageName": "1.0.6",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.6",
      "projectVersionId": 12890
   },
      {
      "packageName": "1.0.5",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.5",
      "projectVersionId": 12870
   },
      {
      "packageName": "1.0.4",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.4",
      "projectVersionId": 12854
   },
      {
      "packageName": "1.0.3",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.3",
      "projectVersionId": 12838
   },
      {
      "packageName": "1.0.2",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.2",
      "projectVersionId": 12820
   },
      {
      "packageName": "1.0.1",
      "isActive": true,
      "requestAllFiles": false,
      "scmRevision": null,
      "projectStreamId": 12702,
      "projectVersionName": "1.0.1",
      "projectVersionId": 12801
   }
]
  • No labels