# PulpAnsibleClient::AnsibleCollectionsApi All URIs are relative to *http://localhost:24817* Method | HTTP request | Description ------------- | ------------- | ------------- [**create**](AnsibleCollectionsApi.md#create) | **POST** /ansible/collections/ | Create a collection version ## create > AsyncOperationResponse create(relative_path, opts) Create a collection version Trigger an asynchronous task to create content,optionally create new repository version. ### Example ```ruby # load the gem require 'pulp_ansible_client' # setup authorization PulpAnsibleClient.configure do |config| # Configure HTTP basic authorization: Basic config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpAnsibleClient::AnsibleCollectionsApi.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 should 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. expected_name: 'expected_name_example', # String | The expected 'name' of the Collection to be verified against the metadata during import. expected_namespace: 'expected_namespace_example', # String | The expected 'namespace' of the Collection to be verified against the metadata during import. expected_version: 'expected_version_example' # String | The expected version of the Collection to be verified against the metadata during import. } begin #Create a collection version result = api_instance.create(relative_path, opts) p result rescue PulpAnsibleClient::ApiError => e puts "Exception when calling AnsibleCollectionsApi->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 should 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] **expected_name** | **String**| The expected 'name' of the Collection to be verified against the metadata during import. | [optional] **expected_namespace** | **String**| The expected 'namespace' of the Collection to be verified against the metadata during import. | [optional] **expected_version** | **String**| The expected version of the Collection to be verified against the metadata during import. | [optional] ### Return type [**AsyncOperationResponse**](AsyncOperationResponse.md) ### Authorization [Basic](../README.md#Basic) ### HTTP request headers - **Content-Type**: multipart/form-data, application/x-www-form-urlencoded - **Accept**: application/json