## zowe › endevor › retrieve › element

The retrieve element command retrieves an existing element in Endevor.

#### Usage

zowe endevor retrieve element <element> [options]

#### Positional Arguments

- `element` (string)

  - Name of the Endevor element.

#### endevor-location definition options

- `--environment` | `--env` (string)

  - The Endevor environment where your project resides.

- `--system` | `--sys` (string)

  - The Endevor system where your project resides.

- `--subsystem` | `--sub` (string)

  - The Endevor subsystem where your project resides.

- `--type` | `--typ` (string)

  - Name of the Endevor element's type.

- `--stage-number` | `--sn` (string)

  - The Endevor stage number where your project resides.

    Allowed values: \*, \%, 1, 2

- `--ccid` | `--cci` (string)

  - The CCID you want to use when performing an Element action.

- `--comment` | `--com` (string)

  - The comment you want to have when performing an Element action

- `--maxrc` (number)

  - The maximum value of the return code of a successful action. When the return code is greater than the maxrc value, the command fails

    Default value: 8

- `--instance` | `-i` (string)

  - Specifies Endevor Web Services dataSource name.

#### options

- `--element-version` | `--ev` (number)

  - Indicates the version number of the element (use along with the level option).

- `--level` | `--lev` (number)

  - Indicates the level number of the element (use along with the version option).

- `--override-signout` | `--os` (boolean)

  - Specify if you want to override the Signout of an Endevor element while performing this action.

- `--signout` (boolean)

  - Specify if you want to perform the action with signing the element out.

- `--replace-member` | `--replace` | `--rm` (boolean)

  - Specify if you want to replace the member currently in the library with the new element contents

- `--expand-includes` | `--expand` | `--ei` (boolean)

  - Indicates that INCLUDE statements should be expanded in the course of the action.

- `--search` | `--sea` (boolean)

  - Enables the search through the Endevor map.

- `--get-fingerprint` | `--gfg` (boolean)

  - Return fingerprint of a retrieved, added or updated element as the first line of the response.

    Default value: false

- `--where-ccid-all` | `--wca` (string)

  - Instructs Endevor to search both the Master Control File and the SOURCE DELTA levels for a specified CCIDs.
    Accepts up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--where-ccid-current` | `--wcc` (string)

  - Instructs Endevor to search through the CCID fields in the Master Control File to find a specified CCIDs.
    Accept up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--where-ccid-retrieve` | `--wcr` (string)

  - Instructs Endevor to use the CCID in the Master Control File RETRIEVE CCID field.
    Accepts up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--where-proc-group` | `--wpg` (string)

  - Lets you select Elements according to a specified Processor group. You can use a wildcard when specifying the Processor group name.
    Accepts up to 8 Processor group names separated by ", ".

- `--charset` | `--char` (string)

  - Specifies the clients preferred character set when retrieving, printing or updating elements.

    Default value: false

#### output location options

- `--to-path` | `--tp` (string)

  - Provide a USS path to a destination location.

- `--to-uss-file` | `--tuf` (string)

  - Provide a USS file as a destination file.

- `--to-dataset` | `--td` (string)

  - Provide a destination data set name.

- `--to-member` | `--tm` (string)

  - Provide a destination member name inside the data set.

#### output customization options

- `--to-file` | `--tf` (string)

  - The file name in which the data from the command output is stored

- `--suppress-messages` | `--sm` (boolean)

  - Suppress all [INFO]/[WARN] messages from terminal output.

- `--report-file` | `--file-name` (string)

  - File name for saving reports from Endevor SCM locally.

- `--report-dir` (string)

  - Directory for saving reports from Endevor SCM locally, if --report-file wasn't specified. Defaults to current directory.

- `--write-report` (boolean)

  - Write the endevor reports to a file. By default, when return code is 0, no report will be written, unless this option is specified. When return code is bigger than 0, reports will be written to a file, unless this option is specifed to be false

#### bulk action options

- `--to-dir` | `--tdir` (string)

  - Directory name in which the command output will be stored.

- `--flat` (boolean)

  - Store the output of the bulk action within one folder. When you use this option, ensure that the results do not contain duplicate names. (Duplicate names occur when two or more Elements have the same name and type.)

- `--with-dependencies` | `--wd` (boolean)

  - Retrieve Elements, including their Endevor-managed input components.

- `--where-ccid-generate` | `--wcg` (string)

  - Instructs Endevor to search using the generate CCID associated with an Element.
    Accepts up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--where-ccid-lastact` | `--wcla` (string)

  - Instructs Endevor to search using the last action CCID associated with an Element.
    Accepts up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--where-ccid-lastlvl` | `--wcll` (string)

  - Instructs Endevor to search using the last level CCID associated with an Element.
    Accepts up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--where-ccid-change` | `--wcchg` (string)

  - This option is only valid when the data option is ele or comp. Instructs Endevor to filter the results of the list data summary function that is based on the specified ccids.
    Accepts up to 8 CCIDs separated by ", ". Enclose CCIDs that contain special characters in quotes.

