require 'open-uri' require 'helix_web_services_client/open_model' class HelixWebServicesClient # Returns an array of Server objects representing people in the system. def servers arr = execute_method_no_body(:get, hve_path('servers')) arr.map { |obj| OpenModel.new(obj) } end # Returns a HelixWebServicesClient::OpenModel for the login def server(server) server = server.ServerID if server.is_a?(OpenModel) obj = execute_method_no_body(:get, hve_path("servers/#{URI.encode(server)}")) OpenModel.new(obj) end # Creates a new server in the system based on the Server instance def create_server(server) server = OpenModel.new(server) unless server.is_a?(OpenModel) execute_method_with_body(:post, hve_path('servers'), server.marshal_dump) end def update_server(server) server = OpenModel.new(server) unless server.is_a?(OpenModel) execute_method_with_body(:patch, hve_path("servers/#{URI.encode(server.ServerID)}"), server.marshal_dump) end def delete_server(server) server = server.server_id if server.is_a?(OpenModel) execute_method_no_body(:delete, hve_path("servers/#{URI.encode(server)}")) 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/servers.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/servers.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 | 15222 | tjuricek |
Revise server specs testing and documentation. Note: also fixed issues with setting P4PORT via headers. For whatever reason, the host setting doesn't seem to work like I expect it to, though P4PORT works just fine. |
||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. | ||
//guest/perforce_software/helix-web-services/main/p4_web_api/clients/ruby/p4_web_api_client/lib/p4_web_api_client/client/servers.rb | |||||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |