=== Helix Versioning Engine Counters [[get_p4_vX_counters]] ==== `GET /p4/v[api]/counters` Lists available counters in the system. The resources of this list are summaries of counters in the system. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `api` | The Helix Versioning Engine API level. |=== ===== 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 Body JSON The values of this method are based on the result of the http://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_counters.html[`p4 -ztag counters`] command. For more field information refer to the http://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_counters.html[command reference]. See <<error_responses>> for the format of failures. An example response body might look like: [source,json] ---- [ { "counter": "build", "value": "54809" }, { "counter": "build_good", "value": "54670" } ] ---- ===== Ruby Client See link:./helix_web_services_client_ruby/HelixWebServicesClient.html#counters-instance_method[`HelixWebServicesClient#counters`] [[get_p4_vX_counters_counter]] ==== `GET /p4/v[api]/counters/[counter]` Return counter details, similar to the `p4 counter` command. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `api` | The Helix Versioning Engine API level. | counter | The counter name. |=== ===== 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 Data Returns the form fields of the http://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_counter.html[`p4 -ztag counter [counter name]`] command. For more information, see the command reference. The main difference between the details and list view is the inclusion of the View field. ===== Example JSON Response [source,json] ---- { "counter": "build", "value": "54809" } ---- ===== Ruby Client See link:./helix_web_services_client_ruby/HelixWebServicesClient.html#counter-instance_method[`HelixWebServicesClient#counter`] [[put_p4_vX_counters_counter]] ==== `PUT /p4/v[api]/counters/[counter]` Sets a counter, like the `p4 counter [counter] [value]` command. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `api` | The Helix Versioning Engine API level. | counter | The counter name. |=== ===== 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 Body JSON The request body is a JSON object with a `value` property. For example: [source,json] ---- { "value": "123" } ---- ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Ruby Client See link:./helix_web_services_client_ruby/HelixWebServicesClient.html#set_counter-instance_method[`HelixWebServicesClient#set_counter`] [[post_p4_vX_counters_counter]] ==== `POST /p4/v[api]/counters/[counter]/increment` Increments a numerical counter, similar to the `p4 counter -i` command. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `api` | The Helix Versioning Engine API level. | counter | The name of the counter |=== ===== 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` |=== ===== Ruby Client See link:./helix_web_services_client_ruby/HelixWebServicesClient.html#increment_counter-instance_method[`HelixWebServicesClient#increment_counter`] [[delete_p4_vX_counters_counter]] ===== `DELETE /p4/v[api]/counters/[counter]` Removes the counter specification, similar to the `p4 counter -d` command. ====== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `api` | The Helix Versioning Engine API level. | counter | The name of the counter |=== ===== 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` |=== ===== Ruby Client See link:./helix_web_services_client_ruby/HelixWebServicesClient.html#delete_counter-instance_method[`HelixWebServicesClient#delete_counter`]
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 16114 | Doug Scheirer | Merge from main | ||
//guest/doug_scheirer/helix-web-services/main/source/doc/helix_versioning_engine/counters.asc | |||||
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/doc/helix_versioning_engine/counters.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/helix_versioning_engine/counters.asc | |||||
#2 | 15240 | tjuricek |
Set api level via request path on all Helix Versioning Engine methods. This will allow migration of applications to different P4D versions. Our internal methods (like project API) should attempt to handle backward compatibility similarly. P4WEBAPI-118 |
||
#1 | 15225 | tjuricek |
Revise counter implementation, tests, and documentation Wasn't available in the Ruby client before, so, it's now available. |