Source Control Management Instance API

Source Control Management Instance API

SCM Instances 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 SCM Instances.

Authentication - Use Basic Authentication for this API.

Currently there are 8 different source control management types that are supported in Flex Deploy. The scmType value is shown after the name of each.

CVS (CVS)

Property Display Name

Property Key Name

Data Type

Required

Description

Property Display Name

Property Key Name

Data Type

Required

Description

CVS URL

FDCVS_URL

String

Yes

URL to the CVS repository.

CVS User

FDCVS_PASSWORD

String

Yes

CVS repository user.

CVS Password

FDCVS_USER

String

Yes

CVS repository password.

File System (FILE)

Property Name

Property Key Name

Data Type

Required

Description

Property Name

Property Key Name

Data Type

Required

Description

File Repository Root

FDFILE_REPO_ROOT_FOLDER

String

Yes

Location on the FlexDeploy server of the repository.

Git (GIT)

Property Display Name

Property Key Name

Data Type

Required

Description

Property Display Name

Property Key Name

Data Type

Required

Description

Git URL

FDGIT_URL

String

Yes

URL to the Git repository.

Git User

FDGIT_USER

String

Yes/No

Git repository user.

Git Password

FDGIT_PASSWORD

String

Yes/no

Git repository password.

Git Timeout

FDGIT_TIMEOUT

Integer

No

Timeout for Git command execution.

Perforce (PERF)

Property Display Name

Property Key Name

Data Type

Required

Description

Property Display Name

Property Key Name

Data Type

Required

Description

Perforce Host

FDPERF_HOST

String

Yes

Host of the Perforce repository.

Perforce Port

FDPERF_PORT

String

Yes

Port of the Perforce repository.

Perforce User

FDPERF_USER

String

Yes

Perforce User to connect with.

Perforce User Password

FDPERF_PASSWORD

String

Yes

Perforce Password associated with Perforce User.

Perforce SSL Connection

FDPERF_IS_SSL

Boolean

Yes

Should ssl be used connecting to the server.

PVCS (PVCS)

Property Display Name

Property Key Name

Data Type

Required

Description

Property Display Name

Property Key Name

Data Type

Required

Description

PVCS Project Database

FDPVCS_PROJECT_DATABASE

String

Yes

Project Database Name.

PVCS User

FDPVCS_USER

String

Yes

PVCS user to access ProjectDatabases.

PVCS Password

FDPVCS_PASSWORD

String

Yes

PVCS password to access ProjectDatabases

Subversion (SVN)

Property Display Name

Property Key Name

Data Type

Required

Description

Property Display Name

Property Key Name

Data Type

Required

Description

Subversion URL

FDSVN_URL

String

Yes

URL to the Subversion repository.

Subversion User

FDSVN_USER

String

Yes

Subversion repository user.

Subversion Password

FDSVN_PASSWORD

String

Yes

Subversion repository password.

Subversion Authentication Methods

FDSVN_AUTH_METHODS

String

No

One or more subversion authentication methods. For example, Basic, Digest, Negotiate, NTLM.

TFVC (TFVC)

Property Display Name

Property Key Name

Data Type

Required

Description

Property Display Name

Property Key Name

Data Type

Required

Description

TFVC URL

FDTFVC_URL

String

Yes

URL to the TFVC repository.

TFVC User

FDTFVC_USER

String

Yes

TFVC repository user.

TFVC Password

FDTFVC_USER

String

Yes

TFVC repository password.

GET

There are two implementations of GET. One will find a SCM instance with the given Id and return the JSON representation of the SCM instance. The other will find a list of SCM instances matching the parameters supplied to it.

GET (Using Id)

This GET service will find a SCM instance with the given Id and return the JSON representation of the object.

API URL

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance/{Id}

Request

Parameter

Required

Type

Description

Parameter

Required

Type

Description

Id

Yes

URL

This is a URL parameter for the Id which is used to find and return a SCM instance with.

Response

AttributesTypeDescription
instanceIdLongThis is an id of the SCM Instance.
instanceCodeStringThis is a code of the SCM instance.
instanceNameStringThis is the unique name of the SCM instance.
scmTypeStringThis is the SCM type of the SCM instance.
isActiveBooleanThis is a Boolean that tracks whether or not the SCM instance is active.
descriptionStringThis is the description of the SCM instance.
propertiesList<PropertyValue>This is a list of the Properties associated with the SCM instance.

Each JSON SCM instance object contains a list of property values. The property value object has these attributes:

AttributesTypeDescription
propertyNameStringThis is the code of the property
propertyValueStringThis is the value of the property
credentialIdLongId of the credential associated with this property. Applicable only for encrypted properties.

Response Codes

HTTP Code

Description

HTTP Code

Description

200

SCM instance was found and returned

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

404

SCM instance not found

500

Unexpected internal server error

Example

If we had a SCM instance in our database with an Id of 11101 and had the following attributes

SCM Instance - 11101
{ "instanceId": 11101, "instanceName": "ScmName1", "properties": [ { "propertyName": "FDGIT_URL", "propertyValue": "url", "credentialId": null }, { "propertyName": "FDGIT_USER", "propertyValue": "user", "credentialId": null }, { "propertyName": "FDGIT_PASSWORD", "propertyValue": "password", "credentialId": 46259 }, { "propertyName": "FDGIT_TIMEOUT", "propertyValue": 10000, "credentialId": null } ], "scmType": "GIT", "description": "description", "instanceCode": "CODE1", "isActive": true }