- `--file-extension` | `--ext` (string)

  - The strategy for deciding what file extension to use during a bulk retrieve or workspace synchronization. Must be one of the following:

          none: File name is equal to element name, no extension is added.

          file\-ext: The file extension defined in the Type definition is used; If not defined, no extension is added.

          type\-name: The type name is used as the file extension.

          mixed: The file extension defined in Type definition is used; If not defined, the type name is used instead.

    Default value: mixed
    Allowed values: none, file-ext, type-name, mixed

#### endevor session definition options

- `--host` | `--hostname` (string)

  - Specifies the base host name.

- `--port` | `-p` (string)

  - Specifies the port number.

- `--protocol` | `--prot` (string)

  - Specifies the protocol used for connecting to Endevor Rest API

    Default value: https
    Allowed values: http, https

- `--user` | `--username` (string)

  - Specifies the user name.

- `--password` | `--pass` (string)

  - Specifies the user's password.

- `--reject-unauthorized` | `--ru` (boolean)

  - Specify this option to have the server certificate verified against the list of supplied CAs

- `--base-path` | `--bp` (string)

  - Specifies the base path used for connecting to Endevor Rest API

#### Profile Options

- `--endevor-profile` | `--endevor-p` (string)

  - The name of a (endevor) profile to load for this command execution.

- `--endevor-location-profile` | `--endevor-location-p` (string)

  - The name of a (endevor-location) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Response Format Options

- `--response-format-filter` | `--rff` (array)

  - Filter (include) fields in the response. Accepts an array of field/property names to include in the output response. You can filter JSON objects properties OR table columns/fields. In addition, you can use this option in conjunction with '--response-format-type' to reduce the output of a command to a single field/property or a list of a single field/property.

- `--response-format-type` | `--rft` (string)

  - The command response output format type. Must be one of the following:

    table: Formats output data as a table. Use this option when the output data is an array of homogeneous JSON objects. Each property of the object will become a column in the table.

    list: Formats output data as a list of strings. Can be used on any data type (JSON objects/arrays) are stringified and a new line is added after each entry in an array.

    object: Formats output data as a list of prettified objects (or single object). Can be used in place of "table" to change from tabular output to a list of prettified objects.

    string: Formats output data as a string. JSON objects/arrays are stringified.

    Allowed values: table, list, object, string

- `--response-format-header` | `--rfh` (boolean)

  - If "--response-format-type table" is specified, include the column headers in the output.

#### Examples

- Retrieve element from specified inventory location to local file with endevor profile set up:

  - `zowe endevor retrieve element elementName --env ENVNAME --sn 1 --sys SYSNAME --sub SUBNAME --typ TYPENAME --tf localfile.txt -i ENDEVOR`

- Bulk Retrieve elements with wildcarded element name and type, to local directory with endevor profile set up:

  - `zowe endevor retrieve element "*" --env ENVNAME --sn 1 --sys SYSNAME --sub SUBNAME --typ "*" --to-dir /user/localdir -i ENDEVOR`