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.10.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.10.0.gem

(for development, run gem install --dev ./pulp_npm_client-0.10.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.10.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
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.
  overwrite: true, # Boolean | When set to true, existing content in the repository with the same unique key will be silently overwritten. When set to false, the task will fail if content would be overwritten. Only used when 'repository' is specified. Defaults to true.
  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
  relative_path: 'relative_path_example', # String | Path where the artifact is located relative to distributions base_path. If not provided, it will be computed from name and version.
  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.
  downloader_config: PulpNpmClient::RemoteNetworkConfig.new, # RemoteNetworkConfig | Configuration for the download process (e.g., proxies, auth, timeouts). Only applicable when providing a 'file_url.
  name: 'name_example', # String | The name of the npm package.
  version: 'version_example' # String | The version of the npm package.
}

begin
  #Create a package
  result = api_instance.create(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::ContentPackagesApi upload POST /pulp/api/v3/content/npm/packages/upload/ Synchronous npm package upload
PulpNpmClient::DistributionsNpmApi add_role POST npm_npm_distribution_hrefadd_role/ Add a role
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 list_roles GET npm_npm_distribution_hreflist_roles/ List roles
PulpNpmClient::DistributionsNpmApi my_permissions GET npm_npm_distribution_hrefmy_permissions/ List user permissions
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 remove_role POST npm_npm_distribution_hrefremove_role/ Remove a role
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::NpmApi put PUT /npm/path/package_name
PulpNpmClient::NpmPingApi get GET /npm/path/-/ping
PulpNpmClient::NpmWhoamiApi get GET /npm/path/-/whoami
PulpNpmClient::RemotesNpmApi add_role POST npm_npm_remote_hrefadd_role/ Add a role
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 list_roles GET npm_npm_remote_hreflist_roles/ List roles
PulpNpmClient::RemotesNpmApi my_permissions GET npm_npm_remote_hrefmy_permissions/ List user permissions
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 remove_role POST npm_npm_remote_hrefremove_role/ Remove a role
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 add_role POST npm_npm_repository_hrefadd_role/ Add a role
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 list_roles GET npm_npm_repository_hreflist_roles/ List roles
PulpNpmClient::RepositoriesNpmApi modify POST npm_npm_repository_hrefmodify/ Modify Repository Content
PulpNpmClient::RepositoriesNpmApi my_permissions GET npm_npm_repository_hrefmy_permissions/ List user permissions
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 remove_role POST npm_npm_repository_hrefremove_role/ Remove a role
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