Skip to content

Ansible Module: nokia.nsp.upload

Upload files to Nokia NSP

Notes

Requires ansible.netcommon.httpapi connection using Network OS nokia.nsp.nsp.

Synopsis

  • Upload binary or text files to Nokia NSP servers.
  • Uses NSP file-service endpoint for uploads.
  • Handles single and multiple file uploads.

Parameters

Parameter Type Comments
local_path list Path to local file(s) to upload.
Can be a string for single file or list for batch uploads.
File(s) must exist and be readable.
Required: always
remote_path str Remote directory on NSP file-service to upload files to.
If this is a directory, filenames from local_path are used.
Required: always
overwrite bool Whether to overwrite existing files on NSP file-service.
Default: true

Examples

- name: Upload single file
  nokia.nsp.upload:
    local_path: /tmp/router.cfg
    remote_path: /nokia/nsp

# Upload multiple files
- name: Upload multiple files
  nokia.nsp.upload:
    local_path:
      - /tmp/test_upload_A.txt
      - /tmp/test_upload_B.txt
    remote_path: /nokia

Return Values

Parameter Type Comments
local_path str Source file path
Returned: always
Sample: "/tmp/workflow.json"
remote_path str Remote path or directory on NSP file-service
Returned: always
Sample: "/workflows"
remote_filename str Remote filename used for upload
Returned: when local_path is a single file
Sample: "workflow.json"
url str Upload endpoint URL (file-service)
Returned: always
Sample: "/nsp-file-service-app/rest/api/v1/file/uploadFile?dirName=%2Fworkflows&overwrite=true"
response raw Server response data
Returned: always
Sample: {"status":"success"}
results list List of per-file results when local_path is a list
Returned: when local_path is a list
Sample: []

New in version "0.1.0"