class NexusCli::ProRemote
Public Instance Methods
get_license_info()
click to toggle source
# File lib/nexus_cli/remote/pro_remote.rb, line 12 def get_license_info response = nexus.get(nexus_url("service/local/licensing"), :header => DEFAULT_ACCEPT_HEADER) case response.status when 200 return response.content else raise UnexpectedStatusCodeException.new(response.status) end end
install_license(license_file)
click to toggle source
# File lib/nexus_cli/remote/pro_remote.rb, line 22 def install_license(license_file) file = File.read(File.expand_path(license_file)) response = nexus.post(nexus_url("service/local/licensing/upload"), :body => file, :header => {"Content-Type" => "application/octet-stream"}) case response.status when 201 return true when 403 raise LicenseInstallFailure else raise UnexpectedStatusCodeException.new(response.status) end end
install_license_bytes(bytes)
click to toggle source
# File lib/nexus_cli/remote/pro_remote.rb, line 35 def install_license_bytes(bytes) response = nexus.post(nexus_url("service/local/licensing/upload"), :body => bytes, :header => {"Content-Type" => "application/octet-stream"}) case response.status when 201 return true when 403 raise LicenseInstallFailure else raise UnexpectedStatusCodeException.new(response.status) end end
transfer_artifact(artifact, from_repository, to_repository)
click to toggle source
# File lib/nexus_cli/remote/pro_remote.rb, line 47 def transfer_artifact(artifact, from_repository, to_repository) do_transfer_artifact(artifact, from_repository, to_repository) configuration["repository"] = sanitize_for_id(from_repository) from_artifact_metadata = get_custom_metadata_hash(artifact) configuration["repository"] = sanitize_for_id(to_repository) to_artifact_metadata = get_custom_metadata_hash(artifact) do_update_custom_metadata(artifact, from_artifact_metadata, to_artifact_metadata) end