アプリケーションプログラミングインターフェイスガイド> REST API> TDVサーバーREST API> Version Control System API
 
Version Control System(バージョン管理システム)API
TDVリソースで実行できるVCSオペレーションは次のとおりです。
GET /branchs
GET /branchs/{name}
POST /checkin/{name}
GET /connection
GET /connection/{name}
GET /content/{name}
POST /discard/{name}
GET /enable
POST /fetch/{name}
GET /history/{name}
GET /latestcontent/{name}
GET /localcontent/{name}
GET /root
GET /root/{name}
POST /root/{name}
DELETE /root/{name}
POST /setCredential/{name}
GET /status/{name}
GET /vcsAdapter/{adapter_name}
GET /vcsAdapters
POST /vcsInstance
GET /vcsInstance/{name}
PUT /vcsInstance/{name}
DELETE /vcsInstance/{name}
GET /vcsInstances
GET /branchs
このAPIは、VCSアダプタ名とリモートVCSURLでブランチを取得するために使用されます。 GIT専用です
パラメーター:
名前
説明
パラメータータイプ
データタイプ
adapterName
アダプターの名前
query
string
url
 
header
string
user
 
header
string
password
 
header
string
base64Cer
これは、SSL証明書をサポートするgithttpsで使用されるオプションのパラメーターです。
他の使用法の場合、これはNullにすることができます。
query
string
VCSアダプタ名とリモートVCSURLでブランチを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/branches?adaptername={adapterName}&base64Cer={pem format certificate}" -H "Content-Type: application/json" -H "user: {user}" -H "password: {password}" -H "url: {url}"
GET /branchs/{name}
このAPIは、VCSインスタンス名でブランチを取得するために使用されます。 GIT専用です。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
VCSインスタンス名でブランチを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/branches/{vcsInstanceName}" -H "Content-Type: application/json"
POST /checkin/{name}
このAPIは、リソースをvcsにチェックインするために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
body
 
body
Model schema
リクエスト本文
値の例-スキーマ
{
“createdResources”:[
{
“resourcePath”: “string”,
“type”: “string”
}
],
“deletedResources”:[
{
“resourcePath”: “string”,
“type”: “string”
}
],
“updatedResources”:[
{
“resourcePath”: “string”,
“type”: “string”
}
],
“comment”: "string",
“email”: “string”,
“committerFullName”: “string”
}
チェックインの例
curl -X POST -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/checkin/{vcsInstanceName}}" -H "Content-Type: application/json" -d '{"comment": "my comment", "createdResources":[{"resourcePath":"/users/composite/admin/abc/foo", "type":"PROCEDURE"}], "updatedResources":[{"resourcePath":"/users/composite/admin/abc/bar", "type":"PROCEDURE"}], "deletedResources":[{"resourcePath":"/users/composite/admin/abc/kay", "type":"PROCEDURE"}]}'
GET /connection
このAPIは、vcsAdapterの名前、URL、ユーザー名、パスワードによる接続をテストするために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
adapterName
アダプターの名前
query
string
url
 
header
string
user
 
header
string
password
 
header
string
base64Cer
これは、SSL証明書をサポートするgithttpsで使用されるオプションのパラメーターです。
他の使用法の場合、これはNullにすることができます。
query
string
vcsAdapter名、URL、ユーザー名、パスワードで接続をテストする例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/connection?adapterName=svnAdapter&base64Cer={pem format certificate}" -H "Content-Type: application/json" -H "url:svn://172.23.5.76:3690" -H "user:svnuser1" -H "password:foa23f9u"
GET /connection/{name}
このAPIは、vcsurl接続を確認するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
vcsurl接続を確認する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/connection/{vcsInstanceName}" -H "Content-Type: application/json"
GET /content/{name}
このAPIは、特別なリソースのcmfコンテンツと特別なvcsInstanceのリビジョンを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
resourceType
 
query
string
resourcePath
 
query
string
revision
 
query
string
特別なリソースのcmfコンテンツと特別なvcsInstanceのリビジョンを取得する例
curl -X GET -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/content/{vcsInstanceName}?resourcePath=/users/composite/admin/abc/LookupProduct&resourceType=PROCEDURE&revision=r109" -H "Content-Type: application/json"
POST /discard/{name}
このAPIは、特別なリソースのローカル変更を破棄し、最新のリビジョンを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
includePrivileges
 
