# PulpcoreClient::ArtifactsApi All URIs are relative to *https://pulp* Method | HTTP request | Description ------------- | ------------- | ------------- [**create**](ArtifactsApi.md#create) | **POST** /pulp/api/v3/artifacts/ | Create an artifact [**delete**](ArtifactsApi.md#delete) | **DELETE** {artifact_href} | Delete an artifact [**list**](ArtifactsApi.md#list) | **GET** /pulp/api/v3/artifacts/ | List artifacts [**read**](ArtifactsApi.md#read) | **GET** {artifact_href} | Inspect an artifact ## create > ArtifactResponse create(file, opts) Create an artifact A customized named ModelViewSet that knows how to register itself with the Pulp API router. This viewset is discoverable by its name. \"Normal\" Django Models and Master/Detail models are supported by the ``register_with`` method. Attributes: lookup_field (str): The name of the field by which an object should be looked up, in addition to any parent lookups if this ViewSet is nested. Defaults to 'pk' endpoint_name (str): The name of the final path segment that should identify the ViewSet's collection endpoint. nest_prefix (str): Optional prefix under which this ViewSet should be nested. This must correspond to the \"parent_prefix\" of a router with rest_framework_nested.NestedMixin. None indicates this ViewSet should not be nested. parent_lookup_kwargs (dict): Optional mapping of key names that would appear in self.kwargs to django model filter expressions that can be used with the corresponding value from self.kwargs, used only by a nested ViewSet to filter based on the parent object's identity. schema (DefaultSchema): The schema class to use by default in a viewset. ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::ArtifactsApi.new file = File.new('/path/to/file') # File | The stored file. opts = { size: 56, # Integer | The size of the file in bytes. md5: 'md5_example', # String | The MD5 checksum of the file if available. sha1: 'sha1_example', # String | The SHA-1 checksum of the file if available. sha224: 'sha224_example', # String | The SHA-224 checksum of the file if available. sha256: 'sha256_example', # String | The SHA-256 checksum of the file if available. sha384: 'sha384_example', # String | The SHA-384 checksum of the file if available. sha512: 'sha512_example' # String | The SHA-512 checksum of the file if available. } begin #Create an artifact result = api_instance.create(file, opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling ArtifactsApi->create: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **file** | **File**| The stored file. | **size** | **Integer**| The size of the file in bytes. | [optional] **md5** | **String**| The MD5 checksum of the file if available. | [optional] **sha1** | **String**| The SHA-1 checksum of the file if available. | [optional] **sha224** | **String**| The SHA-224 checksum of the file if available. | [optional] **sha256** | **String**| The SHA-256 checksum of the file if available. | [optional] **sha384** | **String**| The SHA-384 checksum of the file if available. | [optional] **sha512** | **String**| The SHA-512 checksum of the file if available. | [optional] ### Return type [**ArtifactResponse**](ArtifactResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: multipart/form-data, application/x-www-form-urlencoded - **Accept**: application/json ## delete > delete(artifact_href) Delete an artifact Remove Artifact only if it is not associated with any Content. ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::ArtifactsApi.new artifact_href = 'artifact_href_example' # String | begin #Delete an artifact api_instance.delete(artifact_href) rescue PulpcoreClient::ApiError => e puts "Exception when calling ArtifactsApi->delete: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **artifact_href** | **String**| | ### Return type nil (empty response body) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined ## list > PaginatedArtifactResponseList list(opts) List artifacts A customized named ModelViewSet that knows how to register itself with the Pulp API router. This viewset is discoverable by its name. \"Normal\" Django Models and Master/Detail models are supported by the ``register_with`` method. Attributes: lookup_field (str): The name of the field by which an object should be looked up, in addition to any parent lookups if this ViewSet is nested. Defaults to 'pk' endpoint_name (str): The name of the final path segment that should identify the ViewSet's collection endpoint. nest_prefix (str): Optional prefix under which this ViewSet should be nested. This must correspond to the \"parent_prefix\" of a router with rest_framework_nested.NestedMixin. None indicates this ViewSet should not be nested. parent_lookup_kwargs (dict): Optional mapping of key names that would appear in self.kwargs to django model filter expressions that can be used with the corresponding value from self.kwargs, used only by a nested ViewSet to filter based on the parent object's identity. schema (DefaultSchema): The schema class to use by default in a viewset. ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::ArtifactsApi.new opts = { limit: 56, # Integer | Number of results to return per page. md5: 'md5_example', # String | Filter results where md5 matches 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. repository_version: 'repository_version_example', # String | Repository Version referenced by HREF sha1: 'sha1_example', # String | Filter results where sha1 matches value sha224: 'sha224_example', # String | Filter results where sha224 matches value sha256: 'sha256_example', # String | Filter results where sha256 matches value sha384: 'sha384_example', # String | Filter results where sha384 matches value sha512: 'sha512_example', # String | Filter results where sha512 matches 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 artifacts result = api_instance.list(opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling ArtifactsApi->list: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **Integer**| Number of results to return per page. | [optional] **md5** | **String**| Filter results where md5 matches 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] **repository_version** | **String**| Repository Version referenced by HREF | [optional] **sha1** | **String**| Filter results where sha1 matches value | [optional] **sha224** | **String**| Filter results where sha224 matches value | [optional] **sha256** | **String**| Filter results where sha256 matches value | [optional] **sha384** | **String**| Filter results where sha384 matches value | [optional] **sha512** | **String**| Filter results where sha512 matches 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 [**PaginatedArtifactResponseList**](PaginatedArtifactResponseList.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## read > ArtifactResponse read(artifact_href, opts) Inspect an artifact A customized named ModelViewSet that knows how to register itself with the Pulp API router. This viewset is discoverable by its name. \"Normal\" Django Models and Master/Detail models are supported by the ``register_with`` method. Attributes: lookup_field (str): The name of the field by which an object should be looked up, in addition to any parent lookups if this ViewSet is nested. Defaults to 'pk' endpoint_name (str): The name of the final path segment that should identify the ViewSet's collection endpoint. nest_prefix (str): Optional prefix under which this ViewSet should be nested. This must correspond to the \"parent_prefix\" of a router with rest_framework_nested.NestedMixin. None indicates this ViewSet should not be nested. parent_lookup_kwargs (dict): Optional mapping of key names that would appear in self.kwargs to django model filter expressions that can be used with the corresponding value from self.kwargs, used only by a nested ViewSet to filter based on the parent object's identity. schema (DefaultSchema): The schema class to use by default in a viewset. ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::ArtifactsApi.new artifact_href = 'artifact_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 an artifact result = api_instance.read(artifact_href, opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling ArtifactsApi->read: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **artifact_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 [**ArtifactResponse**](ArtifactResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json