pulp_npm_client

PulpNpmClient - the Ruby gem for the Pulp 3 API

Fetch, Upload, Organize, and Distribute Software Packages

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v3
  • Package version: 0.4.0
  • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://pulpproject.org

Installation

Build a gem

To build the Ruby code into a gem:

gem build pulp_npm_client.gemspec

Then either install the gem locally:

gem install ./pulp_npm_client-0.4.0.gem

(for development, run gem install --dev ./pulp_npm_client-0.4.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'pulp_npm_client', '~> 0.4.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'pulp_npm_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'pulp_npm_client'

# Setup authorization
PulpNpmClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR_USERNAME'
  config.password = 'YOUR_PASSWORD'
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = PulpNpmClient::ContentPackagesApi.new
relative_path = 'relative_path_example' # String | 
name = 'name_example' # String | 
version = 'version_example' # String | 
opts = {
  x_task_diagnostics: ['inner_example'], # Array<String> | List of profilers to use on tasks.
  repository: 'repository_example', # String | A URI of a repository the new content unit should be associated with.
  pulp_labels: { key: 'inner_example'}, # Hash<String, String> | A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
  artifact: 'artifact_example', # String | Artifact file representing the physical content
  file: File.new('/path/to/some/file'), # File | An uploaded file that may be turned into the content unit.
  upload: 'upload_example', # String | An uncommitted upload that may be turned into the content unit.
  file_url: 'file_url_example' # String | A url that Pulp can download and turn into the content unit.
}

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

Documentation for API Endpoints

All URIs are relative to http://localhost:24817

Class Method HTTP request Description
PulpNpmClient::ContentPackagesApi create POST /pulp/api/v3/content/npm/packages/ Create a package
PulpNpmClient::ContentPackagesApi list GET /pulp/api/v3/content/npm/packages/ List packages
PulpNpmClient::ContentPackagesApi read GET npm_package_href Inspect a package
PulpNpmClient::ContentPackagesApi set_label POST npm_package_hrefset_label/ Set a label
PulpNpmClient::ContentPackagesApi unset_label POST npm_package_hrefunset_label/ Unset a label
PulpNpmClient::DistributionsNpmApi create POST /pulp/api/v3/distributions/npm/npm/ Create a npm distribution
PulpNpmClient::DistributionsNpmApi delete DELETE npm_npm_distribution_href Delete a npm distribution
PulpNpmClient::DistributionsNpmApi list GET /pulp/api/v3/distributions/npm/npm/ List npm distributions
PulpNpmClient::DistributionsNpmApi partial_update PATCH npm_npm_distribution_href Update a npm distribution
PulpNpmClient::DistributionsNpmApi read GET npm_npm_distribution_href Inspect a npm distribution
PulpNpmClient::DistributionsNpmApi set_label POST npm_npm_distribution_hrefset_label/ Set a label
PulpNpmClient::DistributionsNpmApi unset_label POST npm_npm_distribution_hrefunset_label/ Unset a label
PulpNpmClient::DistributionsNpmApi update PUT npm_npm_distribution_href Update a npm distribution
PulpNpmClient::RemotesNpmApi create POST /pulp/api/v3/remotes/npm/npm/ Create a npm remote
PulpNpmClient::RemotesNpmApi delete DELETE npm_npm_remote_href Delete a npm remote
PulpNpmClient::RemotesNpmApi list GET /pulp/api/v3/remotes/npm/npm/ List npm remotes
PulpNpmClient::RemotesNpmApi partial_update PATCH npm_npm_remote_href Update a npm remote
PulpNpmClient::RemotesNpmApi read GET npm_npm_remote_href Inspect a npm remote
PulpNpmClient::RemotesNpmApi set_label POST npm_npm_remote_hrefset_label/ Set a label
PulpNpmClient::RemotesNpmApi unset_label POST npm_npm_remote_hrefunset_label/ Unset a label
PulpNpmClient::RemotesNpmApi update PUT npm_npm_remote_href Update a npm remote
PulpNpmClient::RepositoriesNpmApi create POST /pulp/api/v3/repositories/npm/npm/ Create a npm repository
PulpNpmClient::RepositoriesNpmApi delete DELETE npm_npm_repository_href Delete a npm repository
PulpNpmClient::RepositoriesNpmApi list GET /pulp/api/v3/repositories/npm/npm/ List npm repositorys
PulpNpmClient::RepositoriesNpmApi modify POST npm_npm_repository_hrefmodify/ Modify Repository Content
PulpNpmClient::RepositoriesNpmApi partial_update PATCH npm_npm_repository_href Update a npm repository
PulpNpmClient::RepositoriesNpmApi read GET npm_npm_repository_href Inspect a npm repository
PulpNpmClient::RepositoriesNpmApi set_label POST npm_npm_repository_hrefset_label/ Set a label
PulpNpmClient::RepositoriesNpmApi sync POST npm_npm_repository_hrefsync/ Sync from remote
PulpNpmClient::RepositoriesNpmApi unset_label POST npm_npm_repository_hrefunset_label/ Unset a label
PulpNpmClient::RepositoriesNpmApi update PUT npm_npm_repository_href Update a npm repository
PulpNpmClient::RepositoriesNpmVersionsApi delete DELETE npm_npm_repository_version_href Delete a repository version
PulpNpmClient::RepositoriesNpmVersionsApi list GET npm_npm_repository_hrefversions/ List repository versions
PulpNpmClient::RepositoriesNpmVersionsApi read GET npm_npm_repository_version_href Inspect a repository version
PulpNpmClient::RepositoriesNpmVersionsApi repair POST npm_npm_repository_version_hrefrepair/

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication