
Arista CloudVision ChangeControl
CertifiedEnterprise EditionCreate, approve, execute and wait for a CloudVision change control
Arista CloudVision ChangeControl
Create, approve, execute and wait for a CloudVision change control
Groups CloudVision tasks (from GetTasks, Configlet or ImageBundle outputs) in a change control and drives it. One action per task run, so a flow can put its own checks between them.
CREATE: creates a change control runningtaskIdsin series. The id ischangeControlId, or derived fromname. When a change control with that id exists and runs the sametaskIds, it is returned (createdfalse) so a retry never creates a second one. When it runs other tasks the task fails withChangeControlConflict, for example when a fixednameis reused by a later run.APPROVE: approves it. Nothing is sent when it is already approved. CloudVision may refuse the approval by the account that created the change control, according to your approval policy: the error is returned as is.EXECUTE: starts it, never twice. When the change control is no longerPENDINGorAPPROVED(CloudVision statusRUNNING,COMPLETEDor cancelled), nothing is sent andalreadyExecutedis true. The call returns once the change control has started: useWAITfor the result.WAIT: polls everypollIntervaluntilCOMPLETED,FAILED(completed with anerror) orCANCELLED, and fails aftertimeout. Returns at once when it already ended, so it can run alone with achangeControlIdafter a worker restart.
With failOnError (default), WAIT throws ChangeControlFailed when the change control ends in FAILED or CANCELLED.
Do not set a task level retry on EXECUTE: it does not filter by error type.
type: io.kestra.plugin.ee.arista.cvp.ChangeControlExamples
Assign a configlet, then create, approve, execute a change control and wait for it
id: arista_cvp_change_control
namespace: company.network
pluginDefaults:
- type: io.kestra.plugin.ee.arista.cvp
forced: false
values:
host: www.cv-prod-us-central1-b.arista.io
token: "{{ secret('CVP_TOKEN') }}"
tasks:
- id: configlet
type: io.kestra.plugin.ee.arista.cvp.Configlet
action: CREATE
name: ntp-servers
config: |
ntp server 10.0.0.1
ntp server 10.0.0.2
- id: assign
type: io.kestra.plugin.ee.arista.cvp.Configlet
action: ASSIGN
name: ntp-servers
device: leaf1
# taskIds is empty when the configlet was already assigned, there is nothing to run then
- id: if_tasks
type: io.kestra.plugin.core.flow.If
condition: "{{ outputs.assign.taskIds is not empty }}"
then:
- id: cc
type: io.kestra.plugin.ee.arista.cvp.ChangeControl
action: CREATE
name: "ntp-servers {{ execution.id }}"
taskIds: "{{ outputs.assign.taskIds }}"
- id: approve
type: io.kestra.plugin.ee.arista.cvp.ChangeControl
action: APPROVE
changeControlId: "{{ outputs.cc.changeControlId }}"
- id: execute
type: io.kestra.plugin.ee.arista.cvp.ChangeControl
action: EXECUTE
changeControlId: "{{ outputs.cc.changeControlId }}"
- id: wait
type: io.kestra.plugin.ee.arista.cvp.ChangeControl
action: WAIT
changeControlId: "{{ outputs.cc.changeControlId }}"
timeout: PT30M
Wait for an existing change control without failing the flow
id: arista_cvp_wait_change_control
namespace: company.network
inputs:
- id: change_control_id
type: STRING
tasks:
- id: wait
type: io.kestra.plugin.ee.arista.cvp.ChangeControl
host: cvp.lab.example.com
token: "{{ secret('CVP_TOKEN') }}"
caCertificate: "{{ secret('CVP_CA_PEM') }}"
action: WAIT
changeControlId: "{{ inputs.change_control_id }}"
pollInterval: PT30S
failOnError: false
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-arista --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.
Properties
action *string
CREATEAPPROVEEXECUTEWAITAction
CREATE, APPROVE, EXECUTE or WAIT.
host *string
CloudVision host
Host name or IP address of CloudVision. Use www.cv-prod-<region>.arista.io for CVaaS or the address of your on-prem CVP.
assets
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150authType string
SERVICE_ACCOUNT_TOKENUSER_PASSWORDAuthentication type
SERVICE_ACCOUNT_TOKEN (default, CVaaS and on-prem) sends token as a bearer token.
USER_PASSWORD (on-prem only) logs in with username and password, reuses the session cookie for the task run and logs out at the end.
caCertificate string
CA certificate
PEM encoded CA certificate(s) used to validate the CloudVision certificate. When set, only this CA is trusted. When empty, the JVM trust store is used. An on-prem CVP with a self-signed certificate needs this property.
changeControlId string
Change control id
Required for APPROVE, EXECUTE and WAIT. For CREATE, the id to give to the new change control, derived from name by default.
connectTimeout string
Connect timeout
Maximum time to open the connection. Must be greater than zero. Defaults to 10 seconds.
failOnError booleanstring
Fail on error
WAIT only. Fails the task when the change control ends in FAILED or CANCELLED. Defaults to true.
insecureTrustAllCertificates booleanstring
Trust any certificate
Disables certificate and host name validation. Only for labs with self-signed certificates. Defaults to false.
name string
Change control name
Required for CREATE. Also the idempotency key: the change control id is derived from this name when changeControlId is not set. Use a name that is unique per run, for example with {{ execution.id }}, or CREATE fails once a change control with that name runs other tasks.
password string
Password
Required for USER_PASSWORD. Use {{ secret('CVP_PASSWORD') }}. The value is never logged nor returned in outputs.
pollInterval string
Poll interval
WAIT only. Time between two status reads. At least 1 second. Defaults to 10 seconds.
port integerstring
Port
Between 1 and 65535. Defaults to 443.
requestTimeout string
Request timeout
Maximum time to wait for one CloudVision answer. Must be greater than zero. Defaults to 60 seconds.
taskIds array
Task ids
CloudVision task ids to run, in order, for CREATE. Take them from the taskIds output of Configlet or ImageBundle, or from GetTasks.
timeout string
Timeout
WAIT only. Maximum time to wait for a final status. Must be greater than zero. Defaults to 30 minutes. A change control waiting for a manual approval never ends: the timeout message gives the last known status.
token string
Service account token
Required for SERVICE_ACCOUNT_TOKEN. Use {{ secret('CVP_TOKEN') }}. The value is never logged nor returned in outputs.
username string
Username
Required for USER_PASSWORD.
Outputs
alreadyExecuted boolean
Already executed
EXECUTE only: true when the change control had already started, nothing was sent.
changeControlId string
Change control id
created boolean
Created
CREATE only: false when a change control with the same id already existed and runs the same tasks.
error string
Error
Error message reported by CloudVision, when there is one. A change control with an error is reported as FAILED.
stages array
Stages
Stages and their state, as reported by CloudVision.
io.kestra.plugin.ee.arista.cvp.ChangeControl-Stage
Stage error
Error reported by CloudVision for this stage, when there is one.
Stage id
Stage name
Stage status
State reported by CloudVision in stageStates, for example STAGE_STATE_COMPLETED. Not set while the stage has not started.
status string
PENDINGAPPROVEDRUNNINGCOMPLETEDFAILEDCANCELLEDStatus
PENDING (waiting for approval), APPROVED, RUNNING, COMPLETED, FAILED or CANCELLED.