require "uri" module HelixWebServices class AlphaApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # # Create a new changelist that can affect multiple files using different kinds of actions.\nIf you require the ability to integrate or move, for example, you can use this method. # @param server The server ID that we execute this particular method against. # @param changelist_request Description of changes to make # @param [Hash] opts the optional parameters # @return [CommandResponse] def server_changes_post(server, changelist_request, opts = {}) data, status_code, headers = server_changes_post_with_http_info(server, changelist_request, opts) return data end # # Create a new changelist that can affect multiple files using different kinds of actions.\nIf you require the ability to integrate or move, for example, you can use this method. # @param server The server ID that we execute this particular method against. # @param changelist_request Description of changes to make # @param [Hash] opts the optional parameters # @return [Array<(CommandResponse, Fixnum, Hash)>] CommandResponse data, response status code and response headers def server_changes_post_with_http_info(server, changelist_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AlphaApi#server_changes_post ..." end # verify the required parameter 'server' is set fail "Missing the required parameter 'server' when calling server_changes_post" if server.nil? # verify the required parameter 'changelist_request' is set fail "Missing the required parameter 'changelist_request' when calling server_changes_post" if changelist_request.nil? # resource path path = "/p4d/v16.1/{server}/changes".sub('{format}','json').sub('{' + 'server' + '}', server.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(changelist_request) auth_names = ['ticket_auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommandResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AlphaApi#server_changes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # # Lists all configured repositories readable by the current user. # @param server The server ID that we execute this particular method against. # @param [Hash] opts the optional parameters # @return [Array<GitFusionRepoId>] def server_git_fusion_repos_get(server, opts = {}) data, status_code, headers = server_git_fusion_repos_get_with_http_info(server, opts) return data end # # Lists all configured repositories readable by the current user. # @param server The server ID that we execute this particular method against. # @param [Hash] opts the optional parameters # @return [Array<(Array<GitFusionRepoId>, Fixnum, Hash)>] Array<GitFusionRepoId> data, response status code and response headers def server_git_fusion_repos_get_with_http_info(server, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AlphaApi#server_git_fusion_repos_get ..." end # verify the required parameter 'server' is set fail "Missing the required parameter 'server' when calling server_git_fusion_repos_get" if server.nil? # resource path path = "/p4d/v16.1/{server}/git-fusion-repos".sub('{format}','json').sub('{' + 'server' + '}', server.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ticket_auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<GitFusionRepoId>') if @api_client.config.debugging @api_client.config.logger.debug "API called: AlphaApi#server_git_fusion_repos_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # # Submits a [p4gf_config](http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j) file to create or update a repository configuration.\n\nIf the repository does not exist or has been previously deleted, this method saves contents of the config file to a new `p4gf_config` file.\nIf the repository has already been initialised, this method replaces all of the file contents of the specified repository's `p4gf_config` file. # @param server The server ID that we execute this particular method against. # @param body The new configuration # @param [Hash] opts the optional parameters # @return [CommandResponse] def server_git_fusion_repos_post(server, body, opts = {}) data, status_code, headers = server_git_fusion_repos_post_with_http_info(server, body, opts) return data end # # Submits a [p4gf_config](http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j) file to create or update a repository configuration.\n\nIf the repository does not exist or has been previously deleted, this method saves contents of the config file to a new `p4gf_config` file.\nIf the repository has already been initialised, this method replaces all of the file contents of the specified repository's `p4gf_config` file. # @param server The server ID that we execute this particular method against. # @param body The new configuration # @param [Hash] opts the optional parameters # @return [Array<(CommandResponse, Fixnum, Hash)>] CommandResponse data, response status code and response headers def server_git_fusion_repos_post_with_http_info(server, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AlphaApi#server_git_fusion_repos_post ..." end # verify the required parameter 'server' is set fail "Missing the required parameter 'server' when calling server_git_fusion_repos_post" if server.nil? # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling server_git_fusion_repos_post" if body.nil? # resource path path = "/p4d/v16.1/{server}/git-fusion-repos".sub('{format}','json').sub('{' + 'server' + '}', server.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ticket_auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommandResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AlphaApi#server_git_fusion_repos_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # # Return configuration for the specified repository.\nGrabs and returns contents of the [p4gf_config](http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j) file for given repository. # @param server The server ID that we execute this particular method against. # @param repo The Git Fusion Repo ID # @param [Hash] opts the optional parameters # @return [GitFusionRepoConfig] def server_git_fusion_repos_repo_get(server, repo, opts = {}) data, status_code, headers = server_git_fusion_repos_repo_get_with_http_info(server, repo, opts) return data end # # Return configuration for the specified repository.\nGrabs and returns contents of the [p4gf_config](http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j) file for given repository. # @param server The server ID that we execute this particular method against. # @param repo The Git Fusion Repo ID # @param [Hash] opts the optional parameters # @return [Array<(GitFusionRepoConfig, Fixnum, Hash)>] GitFusionRepoConfig data, response status code and response headers def server_git_fusion_repos_repo_get_with_http_info(server, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AlphaApi#server_git_fusion_repos_repo_get ..." end # verify the required parameter 'server' is set fail "Missing the required parameter 'server' when calling server_git_fusion_repos_repo_get" if server.nil? # verify the required parameter 'repo' is set fail "Missing the required parameter 'repo' when calling server_git_fusion_repos_repo_get" if repo.nil? # resource path path = "/p4d/v16.1/{server}/git-fusion-repos/{repo}".sub('{format}','json').sub('{' + 'server' + '}', server.to_s).sub('{' + 'repo' + '}', repo.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ticket_auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GitFusionRepoConfig') if @api_client.config.debugging @api_client.config.logger.debug "API called: AlphaApi#server_git_fusion_repos_repo_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # # Deletes the repository configuration (The [p4gf_config file](http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j)).\nContents of the repository are not deleted from Perforce. # @param server The server ID that we execute this particular method against. # @param repo The Git Fusion Repo ID # @param [Hash] opts the optional parameters # @return [CommandResponse] def server_git_fusion_repos_repo_delete(server, repo, opts = {}) data, status_code, headers = server_git_fusion_repos_repo_delete_with_http_info(server, repo, opts) return data end # # Deletes the repository configuration (The [p4gf_config file](http://www.perforce.com/perforce/r15.1/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_jgz_nz2_2j)).\nContents of the repository are not deleted from Perforce. # @param server The server ID that we execute this particular method against. # @param repo The Git Fusion Repo ID # @param [Hash] opts the optional parameters # @return [Array<(CommandResponse, Fixnum, Hash)>] CommandResponse data, response status code and response headers def server_git_fusion_repos_repo_delete_with_http_info(server, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AlphaApi#server_git_fusion_repos_repo_delete ..." end # verify the required parameter 'server' is set fail "Missing the required parameter 'server' when calling server_git_fusion_repos_repo_delete" if server.nil? # verify the required parameter 'repo' is set fail "Missing the required parameter 'repo' when calling server_git_fusion_repos_repo_delete" if repo.nil? # resource path path = "/p4d/v16.1/{server}/git-fusion-repos/{repo}".sub('{format}','json').sub('{' + 'server' + '}', server.to_s).sub('{' + 'repo' + '}', repo.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ticket_auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommandResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AlphaApi#server_git_fusion_repos_repo_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # # Updates values in the repository configuration.\nThis method will find all specified parameters and update each value for the specified repository's configuration file. # @param server The server ID that we execute this particular method against. # @param repo The Git Fusion Repo ID # @param body The new configuration # @param [Hash] opts the optional parameters # @return [CommandResponse] def server_git_fusion_repos_repo_patch(server, repo, body, opts = {}) data, status_code, headers = server_git_fusion_repos_repo_patch_with_http_info(server, repo, body, opts) return data end # # Updates values in the repository configuration.\nThis method will find all specified parameters and update each value for the specified repository's configuration file. # @param server The server ID that we execute this particular method against. # @param repo The Git Fusion Repo ID # @param body The new configuration # @param [Hash] opts the optional parameters # @return [Array<(CommandResponse, Fixnum, Hash)>] CommandResponse data, response status code and response headers def server_git_fusion_repos_repo_patch_with_http_info(server, repo, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AlphaApi#server_git_fusion_repos_repo_patch ..." end # verify the required parameter 'server' is set fail "Missing the required parameter 'server' when calling server_git_fusion_repos_repo_patch" if server.nil? # verify the required parameter 'repo' is set fail "Missing the required parameter 'repo' when calling server_git_fusion_repos_repo_patch" if repo.nil? # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling server_git_fusion_repos_repo_patch" if body.nil? # resource path path = "/p4d/v16.1/{server}/git-fusion-repos/{repo}".sub('{format}','json').sub('{' + 'server' + '}', server.to_s).sub('{' + 'repo' + '}', repo.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ticket_auth'] data, status_code, headers = @api_client.call_api(:PATCH, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommandResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AlphaApi#server_git_fusion_repos_repo_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 19597 | swellard | Refactor REST path | ||
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/ruby/lib/helix_web_services_client/api/alpha_api.rb | |||||
#4 | 19202 | tjuricek | Revised documentation for the Ruby Client SDK; removed obsolete methods and definitions, and restyled a lot of the tables. | ||
#3 | 19002 | tjuricek |
Improve API to interact with multiple p4ds. The configuration now requires an explicit setting of what P4Ds HWS can talk to via the 'P4D config dir', where there's a file indicating connection settings per p4d, and importantly, an ID. This is the "server ID" referenced everywhere. Most methods now require a server ID to indicate which p4d to manipulate. In the future, it's likely we will interact with *multiple* p4d instances on some services. This completely removes the ability to run HWS as a kind of an "open proxy" to whatever p4d you want. Given the nature of the change and the lack of priority, we've removed Helix Cloud testing and disabled several methods from their "Helix Cloud" implementation. These will be relatively easy to bring back, we'll just need a new method from Raymond that lists the "allowed server IDs" that map to the HWS configured server IDs for a particular user. Another notable aspect of this change is the use of JSON Web Token to create our authentication key. We associate this key with an in-memory "session" that contains the P4D tickets we use to authenticate users. The JWT token, by default, is assigned a timeout, which allows HWS to block further access to underlying servers without having to interact with multiple auth backends. If any backend fails with that session, the user will get a 403. If you disable the timeout, you'll need to ensure your clients clear out sessions. |
||
#2 | 18905 | tjuricek |
Add Git Fusion environent configuration and testing, and altered the implementation to use the newly defined API. Note: only runs on linux. We use latest GF production for testing and GF packages are linux only. The "integration" is pretty "light" at this point. This does require the test machine to have our package repository setup. |
||
#1 | 18795 | tjuricek | Use point-release versioning for the client SDKs and installers. |