query
boolean
body
 
body
Model schema
リクエスト本文
値の例-スキーマ
{
“resources”:[
{
“resourcePath”: “string”,
“type”: “string”
}
]
}
ローカル変更をダイカードする例
curl -X POST -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/discard/{vcsInstanceName}?includePrivileges=true" -H "Content-Type: application/json" -d '{"resources":[{"resourcePath":"/users/composite/admin/def/LookupProduct", "type":"PROCEDURE"}]}'
GET /enable
このAPIは、vcs機能が有効になっているかどうかを確認するために使用されます。
パラメーター:
なし
vcs機能が有効になっているかどうかを確認する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/enable" -H "Content-Type: application/json"
POST /fetch/{name}
このAPIは、特定のリビジョンからリソースサブツリーをフェッチするために使用されます。単一のリソース(フォルダーまたはファイル)の場合、リソースのパスとタイプを指定する必要があります。 vcs接続全体のフェッチの場合、リソースパスとタイプをnullに設定する必要があります(リソースパスとタイプの値が空の場合、現在リーダーエラーが発生します)。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
revision
 
query
string
includePrivileges
 
query
boolean
body
 
body
Model schema
リクエスト本文
値の例-スキーマ
{
“resourcePath”: “string”,
“type”: “string”
}
特定のリビジョンからリソースサブツリーをフェッチする例
curl -X POST -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/fetch/{vcsInstanceName}?revision=r112&includePrivileges=true" -H "Content-Type: application/json" -d”{"resourcePath":"/users/composite/admin/examples/view4", "type":"TABLE"}’
GET /history/{name}
このAPIは、特別なvcsInstanceの特別なリソースの履歴全体または履歴を取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
resourceType
 
query
string
resourcePath
 
query
string
特別なvcsInstanceの特別なリソースの全履歴または履歴を取得する例
curl -X GET -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/history/{vcsInstnace}[?resourcePath=/users/composite/admin/abc/LookupProduct&resourceType=PROCEDURE]" -H "Content-Type: application/json"
GET /latestcontent/{name}
このAPIは、特別なvcsInstanceの特別なリソースの最新のcmfコンテンツを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
resourceType
 
query
string
resourcePath
 
query
string
特別なvcsInstanceの特別なリソースの最新のcmfコンテンツを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/latestcontent/{vcsInstanceName}?resourcePath=/users/composite/admin/abc/LookupProduct&resourceType=PROCEDURE" -H "Content-Type: application/json"
GET /localcontent/{name}
このAPIは、特別なvcsInstanceの特別なリソースのローカルcmfコンテンツを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
resourceType
 
query
string
resourcePath
 
query
string
特別なvcsInstanceの特別なリソースのローカルcmfコンテンツを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/localcontent/{vcsInstanceName}?resourcePath=/users/composite/admin/abc/LookupProduct&resourceType=PROCEDURE" -H "Content-Type: application/json"
GET /root
このAPIは、特別なパスがvcsインスタンスのルートであるかどうかを確認するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
cis_path
 
query
string
rootType
 
query
string
特別なパスがvcsインスタンスのルートであるかどうかを確認する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/root?cis_path=/users/composite/admin/abc/kkkdd&rootType={type}" -H "Content-Type: application/json"
GET /root/{name}
このAPIは、特別なvcsインスタンスのすべてのルートを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
特別なvcsインスタンスのすべてのルートを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/root/{vcsInstanceName}}" -H "Content-Type: application/json"
POST /root/{name}
このAPIは、特別なvcsインスタンスのルートを追加するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
mode
 
query
string
rootType
 
query
string
includePriveleges
 
query
boolean
body
 
body
string
特別なvcsインスタンスのルートを追加する例
curl -X POST -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/root/{vcsInstanceName}?mode={push/pull}&includePrivileges=true&rootType={type}" -H "Content-Type: application/json" -d "/users/composite/admin/gitabc"
DELETE /root/{name}
このAPIは、特別なvcsインスタンスからルートを削除するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
cis_path
 
