Skip to content

Commit

Permalink
arista/configstatus.v1: Add new config source type
Browse files Browse the repository at this point in the history
Add config source type for config snippets coming in from
the hierarchies workflow.

Change-Id: I288de92b76ac9fba7f9155f1b2a7562dd6517982
  • Loading branch information
Meher Anand committed Sep 13, 2024
1 parent eb093cb commit 37f77d3
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 116 deletions.
4 changes: 4 additions & 0 deletions arista/configstatus.v1/configstatus-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# New entries go on top.

Changes:
- date: 2024-08-15
description: Add hierarchy config source type
version: 1.1.1
cvaas: true
- date: 2024-05-09
description: Update GetSome REST endpoint
version: 1.1.0
Expand Down
131 changes: 79 additions & 52 deletions arista/configstatus.v1/configstatus.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,95 +19,105 @@ import "fmp/extensions.proto";

// ErrorCode indicates warnings and errors produced during computing config
enum ErrorCode {
// ERROR_CODE_UNSPECIFIED uninitialized value
ERROR_CODE_UNSPECIFIED = 0;
// DEVICE_WARNING indicates device warning
// ERROR_CODE_DEVICE_WARNING indicates device warning
ERROR_CODE_DEVICE_WARNING = 1;
// DEVICE_ERROR indicates device error
// ERROR_CODE_DEVICE_ERROR indicates device error
ERROR_CODE_DEVICE_ERROR = 2;
// UNREACHABLE_DEVICE indicates the device cannot be reached
// ERROR_CODE_UNREACHABLE_DEVICE indicates the device cannot be reached
ERROR_CODE_UNREACHABLE_DEVICE = 3;
// CONFIG_FILTER_ERROR indicates error from partial config management filters
// ERROR_CODE_CONFIG_FILTER_ERROR indicates error from partial config management filters
ERROR_CODE_CONFIG_FILTER_ERROR = 4;
// INTERNAL indicates internal errors
// ERROR_CODE_INTERNAL indicates internal errors
ERROR_CODE_INTERNAL = 5;
}

// ConfigError represents errors reported by CVP when handling device configuration
// ConfigError represents errors reported by CVP/EOS when handling device configuration
message ConfigError {
// error_code - type of error.
ErrorCode error_code = 1;
// error_msg - details of error
google.protobuf.StringValue error_msg = 2;
// Line_num represents line number, if any
// line_num represents line number, if any
google.protobuf.Int32Value line_num = 3;
// Configlet_name represents the originating configlet name. Configlet_name
// configlet_name represents the originating configlet name. Configlet_name
// and line_num point to the line where config warning or config error originate.
google.protobuf.StringValue configlet_name = 4;
}

// ConfigErrors list of errors
message ConfigErrors {
// values - list of errors
repeated ConfigError values = 1;
}

// DiffOp is the operation to a line from one side of diff to get to another
enum DiffOp {
// DIFF_OP_UNSPECIFIED uninitialized
DIFF_OP_UNSPECIFIED = 0;
// NOP indicates no change. A and B are identical at this line
// DIFF_OP_NOP indicates no change. A and B are identical at this line
DIFF_OP_NOP = 1;
// IGNORE indicates a line that's ignored in either A or B.
// DIFF_OP_IGNORE indicates a line that's ignored in either A or B.
// One of a_line_num or b_line_num will be -1
DIFF_OP_IGNORE = 2;
// ADD is an addition of a line from A
// DIFF_OP_ADD is an addition of a line from A
DIFF_OP_ADD = 3;
// DELETE is deletion of a line from B
// DIFF_OP_DELETE is deletion of a line from B
DIFF_OP_DELETE = 4;
// CHANGE is a modification to a line in A
// DIFF_OP_CHANGE is a modification to a line in A
DIFF_OP_CHANGE = 5;
}
// ConfigFilterCode indicates if a config line matches PCM filter(s)
enum ConfigFilterCode {
// UNSPECIFIED indicates config line did not match any partial config management (PCM) filter
// CONFIG_FILTER_CODE_UNSPECIFIED uninitialized
CONFIG_FILTER_CODE_UNSPECIFIED = 0;
// MANAGED_LINE indicates config line matches managed PCM filter hence is managed
// CONFIG_FILTER_CODE_MANAGED_LINE indicates config line matches managed PCM filter hence is managed
CONFIG_FILTER_CODE_MANAGED_LINE = 1;
// UNMANAGED_LINE indicates config line matches unmanaged PCM filter hence is not managed
// CONFIG_FILTER_CODE_UNMANAGED_LINE indicates config line matches unmanaged PCM filter hence is not managed
CONFIG_FILTER_CODE_UNMANAGED_LINE = 2;
}
// DiffEntry represents one entry in a Diff
message DiffEntry {
// op - type of diff
DiffOp op = 1;
// line number in A this diff applies to
// a_line_num - line number in A this diff applies to
google.protobuf.Int32Value a_line_num = 2;
// line number in B this diff applies to
// b_line_num - line number in B this diff applies to
google.protobuf.Int32Value b_line_num = 3;
// line number of the parent command in B
// b_parent_line_num line number of the parent command in B
google.protobuf.Int32Value b_parent_line_num = 4;
// content of config line in A
// a_line content of config line in A
google.protobuf.StringValue a_line = 5;
// content of config line in B
// b_line content of config line in B
google.protobuf.StringValue b_line = 6;
// Config filter code of the line in A
// a_filter_code Config filter code of the line in A
ConfigFilterCode a_filter_code = 7;
// Config filter code of the line in B
// b_filter_code Config filter code of the line in B
ConfigFilterCode b_filter_code = 8;
// line number of the parent command in A
// a_parent_line_num line number of the parent command in A
google.protobuf.Int32Value a_parent_line_num = 9;
}
// DiffEntries indicates potential multiple lines of config diff
message DiffEntries {
// values - list of diff entries
repeated DiffEntry values = 1;
}

