Cisco IOS-XE Facts

Cisco IOS-XE Facts

Certified
Enterprise Edition

Read the facts of a Cisco IOS-XE device

Returns the running version, model, boot mode (INSTALL or BUNDLE), install packages and their state (I inactive, U activated and uncommitted, C activated and committed, D deactivated), the auto-abort timer, the restart time and the bootflash capacity.

The CLI form is built from show version, show install summary, show boot and dir bootflash: . Stacks and StackWise Virtual pairs are rejected. With transport: RESTCONF the same values come from the YANG oper models.

yaml
type: io.kestra.plugin.ee.cisco.iosxe.Facts

Read the facts of a core switch

yaml
id: cisco_iosxe_facts
namespace: company.network

tasks:
  - id: facts
    type: io.kestra.plugin.ee.cisco.iosxe.Facts
    host: core1.example.net
    username: automation
    password: "{{ secret('CISCO_PASSWORD') }}"
    enableSecret: "{{ secret('CISCO_ENABLE_SECRET') }}"
    hostKeyFingerprint: "{{ secret('CORE1_HOST_KEY_FINGERPRINT') }}"

  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.facts.version }} in {{ outputs.facts.bootMode }} mode"

Read the facts over RESTCONF

yaml
id: cisco_iosxe_facts_restconf
namespace: company.network

tasks:
  - id: facts
    type: io.kestra.plugin.ee.cisco.iosxe.Facts
    host: core1.example.net
    username: automation
    password: "{{ secret('CISCO_PASSWORD') }}"
    hostKeyFingerprint: "{{ secret('CORE1_HOST_KEY_FINGERPRINT') }}"
    transport: RESTCONF
    restconf:
      caPem: "{{ secret('CORE1_CA_PEM') }}"
Installation

This Enterprise plugin requires an Enterprise image and access to the plugin registry. Install it with the following command:

kestractl plugins get io.kestra.plugin.ee:plugin-ee-cisco --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties

Device host name or IP address

Username

The account must have privilege 15, or an enableSecret to reach it.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
DefaultPT2M

Default timeout of a single command

1 second to 1 hour, default 2 minutes. Tasks that run long operations (copy, install) have their own timeout properties.

DefaultPT30S

TCP and SSH connect timeout

1 second to 5 minutes, default 30 seconds.

Defaultfalse

Disable SSH host key verification

Explicit opt-out: the device identity is no longer verified, which exposes the credentials to a man-in-the-middle. Use for labs only.

Enable secret

Used to enter privileged EXEC mode when the login lands in user EXEC mode (host> prompt).

SHA256 fingerprint of the device SSH host key

Format SHA256: abc..., as printed by ssh-keygen -lf. Host key verification is on by default, so this property is required unless disableHostKeyVerification is true. Cisco IOS-XE offers RSA host keys.

Password

Required unless privateKey is set.

Default22

SSH port

1 to 65535, default 22.

SSH private key

PEM content of the private key. Used instead of password when set.

Passphrase of the private key

Reads are made over RESTCONF only when this task asks for it.

Definitions

RESTCONF is read-only and HTTPS only; the device certificate is always verified. Device prerequisites: restconf, ip http secure-server, AAA (aaa new-model with login and exec authorization) and a privilege-15 user. Use the device CA in caPem when its certificate is self-signed, and a host name that matches the certificate.

caPemstring

CA certificate in PEM format

Trusted instead of the system trust store. Certificate verification cannot be disabled.

passwordstring

Password

Defaults to the task password. Required when the task logs in with a private key.

portintegerstring
Default443

HTTPS port

1 to 65535, default 443.

timeoutstring
DefaultPT30S

Request timeout

1 second to 10 minutes, default 30 seconds.

usernamestring

Username

Defaults to the task username.

DefaultSSH
Possible Values
SSHRESTCONF

Transport used to read the device

SSH parses CLI output and is the default. RESTCONF reads structured data from the Cisco-IOS-XE YANG models and is not affected by CLI output changes between releases; configure restconf for it. A field that the device does not expose over RESTCONF is read from the CLI instead, so SSH credentials are still required. Outputs are the same with both transports.

State of the install auto-abort timer

Definitions
activeboolean
Defaultfalse

Whether an auto-abort timer is running

remainingstring
Formatduration

Time left before the device rolls back on its own, when the timer is active

Possible Values
INSTALLBUNDLE

INSTALL or BUNDLE

BOOT variable that applies on next reload

Bootflash capacity

Definitions
freeBytesinteger
Default0

Free space on bootflash in bytes

totalBytesinteger
Default0

Total size of bootflash in bytes

Boot time in epoch seconds

Exact over RESTCONF (ISO boot-time) and over the CLI when the device prints its restart time in UTC or GMT. Otherwise derived from the device uptime and the worker clock, with a precision of about one minute: the uptime has a one minute resolution and the zone abbreviation of the device clock is ambiguous.

Device host name

Reason of the last reload

Chassis model, e.g. C9500-24Y4C

Install packages and their state

Definitions
statestring
Possible Values
IUCD

Install state: I inactive, U activated and uncommitted, C activated and committed, D deactivated and uncommitted

typestring

Package type, e.g. IMG

versionstring

Package version as reported by the device

Time of the last restart as reported by the device

Image the device booted from, e.g. bootflash: packages.conf

Running software version, normalised (17.09.04a becomes 17.9.4a)