Versions Compared

Key

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

Anchor
Top
Top

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.

Info
titleBase URL for SCM Instance REST API

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

...

Each function returns a JSON test instance object. The test SCM instance Object is an object that has these attributes,

AttributesTypeDescription
idinstanceIdLongThis is an id of the SCM Instance.
codeinstanceCodeStringThis is a code of the SCM instance.
nameinstanceNameStringThis is the unique name of the SCM instance.
typeSCMTypeStringThis 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<PropertyValuePojo>This is a list of the Properties associated with the SCM instance.


Currently there are 8 different source control management types that are supported in Flex Deploy.

ClearCaseUCM

Property NameTypeRequiredDescription
ClearCaseUCM URLStringYesURL of the ClearCase Server.
ClearCaseUCM UserStringYesClearCase User to connect with.
ClearCaseUCM PasswordStringYesClearCase Password for connecting user.

CVS 

Property NameTypeRequiredDescription
CVS URLStringYesURL to the CVS repository.
CVS UserStringYesCVS repository user.
CVS PasswordStringYesCVS repository password.

File System

Property NameTypeRequiredDescription
File Repository RootStringYesLocation on the FlexDeploy server of the repository.

Git

Property NameTypeRequiredDescription
Git URLStringYesURL to the Git repository.
Git UserStringYes/NoGit repository user.
Git PasswordStringYes/noGit repository password.
Git TimeoutIntegerNoTimeout for Git command execution.

Perforce

Property NameTypeRequiredDescription
Perforce HostStringYesHost of the Perforce repository.
Perforce PortStringYesPort of the Perforce repository.
Perforce UserStringYesPerforce User to connect with.
Perforce User PasswordStringYesPerforce Password associated with Perforce User.
Perforce SSL ConnectionBooleanYesShould ssl be used connecting to the server.

PVCS

Property NameTypeRequiredDescription
PVCS Project DatabaseStringYesProject Database Name.
PVCS UserStringYesPVCS user to access ProjectDatabases.
PVCS PasswordStringYesPVCS password to access ProjectDatabases

Subversion

Property NameTypeRequiredDescription
Subversion URLStringYesURL to the Subversion repository.
Subversion UserStringYesSubversion repository user.
Subversion PasswordStringYesSubversion repository password.
Subversion Authentication MethodsStringNoOne or more subversion authentication methods. For example, Basic, Digest, Negotiate, NTLM.

TFVC

Property NameTypeRequiredDescription
TFVC URLStringYesURL to the TFVC repository.
TFVC UserStringYesTFVC repository user.
TFVC PasswordStringYesTFVC repository password.

Back to Top

...

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.

...

Example

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

Code Block
themeEclipse
titleSCM Instance - 11101
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

When we run a GET request at the following URL

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

The GET request would return the  following JSON SCM instance object

Code Block
themeEclipse
titleSCM Instance GET Return JSON
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

Back to Top

...

Info
titleAPI URLs

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

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

name={name}

code={code}

Examples:
To search by code only:

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

To search by name only:

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

To search by type and name:

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


Tip

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

Parameters


Parameter
Required
Type
Description

name

