upload_swlib_entity_files

Uploads one or more files to an entity revision in the software library.

Format

emcli upload_swlib_entity_files 
        -entity_rev_id="entity_rev_id" 
        -file="<abs_file_path>[;<new_file_name>]" | [-removefile="<existing_
          file_name>"]
        -host="hostname" 
        [-credential_set_name="setname"] | [-credential_name="name" 
          -credential_owner="owner"] 
        [-upload_storage="<storage_location_name>;<storage_type>"] 
        [-use_latest_revision] 

[ ]  indicates that the parameter is optional

Options

  • entity_rev_id

    Identifier of the entity revision. The software library home page exposes the identifier for folders and entities as a custom column (Internal ID), and is hidden by default.

  • file

    Absolute path of the file to be uploaded. The file name stored in the software library on upload defaults to the name of the file being uploaded. You can optionally specify a different file name, separated by a semicolon ( ; ).

  • removefile

    Name of the file to be removed. This is an existing file carried forward from the specified entity revision.Alternatively, you can specify the following values:

    • ALL — Remove all existing files (no carry forward).
    • NONE — Retain all carried forward files.

    The default is NONE.

  • host

    Target name of the host where the files are available.

  • credential_set_name

    Set name of the preferred credential stored in the repository for the host target, which can be one of: HostCredsNormal — Default unprivileged credential set HostCredsPriv — Privileged credential set

  • credential_name

    Name of a named credential stored in the repository. You must specify this option along with the credential_owner option.

  • credential_owner

    Owner of a named credential stored in the repository. You must specify this option along with the credential_name option.

  • upload_storage

    Destination storage location and type for the upload, separated by a semicolon ( ; ). The location specified must be in 'active' status. This defaults to the storage type and location of the first upload location configured for the software library.

    The storage type can be one of:

    OmsShared — OMS shared file system

    OmsAgent — OMS Agent file system

  • use_latest_revision

    Flag indicating that the upload should occur to the latest revision of the entity instead of the revision identified by entity_rev_id.

Examples

Example 1

This example uploads the file '/u01/acme_downloads/file1.zip' to the entity revision identified. The file present on the host 'fs1.us.acme.com' should be accessible using the preferred credential set for the 'HostCredsNormal' credential set for the user logged in to EM CLI. The host must be a managed host target in Enterprise Manager, and the Agent on this host must be up and running.

emcli upload_swlib_entity_files 
        -entity_rev_id="oracle:defaultService:em:provisioning:1:
          cmp:COMP_Component:SUB_Generic:
          B1B1880C6A8C62AAE040548C42832D14:0.1" 
        -file="/u01/acme_downloads/file1.zip"  
        -host="fs1.us.acme.com"  
        -credential_set_name="HostCredsNormal"  

Example 2

This example uploads the files to the specified entity revision. The file present on the host 'fs1.us.acme.com' should be accessible using the credential named 'MyAcmeCreds' owned by 'ACME_USER'. File '/u01/acme_downloads/file1.zip' after upload will be associated with the entity revision as 'newfile1.zip'. A new revision will be created from the latest revision of the entity.

emcli upload_swlib_entity_files 
        -entity_rev_id="oracle:defaultService:em:provisioning:1:
           cmp:COMP_Component:SUB_Generic:
           B1B1880C6A8C62AAE040548C42832D14:0.1" 
        -file="/u01/acme_downloads/file1.zip;newfile1.zip"  
        -file="/u01/acme_downloads/file2.zip"  
        -host="fs1.us.acme.com"  
        -credential_name="MyAcmeCreds"  
        -credential_owner="ACME_USER"  
        -use_latest_revision