Skip to content

Commit

Permalink
update/changecontrol: Add device ID to stage IDs map
Browse files Browse the repository at this point in the history
Adding a device ID to stage IDs map so that the client
does not have to go through all the stages to figure out
stage of interest.

Change-Id: Ib10cbed8d51588b79a4d57817979a43ddf742273
  • Loading branch information
shubhransh committed Oct 16, 2024
1 parent a612b68 commit f91854c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
6 changes: 6 additions & 0 deletions arista/changecontrol.v1/changecontrol-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# New entries go on top.

Changes:
- date: 2024-10-09
description: add device_id_to_stage_ids map
version: 1.1.1
cvaas: true
onprem: true

- date: 2024-05-09
description: Update GetSome, SetSome, DeleteSome REST endpoints
version: 1.1.0
Expand Down
14 changes: 14 additions & 0 deletions arista/changecontrol.v1/changecontrol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ message ChangeControlConfig {

// StageStatus defines the possible execution statuses of a stage.
enum StageStatus {
// STAGE_STATUS_UNSPECIFIED means unknown stage status.
STAGE_STATUS_UNSPECIFIED = 0;
// STAGE_STATUS_RUNNING means the stage has begun execution.
STAGE_STATUS_RUNNING = 1;
Expand Down Expand Up @@ -245,6 +246,7 @@ message TimestampFlag {
// ChangeControlStatus defines the possible execution statuses of
// a change control.
enum ChangeControlStatus {
// CHANGE_CONTROL_STATUS_UNSPECIFIED means the change control status is unknown.
CHANGE_CONTROL_STATUS_UNSPECIFIED = 0;
// CHANGE_CONTROL_STATUS_RUNNING means the change control has begun
// execution.
Expand Down Expand Up @@ -273,6 +275,13 @@ message Filter {
fmp.RepeatedString device_ids = 1;
}

// DeviceToStageMap is a map of a device ID and its list of corresponding stages.
message DeviceToStageMap {
// values maps the device ID with the stages which are associated with a device
// in a changecontrol state model.
map<string, fmp.RepeatedString> values = 1;
}

// ChangeControl holds the configuration and status of a change control.
message ChangeControl {
option (fmp.model) = "ro";
Expand Down Expand Up @@ -302,6 +311,11 @@ message ChangeControl {
TimestampFlag schedule = 7;
// device_ids is a list of device IDs on which the change control will operate.
fmp.RepeatedString device_ids = 8;
// device_id_to_stage_ids is a map of device IDs to the stages present in the
// specified Change state.
// This is not affected by the device ID based custom filtering and will contain
// info about all the devices associated with a CC ID.
DeviceToStageMap device_id_to_stage_ids = 9;
}

// ApproveConfig is used to configure the approval of a change control.
Expand Down
21 changes: 19 additions & 2 deletions arista/changecontrol.v1/services.gen.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,10 @@
"deviceIds": {
"$ref": "#/definitions/fmp.RepeatedString",
"description": "device_ids is a list of device IDs on which the change control will operate."
},
"deviceIdToStageIds": {
"$ref": "#/definitions/arista.changecontrol.v1.DeviceToStageMap",
"description": "device_id_to_stage_ids is a map of device IDs to the stages present in the\nspecified Change state.\nThis is not affected by the device ID based custom filtering and will contain\ninfo about all the devices associated with a CC ID."
}
},
"description": "ChangeControl holds the configuration and status of a change control."
Expand Down Expand Up @@ -2264,7 +2268,7 @@
"CHANGE_CONTROL_STATUS_NOT_STARTED"
],
"default": "CHANGE_CONTROL_STATUS_UNSPECIFIED",
"description": "ChangeControlStatus defines the possible execution statuses of\na change control.\n\n - CHANGE_CONTROL_STATUS_RUNNING: CHANGE_CONTROL_STATUS_RUNNING means the change control has begun\nexecution.\n - CHANGE_CONTROL_STATUS_COMPLETED: CHANGE_CONTROL_STATUS_COMPLETED means the change control has ceased\nexecution. Success/failure of a change control cannot be inferred\nfrom this status alone but rather this status plus the change control\nerror. That is, no error implies success and some error implies failure.\n - CHANGE_CONTROL_STATUS_SCHEDULED: CHANGE_CONTROL_STATUS_SCHEDULED means the change control has been\nscheduled for execution at some time. Any failure that occurs during\nthis process will cause a transition back to the unspecified status,\na reset of the schedule flag by the system, and an error on the change\ncontrol reporting the details of the failure.\n - CHANGE_CONTROL_STATUS_NOT_STARTED: CHANGE_CONTROL_STATUS_NOT_STARTED means the change control has not been\nstarted. This would include approved and not approved change controls."
"description": "ChangeControlStatus defines the possible execution statuses of\na change control.\n\n - CHANGE_CONTROL_STATUS_UNSPECIFIED: CHANGE_CONTROL_STATUS_UNSPECIFIED means the change control status is unknown.\n - CHANGE_CONTROL_STATUS_RUNNING: CHANGE_CONTROL_STATUS_RUNNING means the change control has begun\nexecution.\n - CHANGE_CONTROL_STATUS_COMPLETED: CHANGE_CONTROL_STATUS_COMPLETED means the change control has ceased\nexecution. Success/failure of a change control cannot be inferred\nfrom this status alone but rather this status plus the change control\nerror. That is, no error implies success and some error implies failure.\n - CHANGE_CONTROL_STATUS_SCHEDULED: CHANGE_CONTROL_STATUS_SCHEDULED means the change control has been\nscheduled for execution at some time. Any failure that occurs during\nthis process will cause a transition back to the unspecified status,\na reset of the schedule flag by the system, and an error on the change\ncontrol reporting the details of the failure.\n - CHANGE_CONTROL_STATUS_NOT_STARTED: CHANGE_CONTROL_STATUS_NOT_STARTED means the change control has not been\nstarted. This would include approved and not approved change controls."
},
"arista.changecontrol.v1.ChangeControlStreamRequest": {
"type": "object",
Expand Down Expand Up @@ -2305,6 +2309,19 @@
}
}
},
"arista.changecontrol.v1.DeviceToStageMap": {
"type": "object",
"properties": {
"values": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fmp.RepeatedString"
},
"description": "values maps the device ID with the stages which are associated with a device\nin a changecontrol state model."
}
},
"description": "DeviceToStageMap is a map of a device ID and its list of corresponding stages."
},
"arista.changecontrol.v1.Filter": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2474,7 +2491,7 @@
"STAGE_STATUS_NOT_STARTED"
],
"default": "STAGE_STATUS_UNSPECIFIED",
"description": "StageStatus defines the possible execution statuses of a stage.\n\n - STAGE_STATUS_RUNNING: STAGE_STATUS_RUNNING means the stage has begun execution.\n - STAGE_STATUS_COMPLETED: STAGE_STATUS_COMPLETED means the stage has ceased execution.\nSuccess/failure of a stage cannot be inferred from this status\nalone but rather this status plus the stage error. That is, no\nerror implies success and some error implies failure.\n - STAGE_STATUS_NOT_STARTED: STAGE_STATUS_NOT_STARTED means the stage has not been started."
"description": "StageStatus defines the possible execution statuses of a stage.\n\n - STAGE_STATUS_UNSPECIFIED: STAGE_STATUS_UNSPECIFIED means unknown stage status.\n - STAGE_STATUS_RUNNING: STAGE_STATUS_RUNNING means the stage has begun execution.\n - STAGE_STATUS_COMPLETED: STAGE_STATUS_COMPLETED means the stage has ceased execution.\nSuccess/failure of a stage cannot be inferred from this status\nalone but rather this status plus the stage error. That is, no\nerror implies success and some error implies failure.\n - STAGE_STATUS_NOT_STARTED: STAGE_STATUS_NOT_STARTED means the stage has not been started."
},
"arista.changecontrol.v1.TimestampFlag": {
"type": "object",
Expand Down

0 comments on commit f91854c

Please sign in to comment.