NoURL(query)This is a URL query parameter for the name which is used to query the SCM instances with.
codeNoURL(query)This is a URL query parameter for the code which is used to query the SCM instances with.
typeNoURL(queryThis is a URL query parameter for the type which is used to query the SCM instances with.

Response Codes

HTTP Code
Description
200SCM Instances were found and returned
400Bad request
401Unauthorized
500Unexpected internal server error

Example

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


Code Block
themeEclipse
titleSCM Instance - 11101
{
   "instanceId": 11101
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

When we run a GET request at the following URL

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

The GET request would return the  following JSON SCM instance object

Code Block
themeEclipse
titleSCM Instance GET Return JSON
{
   "instanceId": 11101
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}


...

Code Block
themeEclipse
titleSample POST JSON Request
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

...

Parameters
Required
Type
Description
IdYesURLThis is a URL parameter for the Id which is used to find and return an SCM instance with.
descriptionNoStringThis is the description that the SCM instance's description will be updated to.
isActiveYesBooleanThis is the isActive Boolean that the SCM instance's isActive Boolean will be updated to.
codeinstanceCodeYesStringThis is the code that the SCM instance's code will be updated to.
propertiesYes/NoList<PropertyValuePojo>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. 
nameinstanceNameYesStringThis is the name that the SCM instance's name will be updated to.
instanceIdNoLongThis is the unique Id of the SCM instance. The SCM Instance will not be updated from this.

Response Codes

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

Example

If the POST  request receives the following JSON test instance object,

Code Block
themeEclipse
titlePOST JSON
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

The following SCM instance object will then be created as a new row in the database.


Code Block
themeEclipse
titleSCM Instance Post Return JSON
{
   "nameinstanceId": "11101,
   "instanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

Back to Top

...


Info
titleAPI URL

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


Code Block
themeEclipse
titleSample PUT JSON Request
{
   "name"instanceId": 11101,
   "instanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

Parameters

Parameters
Required
Type
Description
IdYesURLThis is a URL parameter for the Id which is used to find and return an SCM instance with.
descriptionNoStringThis is the description that the SCM instance's description will be updated to.
isActiveYesBooleanThis is the isActive Boolean that the SCM instance's isActive Boolean will be updated to.
codeinstanceCodeYesStringThis is the code that the SCM instance's code will be updated to.
propertiesYes/NoList<PropertyValuePojo>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. 
nameinstanceNameYesStringThis is the name that the SCM instance's name will be updated to.
instanceIdNoLongThis is the unique Id of the SCM instance. The SCM Instance will not be updated from this.


Response Codes

HTTP Code
Description
200SCM Instance was found and updated
400Bad request
401Unauthorized
404SCM Instance not found
500Unexpected internal server error

...

Code Block
themeEclipse
titleSCM Instance PUT JSON
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}

...

Code Block
themeEclipse
titleSCM Instance PUT Receive JSON
{
   "name"instanceId": 11101,
   "instanceName": "ScmName2",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPUT"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "userPUT"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPUT"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10001"
      }
   ],
   "typescmType": "GIT",
   "description": "descriptionPUT",
   "codeinstanceCode": "CODE2",
   "isActive": true
}

...

Code Block
themeEclipse
titleSCM Instance PUT Return JSON
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName2",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPUT"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "userPUT"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPUT"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10001"
      }
   ],
   "typescmType": "GIT",
   "description": "descriptionPUT",
   "codeinstanceCode": "CODE2",
   "isActive": true
}

Back to Top


PATCH

This PATCH service will update an existing SCM instance with the information passed through a JSON object. If an attribute of the JSON is null it will not be updated in the SCM instance.


Info
titleAPI URL

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

...


Code Block
themeEclipse
titleSample JSON Request
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "typescmType": "GIT",
   "description": "description",
   "codeinstanceCode": "CODE1",
   "isActive": true
}


Parameters

Parameters
Required
Type
Description
IdYesURLThis is a URL parameter for the Id which is used to find and return an SCM instance with.
descriptionNoStringThis is the description that the SCM instance's description will be updated to.
isActiveNoBooleanThis is the isActive Boolean that the SCM instance's isActive Boolean will be updated to.
codeinstanceCodeNoStringThis is the code that the SCM instance's code will be updated to.
propertiesNoList<PropertyValuePojo>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. 
nameinstanceNameNoStringThis is the name that the SCM instance's name will be updated to.
instanceIdNoLongThis is the unique Id of the SCM instance. The SCM Instance will not be updated from this.

Response Codes

HTTP Code
Description
200SCM Instance was found and patched
400Bad request
401Unauthorized
404SCM Instance not found
500Unexpected internal server error

Example

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

Code Block
themeEclipse
titleSCM Instance PATCH JSON
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName2",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPUT"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "userPUT"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPUT"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10001"
      }
   ],
   "typescmType": "GIT",
   "description": "descriptionPUT",
   "codeinstanceCode": "CODE2",
   "isActive": true
}

When we run a PATCH request at the following URL

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

And the PATCH request receives the following JSON SCM instance object,

Code Block
themeEclipse
titleSCM Instance Patch Receive JSON
{
   "instanceId": "name11101,
   "instanceName": null,
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPatch"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPatch"
      },
   ],
   "typescmType": "GIT",
   "description": null,
   "codeinstanceCode": "CODE3",
   "isActive": true
}

The PATCH request would then update the SCM instance with Id 11101 and return the  following JSON SCM instance object

Code Block
themeEclipse
titleSCM Instance PATCH Return JSON
{
   "instanceId": 11101,
   "nameinstanceName": "ScmName2",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPatch"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "userPUT"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPatch"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10001"
      }
   ],
   "typescmType": "GIT",
   "description": "descriptionPUT",
   "codeinstanceCode": "CODE3",
   "isActive": true
}
Back to Top

...