class AlfrescoAPI::DownloadsApi
Attributes
Public Class Methods
# File lib/alfresco_api/api/downloads_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Cancel a download Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Cancels the creation of a download request. Note: The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour) Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint The cancel operation is done asynchronously. @param download_id The identifier of a download node. @param [Hash] opts the optional parameters @return [nil]
# File lib/alfresco_api/api/downloads_api.rb, line 28 def cancel_download(download_id, opts = {}) cancel_download_with_http_info(download_id, opts) return nil end
Cancel a download Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Cancels the creation of a download request. Note: The download node can be deleted using the **DELETE /nodes/{downloadId}** endpoint By default, if the download node is not deleted it will be picked up by a cleaner job which removes download nodes older than a configurable amount of time (default is 1 hour) Information about the existing progress at the time of cancelling can be retrieved by calling the **GET /downloads/{downloadId}** endpoint The cancel operation is done asynchronously. @param download_id The identifier of a download node. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/alfresco_api/api/downloads_api.rb, line 38 def cancel_download_with_http_info(download_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DownloadsApi.cancel_download ..." end # verify the required parameter 'download_id' is set if @api_client.config.client_side_validation && download_id.nil? fail ArgumentError, "Missing the required parameter 'download_id' when calling DownloadsApi.cancel_download" end # resource path local_var_path = "/downloads/{downloadId}".sub('{' + 'downloadId' + '}', download_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: DownloadsApi#cancel_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create a new download Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Creates a new download node asynchronously, the content of which will be the zipped content of the nodeIds specified in the JSON body like this: “`JSON { "nodeIds": [ "c8bb482a-ff3c-4704-a3a3-de1c83ccd84c", "cffa62db-aa01-493d-9594-058bc058eeb1" ] } “` Note: The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint
@param download_body_create The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. @param [Hash] opts the optional parameters @option opts [Array<String>] :fields A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. @return [DownloadEntry]
# File lib/alfresco_api/api/downloads_api.rb, line 83 def create_download(download_body_create, opts = {}) data, _status_code, _headers = create_download_with_http_info(download_body_create, opts) return data end
Create a new download Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Creates a new download node asynchronously, the content of which will be the zipped content of the nodeIds specified in the JSON body like this: ```JSON { "nodeIds": [ "c8bb482a-ff3c-4704-a3a3-de1c83ccd84c", "cffa62db-aa01-493d-9594-058bc058eeb1" ] } ``` Note: The content of the download node can be obtained using the **GET /nodes/{downloadId}/content** endpoint
@param download_body_create The nodeIds the content of which will be zipped, which zip will be set as the content of our download node. @param [Hash] opts the optional parameters @option opts [Array<String>] :fields A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. @return [Array<(DownloadEntry
, Fixnum, Hash)>] DownloadEntry
data, response status code and response headers
# File lib/alfresco_api/api/downloads_api.rb, line 94 def create_download_with_http_info(download_body_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DownloadsApi.create_download ..." end # verify the required parameter 'download_body_create' is set if @api_client.config.client_side_validation && download_body_create.nil? fail ArgumentError, "Missing the required parameter 'download_body_create' when calling DownloadsApi.create_download" end # resource path local_var_path = "/downloads" # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(download_body_create) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DownloadEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: DownloadsApi#create_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a download Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Retrieve status information for download node downloadId @param download_id The identifier of a download node. @param [Hash] opts the optional parameters @option opts [Array<String>] :fields A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. @return [DownloadEntry]
# File lib/alfresco_api/api/downloads_api.rb, line 141 def get_download(download_id, opts = {}) data, _status_code, _headers = get_download_with_http_info(download_id, opts) return data end
Get a download Note: this endpoint is available in Alfresco 5.2.1 and newer versions. Retrieve status information for download node downloadId @param download_id The identifier of a download node. @param [Hash] opts the optional parameters @option opts [Array<String>] :fields A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter. @return [Array<(DownloadEntry
, Fixnum, Hash)>] DownloadEntry
data, response status code and response headers
# File lib/alfresco_api/api/downloads_api.rb, line 152 def get_download_with_http_info(download_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DownloadsApi.get_download ..." end # verify the required parameter 'download_id' is set if @api_client.config.client_side_validation && download_id.nil? fail ArgumentError, "Missing the required parameter 'download_id' when calling DownloadsApi.get_download" end # resource path local_var_path = "/downloads/{downloadId}".sub('{' + 'downloadId' + '}', download_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DownloadEntry') if @api_client.config.debugging @api_client.config.logger.debug "API called: DownloadsApi#get_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end