When we run a GET request at the following URL: http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance/11101

The GET request would return the  following JSON SCM instance object

SCM Instance GET Return JSON
{ "instanceId": 11101, "instanceName": "ScmName1", "properties": [ { "propertyName": "FDGIT_URL", "propertyValue": "url", "credentialId": null }, { "propertyName": "FDGIT_USER", "propertyValue": "user", "credentialId": null }, { "propertyName": "FDGIT_PASSWORD", "propertyValue": "*****", "credentialId": 46259 }, { "propertyName": "FDGIT_TIMEOUT", "propertyValue": 10000, "credentialId": null } ], "scmType": "GIT", "description": "description", "instanceCode": "CODE1", "isActive": true }

GET (Using Query Parameters)

This GET service will find a SCM instance by querying based on a name, code, and/or type of the SCM and return the JSON representations of the objects. If no query parameters are given this request will return the entire list of SCM instances.

API URLs

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance?

Append the following character sequences to the above URL to specify Query parameters.
Use '&' between successive query parameters: 

instanceName={name}

instanceCode={code}

scmType={type}

isActive={boolean}

Examples:
To search by code only:

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance?instanceCode={code}

To search by IsActive only:

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance?isActive={boolean}

To search by name only:

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance?instanceName={name}

To search by type and name:

http://host:port/flexdeploy/rest/v1/topology/scminstance?scmType={type}&instanceName={name}

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

Request

Parameter

Required

Type

Description

Parameter

Required

Type

Description

instanceName

No

Query - String

This is a URL query parameter for the name which is used to query the SCM instances with.

Contains ignore case search

instanceCode

No

Query - String

This is a URL query parameter for the code which is used to query the SCM instances with.

Equals ignore case search

scmType

No

Query - String

This is a URL query parameter for the type which is used to query the SCM instances with.

Equals ignore case search

isActive

No

Query - Boolean

Returns scm instances where isActive field matches parameter.

Response

AttributesTypeDescription
instanceIdLongThis is an id of the SCM Instance.
instanceCodeStringThis is a code of the SCM instance.
instanceNameStringThis is the unique name of the SCM instance.
scmTypeStringThis is the SCM type of the SCM instance.
isActiveBooleanThis is a Boolean that tracks whether or not the SCM instance is active.
descriptionStringThis is the description of the SCM instance.
propertiesList<PropertyValue>This is a list of the Properties associated with the SCM instance.

Each JSON SCM instance object contains a list of property values. The property value object has these attributes:

AttributesTypeDescription
propertyNameStringThis is the code of the property
propertyValueStringThis is the value of the property
credentialIdLongId of the credential associated with this property. Applicable only for encrypted properties.

Response Codes

HTTP Code

Description

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 a SCM instance in our database with an Id of 11101 and had the following attributes

SCM Instance - 11101
{ "instanceId": 11101 "instanceName": "ScmName1", "properties": [ { "propertyName": "FDGIT_URL", "propertyValue": "url", "credentialId": null }, { "propertyName": "FDGIT_USER", "propertyValue": "user", "credentialId": null }, { "propertyName": "FDGIT_PASSWORD", "propertyValue": "password", "credentialId": 46259 }, { "propertyName": "FDGIT_TIMEOUT", "propertyValue": 10000, "credentialId": null } ], "scmType": "GIT", "description": "description", "instanceCode": "CODE1", "isActive": true }

When we run a GET request at the following URL

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance?code=code1&name=ScmName1

The GET request would return the  following JSON SCM instance object

SCM Instance GET Return JSON
{ "instanceId": 11101 "instanceName": "ScmName1", "properties": [ { "propertyName": "FDGIT_URL", "propertyValue": "url", "credentialId": null }, { "propertyName": "FDGIT_USER", "propertyValue": "user", "credentialId": null }, { "propertyName": "FDGIT_PASSWORD", "propertyValue": "password", "credentialId": 46259 }, { "propertyName": "FDGIT_TIMEOUT", "propertyValue": 10000, "credentialId": null } ], "scmType": "GIT", "description": "description", "instanceCode": "CODE1", "isActive": true }

POST

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

API URL

http://host:port/flexdeploy/rest/v1/topology/integrations/scminstance

Parameters

Parameters

Required

Type

Description

Parameters

Required

Type

Description

Id

Yes

URL

This is a URL parameter for the Id which is used to find and return an SCM instance with.

description

No

String

This is the description that the SCM instance's description will be updated to.

isActive

Yes

Boolean

This is the isActive Boolean that the SCM instance's isActive Boolean will be updated to.

instanceCode

Yes

String

This is the code that the SCM instance's code will be updated to.

properties

Yes/No

List<PropertyValue>

This is the list of Properties that will be updated in the SCM instance. The JSON object must have all of the properties of the SCM instance's type. More info on the PropertyValue object is included below.

instanceName

Yes

String

This is the name that the SCM instance's name will be updated to.

scmType

Yes

String

This is the scm type of the SCM instance. 

PropertyValue

Attributes

Type

Description

Attributes

Type

Description

propertyName

String

This is the code of the property

propertyValue

String

This is the value of the property

credentialId

Long

Id of the credential associated with this property. Applicable only for encrypted properties.

Response Codes

HTTP Code

Description

HTTP Code

Description

201

Instance was created successfully

400

Bad request

401

The following macros are not currently supported in the footer:
  • style