=== Helix Git Fusion Repositories [[get_git_fusion_v1_repos]] ==== `GET /git_fusion/v1/repos` Lists all configured repositories readable by the current user. ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response Body JSON Response will consist of names of configured repositories as well as their id's - which are Git Fusion encoded versions of the name strings. [source,json] ---- [ { "id": "namespace_0xS_project", "name": "namespace/project", }, { "id: "repository_name", "name": "repository_name", } ] ---- [[get_git_fusion_v1_repos_repo]] ==== `GET /git_fusion/v1/repos/[repo]` Return configuration for specified repository. Grabs and returns contents of http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j[p4gf_config] file for given repository. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `repo` | See <<git_fusion_url_encoding>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response Body JSON Response returns an object with 'config' value that contains the contents of http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j[p4gf_config]. [source,json] ---- { "description": "Sample repo", "branches": { "master": { "depot_path" : "//depot/sample_repo_name/...", "client_path": "..." } } } ---- [[put_git_fusion_v1_repos_repo]] ==== `PUT /git_fusion/v1/repos/[repo]` Submits a http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j[p4gf_config] file to create or update a repository configuration. If repository does not exist or has been previously deleted - saves contents of the config file to a new p4gf_config file. If the repository already has been initialised - replaces the all of the file contents for p4gf_config for specified repository. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `repo` | See <<git_fusion_url_encoding>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `Content-Type` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Request JSON Body The request should be file contents of a http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j[p4gf_config] file. An example request body might look like: [source,plain] ---- [@repo] description = Testing repo description [prep] git-branch-name = prep view = //depot/testing_repo_name/... ... ---- ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response Body Response returns an object with 'config' value that contains the contents of p4gf_config or an error message. If upload exists successfully - an example response might look like this: [source,json] ---- { "description": "Testing repo description", "branches": { "prep": { "depot_path" : "//depot/testing_repo_name/...", "client_path": "..." } } } ---- [[patch_git_fusion_v1_repos_repo]] ==== `PATCH /git_fusion/v1/repos/[repo]` Updates values in the repository configuration. This will find specified parameters and update its values for a specified repository configuration file. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `repo` | See <<git_fusion_url_encoding>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `Content-Type` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Request JSON Body This is a sample string with values to be replaced. [source,json] ---- { 'description' = 'Updated description', 'branches': { 'master': { 'git-branch-name' = 'other-branch' } } } ---- ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response JSON Body See <<error_responses>> for the format of failures. [[delete_git_fusion_v1_repos_repo]] ==== `DELETE /git_fusion/v1/repos/[repo]` Deletes the repository configuration (http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j[p4gf_config file]). Contents of the repository are not deleted from Perforce. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `repo` | See <<git_fusion_url_encoding>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `Content-Type` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response JSON Body See <<error_responses>> for the format of failures. [[git_fusion_url_encoding]] ==== Repository name encoding All URL's containing a repository path should have that path encoded to Git Fusion standards to enable appropriate routing. Encoding has to be done by client, according to the table below: [cols="5*", options="header"] |=== | Character | Encoding | Unencoded repository name | Encoded repository name | Sample URL with encoded repository name | / (forward slash) | \_0xS_ | foo/bar | foo_0xS_bar | /git-fusion/v1/repos/foo_0xS_bar | : (colon) | \_0xC_ | foo:bar | foo_0xC_bar | /git-fusion/v1/repos/foo_0xC_bar |===
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 15745 | ptomiak |
Second part of shelved changes. Contains updated git-fusion app, changes to string encodig/decoding and updated docs. |
||
#2 | 15744 | ptomiak | Unshelve files from review 15549 to my dev branch. | ||
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/doc/git_fusion/repos.asc | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/doc/git_fusion/repos.asc | |||||
#1 | 15241 | tjuricek | Add Git Fusion stubs and documentation. |