// ConfigSyncCode indicates config synchronization status
enum ConfigSyncCode {
// CONFIG_SYNC_CODE_UNSPECIFIED uninitialized
CONFIG_SYNC_CODE_UNSPECIFIED = 0;
// IN_SYNC indicates designed config and running config are identical
// CONFIG_SYNC_CODE_IN_SYNC indicates designed config and running config are identical
CONFIG_SYNC_CODE_IN_SYNC = 1;
// OUT_OF_SYNC indicates designed config and running config are not identical
// CONFIG_SYNC_CODE_OUT_OF_SYNC indicates designed config and running config are not identical
CONFIG_SYNC_CODE_OUT_OF_SYNC = 2;
}

// ConfigSourceType indicates the type of source for the proposed/designed configuration
// for the device
enum ConfigSourceType {
// CONFIG_SOURCE_TYPE_UNSPECIFIED uninitialized value
CONFIG_SOURCE_TYPE_UNSPECIFIED = 0;

// CONFIG_SOURCE_TYPE_NETWORK_PROVISIONING_CONFIGLET - configlet created from
Expand All @@ -117,125 +127,141 @@ enum ConfigSourceType {
// CONFIG_SOURCE_TYPE_STUDIO - config generated from a regular studio
CONFIG_SOURCE_TYPE_STUDIO = 2;

// SCONFIG_SOURCE_TYPE_STUDIO_STATIC - static config from studios framework
// CONFIG_SOURCE_TYPE_STUDIO_STATIC - static config from studios framework
CONFIG_SOURCE_TYPE_STUDIO_STATIC = 3;

// CONFIG_SOURCE_TYPE_HIERARCHY - config from the hierarchy frameork
CONFIG_SOURCE_TYPE_HIERARCHY = 5;
}

// ConfigSource describes an individual source of the proposed/designed config
message ConfigSource {
// source_type - app type of the config snippet
ConfigSourceType source_type = 1;

// source_id identifier to distinguish between multiple instances of the source type
// source_id is :
// configlet name for CONFIG_SOURCE_TYPE_NETWORK_PROVISIONING_CONFIGLET
// studio id for CONFIG_SOURCE_TYPE_STUDIO
// configlet id for CONFIG_SOURCE_TYPE_STUDIO_STATIC
// FixtureInstance id for CONFIG_SOURCE_TYPE_HIERARCHY
google.protobuf.StringValue source_id = 2;
}

// ConfigSources is the list of sources of the proposed/designed config
message ConfigSources {
// values - ordered list of all the config snippets present in DC
repeated ConfigSource values = 1;
}

// ConfigSummary represents device configuration summary.
message ConfigSummary {
// sync - state of DC vs RC
ConfigSyncCode sync = 1;
// Number of lines with code no-operation
// nop_lines - Number of lines with code no-operation
google.protobuf.Int32Value nop_lines = 2;
// Number of lines with code IGNORE
// ignored_lines - Number of lines with code IGNORE
google.protobuf.Int32Value ignored_lines = 3;
// Number of lines with code ADD
// added_lines - Number of lines with code ADD
google.protobuf.Int32Value added_lines = 4;
// Number of lines with code DELETE
// deleted_lines - Number of lines with code DELETE
google.protobuf.Int32Value deleted_lines = 5;
// Number of lines with code CHANGE
// changed_lines - Number of lines with code CHANGE
google.protobuf.Int32Value changed_lines = 6;
// Number of designed config errors
// designed_config_errors - Number of designed config errors
google.protobuf.Int32Value designed_config_errors = 7;
// Number of designed config warnings
// designed_config_warnings - Number of designed config warnings
google.protobuf.Int32Value designed_config_warnings = 8;
// Timestamp at which running config is updated
// running_config_update_time - Timestamp at which running config is updated
google.protobuf.Timestamp running_config_update_time = 9;
// Timestamp at which designed config is updated
// designed_config_update_time - Timestamp at which designed config is updated
google.protobuf.Timestamp designed_config_update_time = 10;
// The HTTP URI client can use to GET running config and associated errors
// running_config_uri - The HTTP URI client can use to GET running config and associated errors
google.protobuf.StringValue running_config_uri = 11;
// The HTTP URI client can use to GET designed config and associated errors
// designed_config_uri - The HTTP URI client can use to GET designed config and associated errors
google.protobuf.StringValue designed_config_uri = 12;
// The HTTP URI client can use to GET config diff and associated errors
// diff_uri - The HTTP URI client can use to GET config diff and associated errors
google.protobuf.StringValue diff_uri = 13;
// Digest (SHA-256) of the config diff.
// digest (SHA-256) of the config diff.
google.protobuf.StringValue digest = 14;
}

// ConfigType - specifies type of config
enum ConfigType {
// CONFIG_TYPE_UNSPECIFIED uninitialized value
CONFIG_TYPE_UNSPECIFIED = 0;
// CONFIG_TYPE_RUNNING_CONFIG uninitialized value
CONFIG_TYPE_RUNNING_CONFIG = 1;
// CONFIG_TYPE_DESIGNED_CONFIG uninitialized value
CONFIG_TYPE_DESIGNED_CONFIG = 2;
}

// ConfigKey uniquely identifies a config request.
message ConfigKey {
option (fmp.model_key) = true;

// Device_id is the serial number of the device
// device_id is the serial number of the device
google.protobuf.StringValue device_id = 1;
// Type describes the config type
// type describes the config type
ConfigType type = 2;
}

// Configuration represents device's CLI configuration
message Configuration {
option (fmp.model) = "ro";

// key specifies the device and type of config
ConfigKey key = 1;
// Uri represents the HTTP URI client can use to GET config body and associated errors
// uri represents the HTTP URI client can use to GET config body and associated errors
google.protobuf.StringValue uri = 2;
}

// ConfigDiffKey uniquely identifies a configuration diff request
message ConfigDiffKey {
option (fmp.model_key) = true;

// A_device_id is the serial number of the device on A side (left hand side)
// a_device_id is the serial number of the device on A side (left hand side)
google.protobuf.StringValue a_device_id = 1;
// A_type is the config type on A side (left hand side)
// a_type is the config type on A side (left hand side)
ConfigType a_type = 2;
// A_time is the time at which to fetch config on A side (left hand side)
// a_time is the time at which to fetch config on A side (left hand side)
google.protobuf.Timestamp a_time = 3;

// B_device_id is the serial number of the device on B side (right hand side)
// b_device_id is the serial number of the device on B side (right hand side)
google.protobuf.StringValue b_device_id = 4;
// B_type is the config type on B side (right hand side)
// b_type is the config type on B side (right hand side)
ConfigType b_type = 5;
// B_time is the time at which to fetch config on B side (right hand side)
// b_time is the time at which to fetch config on B side (right hand side)
google.protobuf.Timestamp b_time = 6;
}

// ConfigDiff - specifies the diff request
message ConfigDiff {
option (fmp.model) = "ro";

// Key represents config diff key
// key represents config diff key
ConfigDiffKey key = 1;

// Uri represents the HTTP URI client can use to GET config diff and associated errors
// uri represents the HTTP URI client can use to GET config diff and associated errors
google.protobuf.StringValue uri = 2;
}

// SummaryKey uniquely identifies a device summary request
message SummaryKey {
option (fmp.model_key) = true;

// Device_id is the serial number of the device
// device_id is the serial number of the device
google.protobuf.StringValue device_id = 1;
}

// Summary - Describes the device's diff summary
message Summary {
option (fmp.model) = "ro";

// key spefies the device
SummaryKey key = 1;

// summary - diff summary of the device
ConfigSummary summary = 2;
}

Expand All @@ -252,6 +278,7 @@ message SecurityProfile {
// SecurityProfileComplianceSummary holds the compliance summary for
// security profile configuration.
message SecurityProfileComplianceSummary {
// sync - sync state of the device
ConfigSyncCode sync = 1;
// nop_lines is the number of lines with code no-operation
google.protobuf.Int32Value nop_lines = 2;
Expand Down
Loading

0 comments on commit 37f77d3

Please sign in to comment.