# PulpRpmClient::ContentPackagesApi

All URIs are relative to *http://pulp*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create**](ContentPackagesApi.md#create) | **POST** /pulp/api/v3/content/rpm/packages/ | Create a package
[**list**](ContentPackagesApi.md#list) | **GET** /pulp/api/v3/content/rpm/packages/ | List packages
[**read**](ContentPackagesApi.md#read) | **GET** {rpm_package_href} | Inspect a package



## create

> AsyncOperationResponse create(relative_path, opts)

Create a package

Trigger an asynchronous task to create content,optionally create new repository version.

### Example

```ruby
# load the gem
require 'pulp_rpm_client'
# setup authorization
PulpRpmClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpRpmClient::ContentPackagesApi.new
relative_path = 'relative_path_example' # String | Path where the artifact is located relative to distributions base_path
opts = {
  artifact: 'artifact_example', # String | Artifact file representing the physical content
  file: File.new('/path/to/file'), # File | An uploaded file that may be turned into the artifact of the content unit.
  repository: 'repository_example' # String | A URI of a repository the new content unit should be associated with.
}

begin
  #Create a package
  result = api_instance.create(relative_path, opts)
  p result
rescue PulpRpmClient::ApiError => e
  puts "Exception when calling ContentPackagesApi->create: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **relative_path** | **String**| Path where the artifact is located relative to distributions base_path | 
 **artifact** | **String**| Artifact file representing the physical content | [optional] 
 **file** | **File**| An uploaded file that may be turned into the artifact of the content unit. | [optional] 
 **repository** | **String**| A URI of a repository the new content unit should be associated with. | [optional] 

### Return type

[**AsyncOperationResponse**](AsyncOperationResponse.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: multipart/form-data, application/x-www-form-urlencoded
- **Accept**: application/json


## list

> PaginatedrpmPackageResponseList list(opts)

List packages

A ViewSet for Package.  Define endpoint name which will appear in the API endpoint for this content type. For example::     http://pulp.example.com/pulp/api/v3/content/rpm/packages/  Also specify queryset and serializer for Package.

### Example

```ruby
# load the gem
require 'pulp_rpm_client'
# setup authorization
PulpRpmClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpRpmClient::ContentPackagesApi.new
opts = {
  arch: 'arch_example', # String | Filter results where arch matches value
  arch__in: ['arch__in_example'], # Array<String> | Filter results where arch is in a comma-separated list of values
  arch__ne: 'arch__ne_example', # String | Filter results where arch not equal to value
  checksum_type: 'checksum_type_example', # String | Filter results where checksum_type matches value
  checksum_type__in: ['checksum_type__in_example'], # Array<String> | Filter results where checksum_type is in a comma-separated list of values
  checksum_type__ne: 'checksum_type__ne_example', # String | Filter results where checksum_type not equal to value
  epoch: 'epoch_example', # String | Filter results where epoch matches value
  epoch__in: ['epoch__in_example'], # Array<String> | Filter results where epoch is in a comma-separated list of values
  epoch__ne: 'epoch__ne_example', # String | Filter results where epoch not equal to value
  limit: 56, # Integer | Number of results to return per page.
  name: 'name_example', # String | Filter results where name matches value
  name__in: ['name__in_example'], # Array<String> | Filter results where name is in a comma-separated list of values
  name__ne: 'name__ne_example', # String | Filter results where name not equal to value
  offset: 56, # Integer | The initial index from which to return the results.
  ordering: 'ordering_example', # String | Which field to use when ordering the results.
  pkg_id: 'pkg_id_example', # String | Filter results where pkgId matches value
  pkg_id__in: ['pkg_id__in_example'], # Array<String> | Filter results where pkgId is in a comma-separated list of values
  release: 'release_example', # String | Filter results where release matches value
  release__in: ['release__in_example'], # Array<String> | Filter results where release is in a comma-separated list of values
  release__ne: 'release__ne_example', # String | Filter results where release not equal to value
  repository_version: 'repository_version_example', # String | Repository Version referenced by HREF
  repository_version_added: 'repository_version_added_example', # String | Repository Version referenced by HREF
  repository_version_removed: 'repository_version_removed_example', # String | Repository Version referenced by HREF
  sha256: 'sha256_example', # String | 
  version: 'version_example', # String | Filter results where version matches value
  version__in: ['version__in_example'], # Array<String> | Filter results where version is in a comma-separated list of values
  version__ne: 'version__ne_example', # String | Filter results where version not equal to value
  fields: 'fields_example', # String | A list of fields to include in the response.
  exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
}

begin
  #List packages
  result = api_instance.list(opts)
  p result
rescue PulpRpmClient::ApiError => e
  puts "Exception when calling ContentPackagesApi->list: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **arch** | **String**| Filter results where arch matches value | [optional] 
 **arch__in** | [**Array&lt;String&gt;**](String.md)| Filter results where arch is in a comma-separated list of values | [optional] 
 **arch__ne** | **String**| Filter results where arch not equal to value | [optional] 
 **checksum_type** | **String**| Filter results where checksum_type matches value | [optional] 
 **checksum_type__in** | [**Array&lt;String&gt;**](String.md)| Filter results where checksum_type is in a comma-separated list of values | [optional] 
 **checksum_type__ne** | **String**| Filter results where checksum_type not equal to value | [optional] 
 **epoch** | **String**| Filter results where epoch matches value | [optional] 
 **epoch__in** | [**Array&lt;String&gt;**](String.md)| Filter results where epoch is in a comma-separated list of values | [optional] 
 **epoch__ne** | **String**| Filter results where epoch not equal to value | [optional] 
 **limit** | **Integer**| Number of results to return per page. | [optional] 
 **name** | **String**| Filter results where name matches value | [optional] 
 **name__in** | [**Array&lt;String&gt;**](String.md)| Filter results where name is in a comma-separated list of values | [optional] 
 **name__ne** | **String**| Filter results where name not equal to value | [optional] 
 **offset** | **Integer**| The initial index from which to return the results. | [optional] 
 **ordering** | **String**| Which field to use when ordering the results. | [optional] 
 **pkg_id** | **String**| Filter results where pkgId matches value | [optional] 
 **pkg_id__in** | [**Array&lt;String&gt;**](String.md)| Filter results where pkgId is in a comma-separated list of values | [optional] 
 **release** | **String**| Filter results where release matches value | [optional] 
 **release__in** | [**Array&lt;String&gt;**](String.md)| Filter results where release is in a comma-separated list of values | [optional] 
 **release__ne** | **String**| Filter results where release not equal to value | [optional] 
 **repository_version** | **String**| Repository Version referenced by HREF | [optional] 
 **repository_version_added** | **String**| Repository Version referenced by HREF | [optional] 
 **repository_version_removed** | **String**| Repository Version referenced by HREF | [optional] 
 **sha256** | **String**|  | [optional] 
 **version** | **String**| Filter results where version matches value | [optional] 
 **version__in** | [**Array&lt;String&gt;**](String.md)| Filter results where version is in a comma-separated list of values | [optional] 
 **version__ne** | **String**| Filter results where version not equal to value | [optional] 
 **fields** | **String**| A list of fields to include in the response. | [optional] 
 **exclude_fields** | **String**| A list of fields to exclude from the response. | [optional] 

### Return type

[**PaginatedrpmPackageResponseList**](PaginatedrpmPackageResponseList.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## read

> RpmPackageResponse read(rpm_package_href, opts)

Inspect a package

A ViewSet for Package.  Define endpoint name which will appear in the API endpoint for this content type. For example::     http://pulp.example.com/pulp/api/v3/content/rpm/packages/  Also specify queryset and serializer for Package.

### Example

```ruby
# load the gem
require 'pulp_rpm_client'
# setup authorization
PulpRpmClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpRpmClient::ContentPackagesApi.new
rpm_package_href = 'rpm_package_href_example' # String | 
opts = {
  fields: 'fields_example', # String | A list of fields to include in the response.
  exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
}

begin
  #Inspect a package
  result = api_instance.read(rpm_package_href, opts)
  p result
rescue PulpRpmClient::ApiError => e
  puts "Exception when calling ContentPackagesApi->read: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **rpm_package_href** | **String**|  | 
 **fields** | **String**| A list of fields to include in the response. | [optional] 
 **exclude_fields** | **String**| A list of fields to exclude from the response. | [optional] 

### Return type

[**RpmPackageResponse**](RpmPackageResponse.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json