Project API
Projects can be accessed through this API using the GET service.
Authentication - Use Basic Authentication for this API.
Valid Source Control Management Types
Source Control Management System | JSON String Representation |
---|---|
ClearCase Unified Control Management | "CCUCM" |
Concurrent Version System | "CVS" |
Git | "GIT" |
File System | "FILE" |
Perforce | "PERF" |
Polytron Version Control System | "PVCS" |
Subversion | "SVN" |
Team Foundation Version Control | "TFVC" |
Valid Project Types
Project Type | JSON String Representation |
---|---|
General | "GENERAL" |
Managed File Transfer | "MFT" |
Partial File | "PARTIAL_FILE" |
Oracle Forms | "OracleForms" |
Oracle Database | "ORACLE_DB" |
Oracle Business Intelligence | "ORACLE_BI" |
Sales Force | "SALESFORCE" |
Utility | "UTILITY" |
Generic | "GENERIC" |
Valid Priority Scope Types
Priority Scope Types | JSON String Representation |
---|---|
Application | "Application" |
Folder | "Folder" |
Global | "Global" |
GET
There are two implementations of GET. One will find a Project with the given Id and return the JSON representation of the Project. The other will find a list of Projects matching the parameters supplied to it.
GET (Using Id)
This GET service will find a Project by Id and return a JSON representation of it.
API URLs
http://host:port/flexdeploy/rest/v1/project/{id}
Request
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | URL | This is a URL path parameter for the id which is used to find a project. |
Response
Attributes | Type | Description |
---|---|---|
projectName | String | This is the name of the project. |
applicationId | String | This is the type of the project. |
projectPath | String | Fully qualified project path. |
isActive | Boolean | This is a Boolean that tracks whether or not the project is active. Null input defaults to true. |
description | String | This is the group of the project. |
partialDeployment | Boolean | This is the subgroup of the project. Null input defaults to false. |
priority | Integer | This is the description of the project. |
projectType | String | This is the id of the active version of the workflow. Must be a valid project type. |
scmType | String | This specifies the source control management system used by this project. Must be a valid source control management system. |
priorityScope | String | This specifies the priority scope of the current project. Either 'Global', 'Folder' or 'Application' |
buildWorkflowId | Long | This Long specifies the id of the build workflow used by this project. |
buildInstanceId | Long | This id the build instance used by this project. |
utilityWorkflowId | Long | This id specifies the utility workflow used by this project. |
utilityInstanceIds | List<Long> | This id specifies the utility instance used by this project. |
deployWorkflowId | Long | This id specifies the deployment workflow used by this project. |
deployInstanceIds | List<Long> | This is a list of id's which identify the deployment instances for this project. |
streams | List<Long> | This is a list of id's which identify the Project Streams associated with this project. |
Response Codes
HTTP Code | Description |
---|---|
200 | Projects were found and returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had a Project in our database with the name 'Project1' with the following attributes:
{ "priority": 1, "projectName": "Project1", "description": "Our thoughts become our words. Our words become our actions.", "applicationId": 10001, "priorityScope": "Application", "partialDeployment": false, "isActive": true, "scmType": "NONE", "streams": [ 10802, 10803, 10804, 10805 ], "deployWorkflowId": 10873, "deployInstanceIds": [ 11153, 11168, 11183, 11198, 11213, 11228, 11243 ], "buildWorkflowId": 10869, "buildInstanceId": 11153, "projectType": null }
When we run a GET request at the following URL:
http://host:port/flexdeploy/rest/v1/project/10002
The GET request would return the following JSON project object
{ "priority": 1, "projectName": "Project1", "description": "Our thoughts become our words. Our words become our actions.", "applicationId": 10001, "priorityScope": "Application", "partialDeployment": false, "isActive": true, "scmType": "NONE", "streams": [ 10802, 10803, 10804, 10805 ], "utilityWorkflowId": 11434, "utilityInstanceIds": [11275], "deployWorkflowId": 10873, "deployInstanceIds": [ 11153, 11168, 11183, 11198, 11213, 11228, 11243 ], "buildWorkflowId": 10869, "buildInstanceId": 11153, "projectType": null }
Get(Using Query Parameters)
This GET service will find a project by querying based on a name and application id and return the JSON representations of the objects. If no query parameters are given this request will return the entire list of projects.
API URLs
http://host:port/flexdeploy/rest/v1/project?
Append the following character sequences to the above URL to specify Query parameters. Use '&' between successive query parameters:
- projectName={name}
- applicationId={applicationid}
- folderPath={folderPath}
- isActive={isActive}
folderPath Format
- Path parameters are separated by slashes(forward or backward).
- Trailing slashes will be ignored.
- Single leading slashes are ignored.
- To access a folder or application, it's full path from the project archive root folder must be used.
- A shorted path is valid, but will return more results.
- The project archive root folder is an optional path parameter.
- Folders and applications are considered path parameters.
- Forward and backward slashes are accepted
- Project names are not considered path parameters. For example,
- The folderPath used to access the 'AccountingApps' application :
- /Flexdeploy/CommerceProjects/AccountingApps/
- or
- CommerceProjects\AccountingApps
- i.e. you can omit FlexDeploy at start of folderPath
Examples:
- To search by name only: http://host:port/flexdeploy/rest/v1/project?projectName={name}
- To search by group only: http://host:port/flexdeploy/rest/v1/project?applicationId={applicationid}
- To search by folderPathonly: http://host:port/flexdeploy/rest/v1/project?folderPath={folderPath}
- To search for all active projects: http://host:port/flexdeploy/rest/v1/project?isActive=true
- To search by name and applicationId: http://host:port/flexdeploy/rest/v1/project?projectName={name}&applicationId={applicationid}
The query parameters are not case sensitive. Searching by projectName=NAME is the same as searching by projectName=name.
Request
Parameter | Required | Type | Description |
---|---|---|---|
projectName | No | Query - String | This is a URL query parameter for the name which is used to query the projects with. Contains ignore case search |
applicationId | No | Query - Long | This is a URL query parameter for application id which is used to query the projects within an application. |
folderPath | No | Query - String | This is a URL query parameter which specified the path of the desired folders (and optionally the application, but not the project name) All projects in provided path will be considered, i.e. including any sub folders of provided path as well. |
isActive | No | Query - Boolean | @Since 5.1.0.2 This is a URL query parameter which specifies whether returned projects should only include active or inactive projects. If this parameter is not provided, both active and inactive projects may be returned. |
Response
Attributes | Type | Description |
---|---|---|
projectName | String | This is the name of the project. |
applicationId | String | This is the type of the project. |
projectPath | String | Fully qualified project path. |
isActive | Boolean | This is a Boolean that tracks whether or not the project is active. Null input defaults to true. |
description | String | This is the group of the project. |
partialDeployment | Boolean | This is the subgroup of the project. Null input defaults to false. |
priority | Integer | This is the description of the project. |
projectType | String | This is the id of the active version of the workflow. Must be a valid project type. |
scmType | String | This specifies the source control management system used by this project. Must be a valid source control management system. |
priorityScope | String | This specifies the priority scope of the current project. Either 'Global', 'Folder' or 'Application' |
buildWorkflowId | Long | This Long specifies the id of the build workflow used by this project. |
buildInstanceId | Long | This id the build instance used by this project. |
utilityWorkflowId | Long | This id specifies the utility workflow used by this project. |
utilityInstanceIds | List<Long> | This id specifies the utility instance used by this project. |
deployWorkflowId | Long | This id specifies the deployment workflow used by this project. |
deployInstanceIds | List<Long> | This is a list of id's which identify the deployment instances for this project. |
streams | List<Long> | This is a list of id's which identify the Project Streams associated with this project. |
Response Codes
HTTP Code | Description |
---|---|
200 | Search successful and results returned |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
500 | Unexpected internal server error |
Example
If we had Projects in our database with the names 'Project1' and 'Project2' and the following attributes:
{ "priority": 1, "projectName": "Project1", "description": "Our thoughts become our words. Our words become our actions.", "applicationId": 10001, "priorityScope": "Application", "partialDeployment": false, "isActive": true, "scmType": "NONE", "streams": [ 10802, 10803, 10804, 10805 ], "utilityWorkflowId": 11434, "utilityInstanceIds": [11275], "deployWorkflowId": 10873, "deployInstanceIds": [ 11153, 11168, 11183, 11198, 11213, 11228, 11243 ], "buildWorkflowId": 10869, "buildInstanceId": 11153, "projectType": null }
{ "priority": 1, "description": "No Permissions", "applicationId": 10001, "isActive": true, "scmType": "SVN", "projectType": null, "projectName": "Project2", "streams": [], "priorityScope": "Application", "partialDeployment": false, "utilityWorkflowId": null, "utilityInstanceIds": null, "deployWorkflowId": null, "buildWorkflowId": null, "deployInstanceIds": null, "buildInstanceId": null }
When we run a GET request at the following URL
http://host:port/flexdeploy/rest/v1/project?applicationId=10001
The GET request would return the following JSON workflow object
{ "priority": 1, "description": "No Permissions", "applicationId": 10001, "isActive": true, "scmType": "SVN", "projectType": null, "projectName": "Project2", "streams": [], "priorityScope": "Application", "partialDeployment": false, "utilityWorkflowId": null, "utilityInstanceIds": null, "deployWorkflowId": null, "buildWorkflowId": null, "deployInstanceIds": null, "buildInstanceId": null }
POST
Build Project (Using Id)
This POST service will perform the same action found on the Build Request Form. It will initiate a request to build the project with the given Id. The service will return workflow request. Workflow request id from return data can be used with Workflow Request API to determine when the execution is complete.
This page includes examples for Full and Partial deploy project builds.
API URLs
http://host:port/flexdeploy/rest/v1/project/(Id)/build
Request
- If trying to build a Partial Deploy project with all of the files in the repository (equivalent to Build - All Files button in the UI), then simply remove the "projectFiles" list, and the REST API will detect that the project is meant for partial deploys automatically and perform the build with all of the files.
Parameter | Required | Type | Description |
---|---|---|---|
environmentId | Y | Long | This is the environment Id, not the environment name that you see on most screens. |
streamId | Y | Long | The Id of the Stream. |
forceBuild | N | Boolean | Values are true or false. Indicates that the build should occur even if there are not SCM changes. Defaults to false. |
relatedTickets | N | String | List of Issue Tracking System tickets. |
workflowVersionOverride | N | String | Optionally the version of the workflow can be overridden. Defaults to the currently active version. |
inputs | N | List<Input> | See Common Parameters below. |
flexFields | N | List<FlexField> | See Common Parameters below. |
projectFiles | N | List<ProjectFile> | Only for partial deployment project builds. An array of objects with 2 fields each: |
packageName | N | String | Only for partial deployment project builds. Unique name to identify a build for partial deployments project. Defaults to the project version if no value is provided. If packageName is provided without projectFiles, files configured in that package will be used. If packageName is provided with projectFiles, then input is used for build and package definition is updated with this projectFiles list. If packageName and projectFiles are not provided for partial deployment project, then All Files build will be performed. |
releaseId | N | String | Id of the release to which this build is related to. If specified, a new snapshot is going to be created. |
Input
This is a list of code/value pairs for the inputs. Not all inputs need to be supplied. If an input has a default value that is acceptable for the Workflow to run, it does not need to be supplied.
Attribute | Required | Type | Description |
---|---|---|---|
code | Y | String | The code of the Input |
value | N | String | The value of the Input |
FlexField
This is a list of the code/value pairs for the FlexFields (not the Display Name). Not all FlexFields need to be supplied. If a FlexField has a default value or options that are acceptable for the workflow to run, it does not need to be changed.
Attribute | Required | Type | Description |
---|---|---|---|
code | Y | String | The code of the FlexField |
value | N | String | The value of the FlexField |
ProjectFile
Attribute | Required | Type | Description |
---|---|---|---|
path | Y | String | Fully qualified file path that is required inside the projectFiles parameter. |
scmRevision | N | Long | Optionally include the revision number that you would like to use for the build. If it is not indicated, then FlexDeploy will use the latest revision as the default. |
Response
Attributes | Type | Description |
---|---|---|
warningMessage | String | Indicates any warning message in the event where the request was successful but no build was initiated. For example: No changes found in source control |
warningCode | String | Matching warning code for the warning message. |
workflowRequests | Array | Array of workflow request objects |
Response Codes
HTTP Code | Description |
---|---|
200 | No changes were detected, no build initiated. |
201 | Project was built successfully |
400 | Bad request |
401 | Authentication failure |
403 | Authorization failure (no access to resource) |
404 | Project not found |
500 | Unexpected internal server error |
Example
We can build a Project with Id 10004 with this request:
API URLs
http://host:port/flexdeploy/rest/v1/project/10004/build
Sample JSON Request
{ "environmentId": 11101 , "forceBuild": true, "workflowVersionOverride": null, "streamId": 11210, "inputs": [ { "code":"input1","value": "xyz" }, { "code":"input2","value": "123" }], "projectFiles":[ { "path": "/java/xxt/oracle/xxPersonMainCO.java" }, { "path": "/java/xxt/oracle/apps/managePersonCO.java", "scmRevision": "1515" }], "packageName": "ALM150", "relatedTickets": null, "flexFields": [{ "code": "Build FlexField" , "value": 10 }], "releaseId": 27003 }
In response, we will receive an array of workflowRequests
{ "warningMessage": null, "warningCode": null, "workflowRequests": [ { "packageName": null, "folderName": "Human Resources", "releaseSnapshotId": null, "workflowRequestStatus": "READY", "folderId": 10001, "exceptionToWindow": false, "releaseDefinitionId": null, "cmsissues": "", "workflowRequestId": 12019, "projectName": "ProcessHRRequest", "projectStreamId": 10502, "projectVersionName": "1.0.9", "requestAllFiles": false, "projectVersionId": 30001, "environmentId": 11016, "folderRequestId": null, "flexFields": [], "folderPath": "FlexDeploy/Human Resources", "projectId": 10501, "requestedBy": "fdadmin", "requestedStartTime": null, "force": false, "stopOnPackageError": null, "workflowOverrideVersion": null, "folderVersionId": null } ] }
Deploy Project (Using Id)
This POST service will perform the same action found on the Deployment Request Form off the project screen. It will initiate a request to deploy the project specified with the project Id. The service will return workflow request. Workflow request id from return data can be used with Workflow Request API to determine when the execution is complete.
API URL
http://host:port/flexdeploy/rest/v1/project/{Id}/deploy