create_swlib_directive_entity

Creates an entity of the Directive type in the Software Library. On successful creation, the entity revision appears in the specified folder on the Software Library Home page.

Format

emcli create_swlib_directive_entity
      -name="entity_name"
      -folder_id="folder_id"
      -arg="[<arg prefix>;]<arg prop name>[;<arg suffix>]"
      [-shell_type]="<shell type>"
      [-run_privileged]
      [-file="<abs/relative file path>[;<new file name>]"
      [-upload_storage="<storage location name>;<storage type>"] | [-refer_       storage="<storage location name>;<storage type>"]
      [-credential_set_name="setname"] | [-credential_name="name" -credential_owner="owner"]
      [-desc="entity_desc"]
      [-attr="<attr name>:<attr value>"]
      [-note="note text"]
      [-show_entity_rev_guid]
      [-show_cmd_line_and_exit]

[ ] indicates that the parameter is optional.

Parameters

  • name

    Name of the entity.

  • folder_id

    Folder ID where the entity is created. The Software Library Home page exposes the ID for folders and entities as a custom column (Internal ID). However, this is hidden by default.

  • arg

    Command line argument property name, specified optionally with a prefix and/or a suffix. To specify multiple arguments, repeat the option.

  • shell_type

    Shell type can be one of the following:

    • SUB_Exec - Specified in the script

    • SUB_PSUB_Bash - Basherl - Perl

    • Defaults to SUB_Perl.

  • run_privileged

    This is an option to specify whether the directive should be executed with privileged credentials or not. This is executed with normal credentials by default.

  • file

    If -upload_storage is specified, it is the absolute path of the file that is uploaded. If -refer_storage is specified, it is the relative path of the file that is referred from the storage location specified. File name stored in the Software Library after the file is upload is defaulted to the name of the file being uploaded/referred. A different file name can be specified, optionally, separated by ';'. The first file specified in the command line will be defaulted as the main file and will be executed when the directive is run.

  • host

    Target name of the host where the files are available. This should be used in conjunction with the -upload_storage option.

  • credential_set_name

    The set name of the preferred credential stored in the Management Repository for the host target. This can be one of the following:

    • HostCredsNormal - default unprivileged credential set

    • HostCredsPriv - privileged credential set

  • credential_name

    Named credential stored in the Management Repository. This option must be specified along with the -credential_owner option. This must be used in conjunction with the -upload_storage option.

  • credential_owner

    Owner of a named credential stored in the Management Repository. This option must be specified along with the -credential_name option. This must be used in conjunction with the -upload_storage option.

  • upload_storage

    Destination storage location and type for the upload, separated by ';'. The location specified must be in the 'active' status. Defaulted to storage type and location of the first upload location configured for Software Library. The storage type can be one of the following:

    • OmsShared (OMS Shared File System)

    • OmsAgent (OMS Agent File System)

  • refer_storage

    Storage location and type for referring to files, separated by ';'. The location specified must be in the 'active' status. The storage type can be one of the following:

    • http

    • NFS

    • ExtAgent

    If specified, this option takes precedence over -upload_storage option.

  • desc

    Description of the entity. The new description is visible to all existing revisions.

  • attr

    Attribute and its value is separated by ':'. To specify multiple attributes, repeat the option.

  • note

    A note about the entity. Repeat the option for multiple notes.

  • show_entity_rev_guid

    Option to enable printing of the internal GUID of the new entity revision or not.

  • show_cmd_line_and_exit

    Option to enable printing of the command line and exiting without creating a new entity revision or not.

Examples

Example 1

The following example creates a directive entity named 'myAcmeInstall' in the specified folder. The directive has one argument with a '-home' prefix and the argument value is of the 'oh_home' property. It has two script files associated with it, the first one is defaulted as the main file. The main file is executed when the directive is executed. Also, the mymodule.pm file content is saved by the name 'common.pm'. The files are accessible locally by the emcli process owner. The folder ID value can be found on the Software Library Home page. The Software Library Home page exposes the ID for folders and entities as a custom column (Internal ID). However, this is hidden by default.

emcli create_swlib_directive_entity
      -name="myAcmeInstall"
      -folder_        id="oracle:defaultService:em:provisioning:1:cat:B13B3B7B086458CFE040E80A19AA560C" 
-arg="-home :oh_home"
     -shell_type=SUB_Perl
     -file=/u01/scripts/myscript.pl
     -file=/u01/scripts/mymodule.pm;common.pm

Example 2

The following example creates a directive entity named 'myAcmeInstall' in the specified folder. The directive has one argument with a '-home' prefix and the argument value is of the 'oh_home' property. It has two script files associated with it, the first one is defaulted as the main file. The main file is executed when the directive is executed. Also, the mymodule.pm file content is saved by the name 'common.pm'. The files are retrieved from the host 'fs1.us.acme.com' using the credential identified as 'MyAcmeCreds' owned by 'ACME_USER'. The folder ID value can be found on the Software Library Home page. The Software Library Home page exposes the ID for folders and entities as a custom column (Internal ID). However, this is hidden by default.

emcli create_swlib_directive_entity
     -name="myAcmeInstall"
     -folder_id="oracle:defaultService:em:provisioning:1:cat:B13B3B7B086458CFE040E80A19AA560C"id="oracle:defaultService:em:provisioning:1:cat:B13B3B7B086458CFE040E80A19AA560C" 
     -arg="-home :oh_home"
     -shell_type=SUB_Perl
     -file=/u01/scripts/myscript.pl
     -file=/u01/scripts/mymodule.pm;common.pm
     -host="fs1.us.acme.com"  
     -credential_name="MyAcmeCreds"  
     -credential_owner="ACME_USER