Skip to content

Commit

Permalink
RSDK-7903 Add unhealthy state and error field (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
maximpertsov and github-actions[bot] authored Aug 2, 2024
1 parent a6397fd commit 3f99eff
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 242 deletions.
10 changes: 5 additions & 5 deletions component/base/v1/base.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions component/gantry/v1/gantry.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions component/movementsensor/v1/movementsensor.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions component/posetracker/v1/pose_tracker.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gen/js/robot/v1/robot_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,9 @@ export class ResourceStatus extends jspb.Message {
getRevision(): string;
setRevision(value: string): void;

getError(): string;
setError(value: string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ResourceStatus.AsObject;
static toObject(includeInstance: boolean, msg: ResourceStatus): ResourceStatus.AsObject;
Expand All @@ -1158,6 +1161,7 @@ export namespace ResourceStatus {
state: ResourceStatus.StateMap[keyof ResourceStatus.StateMap],
lastUpdated?: google_protobuf_timestamp_pb.Timestamp.AsObject,
revision: string,
error: string,
}

export interface StateMap {
Expand All @@ -1166,6 +1170,7 @@ export namespace ResourceStatus {
STATE_CONFIGURING: 2;
STATE_READY: 3;
STATE_REMOVING: 4;
STATE_UNHEALTHY: 5;
}

export const State: StateMap;
Expand Down
35 changes: 33 additions & 2 deletions gen/js/robot/v1/robot_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8995,7 +8995,8 @@ proto.viam.robot.v1.ResourceStatus.toObject = function(includeInstance, msg) {
name: (f = msg.getName()) && common_v1_common_pb.ResourceName.toObject(includeInstance, f),
state: jspb.Message.getFieldWithDefault(msg, 2, 0),
lastUpdated: (f = msg.getLastUpdated()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
revision: jspb.Message.getFieldWithDefault(msg, 4, "")
revision: jspb.Message.getFieldWithDefault(msg, 4, ""),
error: jspb.Message.getFieldWithDefault(msg, 5, "")
};

if (includeInstance) {
Expand Down Expand Up @@ -9050,6 +9051,10 @@ proto.viam.robot.v1.ResourceStatus.deserializeBinaryFromReader = function(msg, r
var value = /** @type {string} */ (reader.readString());
msg.setRevision(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setError(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -9109,6 +9114,13 @@ proto.viam.robot.v1.ResourceStatus.serializeBinaryToWriter = function(message, w
f
);
}
f = message.getError();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
};


Expand All @@ -9120,7 +9132,8 @@ proto.viam.robot.v1.ResourceStatus.State = {
STATE_UNCONFIGURED: 1,
STATE_CONFIGURING: 2,
STATE_READY: 3,
STATE_REMOVING: 4
STATE_REMOVING: 4,
STATE_UNHEALTHY: 5
};

/**
Expand Down Expand Up @@ -9233,6 +9246,24 @@ proto.viam.robot.v1.ResourceStatus.prototype.setRevision = function(value) {
};


/**
* optional string error = 5;
* @return {string}
*/
proto.viam.robot.v1.ResourceStatus.prototype.getError = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};


/**
* @param {string} value
* @return {!proto.viam.robot.v1.ResourceStatus} returns this
*/
proto.viam.robot.v1.ResourceStatus.prototype.setError = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};





Expand Down
9 changes: 7 additions & 2 deletions proto/viam/robot/v1/robot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,13 @@ message ResourceStatus {
STATE_UNCONFIGURED = 1;
// a resource that is being configured.
STATE_CONFIGURING = 2;
// a resource that has been successfully configured once and is not being
// re-configured or removed.
// a resource that has been successfully configured once, and is not re-configuring,
// being removed, or unhealthy.
STATE_READY = 3;
// a resource that is being removed from the robot.
STATE_REMOVING = 4;
// a resource that is in an unhealthy state.
STATE_UNHEALTHY = 5;
}

// resource name.
Expand All @@ -407,6 +409,9 @@ message ResourceStatus {

// revision of the last config that successfully updated this resource.
string revision = 4;

// error details for a resource that is in an unhealthy state.
string error = 5;
}

message ConfigStatus {
Expand Down
Loading

0 comments on commit 3f99eff

Please sign in to comment.