class Apcera::PackagesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = nil) click to toggle source
# File lib/apcera/api/packages_api.rb, line 7
def initialize(api_client = nil)
  @api_client = api_client || Configuration.api_client
end

Public Instance Methods

packages_dependencies_post(opts = {}) click to toggle source

Returns a list of packages that fulfill the specified dependency type and name for the specified namespace. Returns a list of packages that fulfill the specified dependency type and name for the specified namespace. @param [Hash] opts the optional parameters @option opts [PackageDependsRequest] :targetjob_resource JSON object that identifies the namespace we&#39;re resolving dependencies within, and the package dependencies that need to be fully resolved. @option opts [String] :authorization @return [Array<Package>]

# File lib/apcera/api/packages_api.rb, line 145
def packages_dependencies_post(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_dependencies_post ..."
  end
  
  
  # resource path
  path = "/packages/dependencies".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'targetjob_resource'])
  

  auth_names = ['authorization']
  result = @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 => 'Array<Package>')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_dependencies_post. Result: #{result.inspect}"
  end
  return result
end
packages_get(opts = {}) click to toggle source

Returns a list of packages on the cluster. Returns a list of packages on the cluster, optionally filtered by package name, FQN, UUID or other properties. Pagination is also supported. @param [Hash] opts the optional parameters @option opts [Array<String>] :tag List of tags. Only packages with the specified tags are returned. @option opts [Array<String>] :excluded_tags List of excluded tags. Only packages without the specified tags are returned. @option opts [Array<String>] :ids List of package UUIDs. Only packages with specifed UUIDs to return. @option opts [String] :name Local name of package to return. @option opts [String] :fqn FQN of package to return. @option opts [String] :match_partial_fqn If `true`, packages that partially match the FQN specified by `fqn` parameter are returned. If `false` (default) then `fqn` must exactly match an available package. @option opts [String] :package_id UUID of the package to return. @option opts [String] :provides_type Type of packages to return. Valid values are `os`, `package`, `runtime`, or `file`. @option opts [String] :provides_name Name that describes the packages to return. Value can be an exact package name (&#39;java-1.6&#39; or &#39;ubuntu-13.10&#39;, for example) or a generalized requirement (&#39;linux&#39;, for example). @option opts [String] :authorization @return [Array<Package>]

# File lib/apcera/api/packages_api.rb, line 25
def packages_get(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_get ..."
  end
  
  
  if opts[:'provides_type'] && !['file', 'package', 'runtime', 'os'].include?(opts[:'provides_type'])
    fail 'invalid value for "provides_type", must be one of file, package, runtime, os'
  end
  
  # resource path
  path = "/packages".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'tag'] = opts[:'tag'] if opts[:'tag']
  query_params[:'excluded_tags'] = opts[:'excluded_tags'] if opts[:'excluded_tags']
  query_params[:'ids'] = opts[:'ids'] if opts[:'ids']
  query_params[:'name'] = opts[:'name'] if opts[:'name']
  query_params[:'fqn'] = opts[:'fqn'] if opts[:'fqn']
  query_params[:'matchPartialFQN'] = opts[:'match_partial_fqn'] if opts[:'match_partial_fqn']
  query_params[:'package_id'] = opts[:'package_id'] if opts[:'package_id']
  query_params[:'provides_type'] = opts[:'provides_type'] if opts[:'provides_type']
  query_params[:'provides_name'] = opts[:'provides_name'] if opts[:'provides_name']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  result = @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<Package>')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_get. Result: #{result.inspect}"
  end
  return result
end
packages_package_uuid_resources_resource_uuid_put(package_uuid, resource_uuid, binary_data, content_digest, opts = {}) click to toggle source

Uploads a package resource for the specified package. Uploads a specific package resource to the specified package. @param package_uuid UUID of the package. @param resource_uuid UUID of the resource. @param binary_data Binary package resource (GZIP). The resource&#39;s content length and SHA must match the values specified made in a previous call to [`POST /packages`](operation–packages-post). @param content_digest @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/packages_api.rb, line 312
def packages_package_uuid_resources_resource_uuid_put(package_uuid, resource_uuid, binary_data, content_digest, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_package_uuid_resources_resource_uuid_put ..."
  end
  
  
  # verify the required parameter 'package_uuid' is set
  fail "Missing the required parameter 'package_uuid' when calling packages_package_uuid_resources_resource_uuid_put" if package_uuid.nil?
  
  # verify the required parameter 'resource_uuid' is set
  fail "Missing the required parameter 'resource_uuid' when calling packages_package_uuid_resources_resource_uuid_put" if resource_uuid.nil?
  
  # verify the required parameter 'binary_data' is set
  fail "Missing the required parameter 'binary_data' when calling packages_package_uuid_resources_resource_uuid_put" if binary_data.nil?
  
  # verify the required parameter 'content_digest' is set
  fail "Missing the required parameter 'content_digest' when calling packages_package_uuid_resources_resource_uuid_put" if content_digest.nil?
  
  # resource path
  path = "/packages/{package_uuid}/resources/{resource_uuid}".sub('{format}','json').sub('{' + 'package_uuid' + '}', package_uuid.to_s).sub('{' + 'resource_uuid' + '}', resource_uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _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/octet-stream']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'Content-Digest'] = content_digest
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(binary_data)
  

  auth_names = ['authorization']
  @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_package_uuid_resources_resource_uuid_put"
  end
  return nil
end
packages_post(pkg, opts = {}) click to toggle source

Creates a new package. Creates a new package from the provided JSON object. @param pkg An object that defines the properties of the new package. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Package]

# File lib/apcera/api/packages_api.rb, line 90
def packages_post(pkg, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_post ..."
  end
  
  
  # verify the required parameter 'pkg' is set
  fail "Missing the required parameter 'pkg' when calling packages_post" if pkg.nil?
  
  # resource path
  path = "/packages".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(pkg)
  

  auth_names = ['authorization']
  result = @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 => 'Package')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_post. Result: #{result.inspect}"
  end
  return result
end
packages_resources_uuid_get(uuid, opts = {}) click to toggle source

Downloads the specified package&#39;s binary resource. Downloads the specified package&#39;s binary resource. @param uuid UUID of the package. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/packages_api.rb, line 197
def packages_resources_uuid_get(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_resources_uuid_get ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_resources_uuid_get" if uuid.nil?
  
  # resource path
  path = "/packages/resources/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  @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)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_resources_uuid_get"
  end
  return nil
end
packages_resources_uuid_put(uuid, binary_data, opts = {}) click to toggle source

Uploads package resources for the specified package. Uploads package resources for the specified package. @param uuid UUID of the package. @param binary_data Binary package resource (GZIP). The resource&#39;s content length and SHA must match the values specified made in a previous call to [`POST /packages`](operation–packages-post). @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/packages_api.rb, line 252
def packages_resources_uuid_put(uuid, binary_data, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_resources_uuid_put ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_resources_uuid_put" if uuid.nil?
  
  # verify the required parameter 'binary_data' is set
  fail "Missing the required parameter 'binary_data' when calling packages_resources_uuid_put" if binary_data.nil?
  
  # resource path
  path = "/packages/resources/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _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/octet-stream']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(binary_data)
  

  auth_names = ['authorization']
  @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_resources_uuid_put"
  end
  return nil
end
packages_uuid_delete(uuid, opts = {}) click to toggle source

Deletes the specified package. Deletes the specified package. @param uuid UUID of the package to delete. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/packages_api.rb, line 489
def packages_uuid_delete(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_uuid_delete ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_uuid_delete" if uuid.nil?
  
  # resource path
  path = "/packages/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  @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)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_uuid_delete"
  end
  return nil
end
packages_uuid_get(uuid, opts = {}) click to toggle source

Returns the specified package. Returns the specified package. @param uuid UUID of the package. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [Package]

# File lib/apcera/api/packages_api.rb, line 376
def packages_uuid_get(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_uuid_get ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_uuid_get" if uuid.nil?
  
  # resource path
  path = "/packages/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  result = @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 => 'Package')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_uuid_get. Result: #{result.inspect}"
  end
  return result
end
packages_uuid_put(uuid, package, opts = {}) click to toggle source

Updates the specified package&#39;s properties. Updates the specified package with the properties defined in the provided package object. @param uuid UUID of the package. @param package A Package object containing the updated properties for the specified package. @param [Hash] opts the optional parameters @option opts [String] :authorization @return [nil]

# File lib/apcera/api/packages_api.rb, line 432
def packages_uuid_put(uuid, package, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_uuid_put ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_uuid_put" if uuid.nil?
  
  # verify the required parameter 'package' is set
  fail "Missing the required parameter 'package' when calling packages_uuid_put" if package.nil?
  
  # resource path
  path = "/packages/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(package)
  

  auth_names = ['authorization']
  @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_uuid_put"
  end
  return nil
end