require 'open-uri' require 'helix_web_services_client/open_model' class HelixWebServicesClient # Array of Branch objects stored in the system. Not all fields will be # filled out (e.g., view). def branches arr = execute_method_no_body(:get, hve_path('branches')) arr.map { |a| OpenModel.new(a) } end # Returns the branch instance indicated by the branch name (or model) def branch(branch) branch = OpenModel.new(branch).branch unless branch.is_a?(String) obj = execute_method_with_body(:get, hve_path("branches/#{URI.encode(branch)}")) OpenModel.new(obj) end # Creates a new branch in the system. def create_branch(branch) execute_method_with_body(:post, hve_path('branches'), branch) true end # Updates the branch specification. def update_branch(branch) branch = OpenModel.new(branch) unless branch.is_a?(OpenModel) execute_method_with_body(:patch, hve_path("branches/#{URI.encode(branch.branch)}"), branch.marshal_dump) true end # Deletes the branch specification in the system. def delete_branch(branch) branch = OpenModel.new(branch).branch unless branch.is_a?(String) execute_method_no_body(:delete, hve_path("branches/#{URI.encode(branch)}")) true end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/lib/helix_web_services_client/branches.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/lib/helix_web_services_client/branches.rb | |||||
#3 | 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 |
||
#2 | 15077 | tjuricek |
Add new 'model' technique, revised branch spec operations, test Auth::Middleware. The Ruby client now does *not* strictly type anything, but extends OpenStruct with helper methods to help deal with inconsistent data formats. See the OpenModel class documentation for more details. The Auth::Middleware class is also *finally* implemented as well. This does not take into account all possible variations of server behavior (yet), but that will happen in follow-up work. |
||
#1 | 13799 | tjuricek |
Start with branch specs hosting in a new monolithic 'helix web services' project. Converting from a microservice to a monolithic architecture due to resource constraints at getting a deployable system running. Additionally, since it's not expected that people will upgrade often, the major benefit of microservices - being able to add services individually without affecting others - is not really a major benefit. The Ruby SDK will be consolidated into a single 'helix web services client' project. It may end up being distributed via Rubygems. This only runs branch specs at the moment. I want to get a CD pipeline setup for the monolithic server before revising more methods. |