query
string
rootType
 
query
string
特別なvcsインスタンスからルートを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/vcs/v1/root/{vcsInstanceName}?cis_path=/users/composite/admin/abc&rootType={type}" -H "Content-Type: application/json"
POST /setCredential/{name}
このAPIは、vcsインスタンスの資格情報を設定するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
body
 
body
Model schema
リクエスト本文
値の例-スキーマ
{
“username”: “string”,
“password”: “string”
}
クレデンシャルを設定する例
curl -X POST -u admin:admin --cookie "session9400={sessionToken}" "http://localhost:9400/rest/vcs/v1/setCredential/{vcsInstanceName}}" -H "Content-Type: application/json" -d '{"username":"gituser2", "password":"foa23f9u"}'
GET /status/{name}
このAPIは、特別なvcsインスタンスのリソースステータスを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
特別なvcsインスタンスのリソースステータスを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/status/{vcsInstanceName}}" -H "Content-Type: application/json"
GET /vcsAdapter/{adapter_name}
このAPIは、アダプター名でVCSアダプターを取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
adapterName
アダプターの名前
path
string
アダプタ名でVCSアダプタを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsAdapter/{adapterName}" -H "Content-Type: application/json"
GET /vcsAdapters
このAPIは、VCSアダプターを取得するために使用されます。
パラメーター:
なし
VCSアダプターを入手する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsAdapters" -H "Content-Type: application/json"
POST /vcsInstance
このAPIは、vcsインスタンスを作成するために使用されます。
パラメーター:
なし
リクエスト本文
値の例-スキーマ
{
“cmdCheckIn”: “string”,
“cmdCheckOut: “string”,
“cmdAdd”: “string”,
“cmdRemove”: “string”,
“cmdRevert”: “string”,
“cmdStatus”: “string”,
“cmdDiff”: “string”,
“name”: “string,
“description”: “string”,
“providerId”: “string”,
“repository”: “string”,
“localWorkspace”: “string”,
“encryptionPassword”, “string”,
“branch”, “string”,
“ignoreEncryption”: “string”,
“base64Cer”: “string”,
“cmdHistory”: “string”
}
vcsインスタンスを作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsInstance" -H "Content-Type: application/json" -d '{"name":"vcssource1", "description": "dd", "providerId":"svnAdapter", "repository": "svn://172.23.5.76:3690/project6", "branch":"master", "encryptionPassword":"testPassword", "base64Cer":"Pem format certificate" }'
GET /vcsInstance/{name}
このAPIは、vcsインスタンスを名前で取得するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
名前でvcsインスタンスを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsInstance/{vcsInstanceName}" -H "Content-Type: application/json"
PUT /vcsInstance/{name}
このAPIは、vcsインスタンスを更新するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
リクエスト本文
値の例-スキーマ
{
“cmdCheckIn”: “string”,
“cmdCheckOut: “string”,
“cmdAdd”: “string”,
“cmdRemove”: “string”,
“cmdRevert”: “string”,
“cmdStatus”: “string”,
“cmdDiff”: “string”,
“name”: “string,
“description”: “string”,
“providerId”: “string”,
“repository”: “string”,
“localWorkspace”: “string”,
“encryptionPassword”, “string”,
“branch”, “string”,
“ignoreEncryption”: “string”,
“base64Cer”: “string”,
“cmdHistory”: “string”
}
vcsインスタンスを更新する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsInstance/{vcsInstanceName}" -H "Content-Type: application/json" -d '{"description": "dddddd", "providerId":"svnAdapter", "repository": "svn://172.23.5.76:3690", "branch":"master", "encryptionPassword":"testPassword", "base64Cer":"Pem format certificate" }'
DELETE /vcsInstance/{name}
このAPIは、vcsインスタンスを削除するために使用されます。
パラメーター:
名前
説明
パラメータータイプ
データタイプ
name
 
path
string
vcsインスタンスを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsInstance/{vcsInstanceName}" -H "Content-Type: application/json"
GET /vcsInstances
このAPIは、すべてのvcsインスタンスを取得するために使用されます。
パラメーター:
なし
すべてのvcsインスタンスを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/vcs/v1/vcsInstances" -H "Content-Type: application/json"