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 Test Instance REST APIService

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
Code
idLongThis is an id of the SCM Instance.
codeStringThis is a code of the SCM instance.
Type
nameStringThis is the unique name of the SCM instance.
typeStringThis is the SCM type of the SCM instance.
isActiveBooleanThis is a Boolean that tracks whether or not the SCM instance is active.
Description
descriptionStringThis is the description of the SCM instance.
NameStringThis is the unique name of the SCM instance.PropertiesList<Property>
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.

...

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

...

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.
CodecodeYesStringThis is the code that the SCM instance's code will be updated to.
propertiesYes/NoList<PropertyPojo>List<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. 
NamenameYesStringThis is the name that the SCM instance's name will be updated to.

...


Info
titleAPI URL

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


Code Block
themeEclipse
titleSample PUT JSON Request
{
   "name": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "type": "GIT",
   "description": "description",
   "code": "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.
CodecodeYesStringThis is the code that the SCM instance's code will be updated to.
propertiesYes/NoList<PropertyPojo>List<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. 
NamenameYesStringThis is the name that the SCM instance's name will be updated to.


...

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
{
   "name": "ScmName1",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "url"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "user"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "password"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10000"
      }
   ],
   "type": "GIT",
   "description": "description",
   "code": "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.
Code
codeNoStringThis is the code that the SCM instance's code will be updated to.
propertiesNo
List<PropertyPojo>
List<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. 
Name
nameNoStringThis is the name that the SCM instance's name will be updated to.

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
{
   "name": "ScmName2",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPUT"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "userPUT"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPUT"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10001"
      }
   ],
   "type": "GIT",
   "description": "descriptionPUT",
   "code": "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
{
   "name": null,
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPatch"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPatch"
      },
   ],
   "type": "GIT",
   "description": null,
   "code": "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
{
   "name": "ScmName2",
   "properties":    [
            {
         "propertyName": "FDGIT_URL",
         "propertyValue": "urlPatch"
      },
            {
         "propertyName": "FDGIT_USER",
         "propertyValue": "userPUT"
      },
            {
         "propertyName": "FDGIT_PASSWORD",
         "propertyValue": "passwordPatch"
      },
            {
         "propertyName": "FDGIT_TIMEOUT",
         "propertyValue": "10001"
      }
   ],
   "type": "GIT",
   "description": "descriptionPUT",
   "code": "CODE3",
   "isActive": true
}
Back to Top

...