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 3 Next »

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.

Base URL for Service


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

AttributesTypeDescription
idLongThis is an id of the SCM Instance.
codeStringThis is a code of the SCM instance.
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.
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.

Parameters

Parameter
Required
Type
Description

Id

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

Response Codes

HTTP Code
Description
200SCM instance was 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

SCM Instance - 11101
{
   "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
}

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

SCM Instance GET Return JSON
{
   "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
}

Back to Top



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/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}

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

SCM Instance - 11101
{
   "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
}

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

SCM Instance GET Return JSON
{
   "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
}

Back to Top


POST

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

API URL


Sample POST 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.
codeYesStringThis 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. 
nameYesStringThis is the name that the SCM instance's name will be updated to.

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,

POST JSON
{
   "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
}

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

SCM Instance Post Return JSON
{
   "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
}

Back to Top


PUT

This PUT service will update all attributes of a SCM instance with the given Id based on the attributes of a JSON object paramaters.

Sample 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.
codeYesStringThis 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. 
nameYesStringThis is the name that the SCM instance's name will be updated to.

Response Codes

HTTP Code
Description
200SCM Instance was found and updated
400Bad request
401Unauthorized
404SCM Instance not found
500Unexpected 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 PUT JSON
{
   "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
}

When we run a PUT request at the following URL

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

And the PUT request recieves the following JSON SCM instace object,

SCM Instance PUT Receive 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
}

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

SCM Instance PUT Return 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
}

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.


Sample 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.
codeNoStringThis 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. 
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

SCM 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,

SCM 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

SCM 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


  • No labels