update_swlib_directive_entity

Modifies an entity of the Directive type in the Software Library. A new revision of the entity is created by default.

Format

emcli update_swlib_directive_entity
      -entity_rev_id="entity_rev_id"
      [-arg]="[<arg prefix>;]<arg prop name>[;<arg suffix>]"
      [-shell_type]="<shell type>"
      -[not_]run_privileged
      -file="<abs/relative file path>[;<new file name>]" | [-removefile="<existing file name>"]
      [-upload_storage="<storage location name>;<storage type>"] | [-refer_ storage="<storage location name>;<storage type>"]
      [[-host="hostname"]
      [-credential_set_name="setname"] | [-credential_name="name" -credential_owner="owner"]
      [-desc="entity_desc"]
      [-attr="<attr name>:<attr value>"]
      [-note="note text"]
      [-use_latest_revision]
      [-show_entity_rev_guid]
      [-show_cmd_line_and_exit]

[ ] indicates that the parameter is optional.

Parameters

  • entity_rev_id

    Identifier of the entity revision. 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_Perl - Perl

    • SUB_Bash - Bash

      Default value is SUB_Bash - Bash.

  • run_privileged

    This is an option to specify whether the directive should be executed with privileged credentials or not. Will be 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 uploaded 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.

  • removefile

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

    • ALL - to remove all existing files

    • NONE - to retain all carried forward files

      Default value is NONE.

  • 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

      This should be used in conjunction with upload_storage option.

  • 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 the -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.

  • use_latest_revision

    An option to indicate whether the latest revision of the entity should be updated or the revision identified by the entity_rev_id.

  • 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.

Example

The following example modifies a directive entity identified by entity_rev_id. The entity revision ID value can be found from the Software Library Home page. The Software Library Home page exposes the ID for folders and entities, as a custom column. However, this is hidden by default.

emcli update_swlib_directive_entity
     -entity_rev_id="oracle:defaultService:em:provisioning:1:cmp:COMP_        Directives:none:06865A85D99C5340E0530AD5F00A4E0F:0.6"
     -arg="-home :oh_home"
     -shell_type=SUB_Perl
     -file=/u01/scripts/myscript.pl
     -file=/u01/scripts/mymodule.pm;common.pm