Commit 65050bb5 authored by dubroy@chromium.org's avatar dubroy@chromium.org

Add client side protobuf fields for reporting status with policy requests.

BUG=chromium-os:22036
TEST=None.


Review URL: http://codereview.chromium.org/8578002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110311 0039d316-1c4b-4281-b951-d872f2087c98
parent 610e9e3e
...@@ -29,7 +29,7 @@ message DeviceRegisterRequest { ...@@ -29,7 +29,7 @@ message DeviceRegisterRequest {
// Chrome OS TT support once it is over. // Chrome OS TT support once it is over.
optional Type type = 2 [default = TT]; optional Type type = 2 [default = TT];
// Machine hardware id, such as MEID, Mac adress. // Machine hardware id, such as serial number.
// This field is required if register type == DEVICE. // This field is required if register type == DEVICE.
optional string machine_id = 3; optional string machine_id = 3;
...@@ -97,6 +97,12 @@ message PolicyFetchRequest { ...@@ -97,6 +97,12 @@ message PolicyFetchRequest {
// This field is unspecified if the client does not yet have a // This field is unspecified if the client does not yet have a
// public key. // public key.
optional int32 public_key_version = 4; optional int32 public_key_version = 4;
// Machine hardware id, such as serial number.
// This field is should be set only if the serial number for the device is
// missing from the server, as indicated by the valid_serial_number_missing
// field in the last policy fetch response.
optional string machine_id = 5;
} }
// This message is included in serialized form in PolicyFetchResponse // This message is included in serialized form in PolicyFetchResponse
...@@ -106,7 +112,7 @@ message PolicyData { ...@@ -106,7 +112,7 @@ message PolicyData {
// See PolicyFetchRequest.policy_type. // See PolicyFetchRequest.policy_type.
optional string policy_type = 1; optional string policy_type = 1;
// [timestamp] is milli seconds since Epoch in UTC timezone. It is // [timestamp] is milliseconds since Epoch in UTC timezone. It is
// included here so that the time at which the server issued this // included here so that the time at which the server issued this
// response cannot be faked (as protection against replay attacks). // response cannot be faked (as protection against replay attacks).
// It is the timestamp generated by DMServer, NOT the time admin // It is the timestamp generated by DMServer, NOT the time admin
...@@ -156,6 +162,12 @@ message PolicyData { ...@@ -156,6 +162,12 @@ message PolicyData {
UNMANAGED = 1; UNMANAGED = 1;
} }
optional AssociationState state = 9 [default = ACTIVE]; optional AssociationState state = 9 [default = ACTIVE];
// Indicates if the the server cannot find a valid serial number for the
// device. If this flag is set, the device should send the valid serial
// number with a device policy fetch request. Note that this only
// applies to device policy.
optional bool valid_serial_number_missing = 10;
} }
message PolicyFetchResponse { message PolicyFetchResponse {
...@@ -163,7 +175,7 @@ message PolicyFetchResponse { ...@@ -163,7 +175,7 @@ message PolicyFetchResponse {
// provide separate error code for each individual policy fetch. // provide separate error code for each individual policy fetch.
// We will use standard HTTP Status Code as error code. // We will use standard HTTP Status Code as error code.
optional int32 error_code = 1; optional int32 error_code = 1;
// Human readable error message for customer support purpose. // Human readable error message for customer support purpose.
optional string error_message = 2; optional string error_message = 2;
...@@ -205,6 +217,79 @@ message DevicePolicyResponse { ...@@ -205,6 +217,79 @@ message DevicePolicyResponse {
repeated PolicyFetchResponse response = 3; repeated PolicyFetchResponse response = 3;
} }
message TimePeriod {
// [timestamp] is milli seconds since Epoch in UTC timezone.
optional int64 start_timestamp = 1;
optional int64 end_timestamp = 2;
}
// This captures launch events for one app/extension or other installments.
message InstallableLaunch {
optional string install_id = 1;
// Time duration where this report covers. These are required
// and the record will be ignored if not set.
optional TimePeriod duration = 2;
// Client will send at most 50 timestamps to DM. All the rest
// launch activities will be summed into the total count.
// We will distribute the count evenly among the time span when
// doing time based aggregation.
repeated int64 timestamp = 3;
optional int64 total_count = 4;
}
// Report device level status.
message DeviceStatusReportRequest {
optional string os_version = 1;
optional string firmware_version = 2;
// "Validated", "Dev". Same as verified mode.
// If the mode is unknown, this field should not be set.
optional string boot_mode = 3;
// Device active times collection since last report rpc call.
repeated TimePeriod active_time = 4;
}
// Report session (a user on one device) level status.
message SessionStatusReportRequest {
// Installed apps for this user on this device.
repeated string installed_app_id = 1;
// Installed extensions for this user on this device.
repeated string installed_extension_id = 2;
// One stat per app for top 30 apps.
repeated InstallableLaunch app_launch_stat = 3;
}
// Response from DMServer to update devices' status.
// It is possible that status report fails but policy request succeed. In such
// case, the DeviceStatusReportResponse will contain an error code and the
// device should re-send status report data in the next policy request. The
// device should re-send report data if policy request fails, even if
// DeviceStatusReportResponse contains no error code.
message DeviceStatusReportResponse {
optional int32 error_code = 1;
// Human readable error message for customer support purpose.
optional string error_message = 2;
}
// Response from DMServer to update user devices' status.
// It is possible that status report fails but policy request succeed. In such
// case, the SessionStatusReportResponse will contain an error code and the
// device should re-send status report data in the next policy request. The
// device should re-send report data if policy request fails, even if
// SessionStatusReportResponse contains no error code.
message SessionStatusReportResponse {
optional int32 error_code = 1;
// Human readable error message for customer support purpose.
optional string error_message = 2;
}
// Request from the DMAgent on the device to the DMServer. This is // Request from the DMAgent on the device to the DMServer. This is
// container for all requests from device to server. The overall HTTP // container for all requests from device to server. The overall HTTP
// request MUST be in the following format: // request MUST be in the following format:
...@@ -212,7 +297,7 @@ message DevicePolicyResponse { ...@@ -212,7 +297,7 @@ message DevicePolicyResponse {
// * HTTP method is POST // * HTTP method is POST
// * Data mime type is application/x-protobuffer // * Data mime type is application/x-protobuffer
// * HTTP parameters are (all required, all case sensitive): // * HTTP parameters are (all required, all case sensitive):
// * request: MUST BE one of register/unregister/policy/ping // * request: MUST BE one of register/unregister/policy/ping/status
// * devicetype: MUST BE "1" for Android or "2" for Chrome OS. // * devicetype: MUST BE "1" for Android or "2" for Chrome OS.
// * apptype: MUST BE Android or Chrome. // * apptype: MUST BE Android or Chrome.
// * deviceid: MUST BE no more than 64-char in [\x21-\x7E]. // * deviceid: MUST BE no more than 64-char in [\x21-\x7E].
...@@ -221,10 +306,21 @@ message DevicePolicyResponse { ...@@ -221,10 +306,21 @@ message DevicePolicyResponse {
// * For register and ping requests // * For register and ping requests
// Authorization: GoogleLogin auth=<auth cookie for Mobile Sync> // Authorization: GoogleLogin auth=<auth cookie for Mobile Sync>
// //
// * For unregister and policy requests // * For unregister, policy and status requests
// Authorization: GoogleDMToken token=<dm token from register> // Authorization: GoogleDMToken token=<dm token from register>
// //
// * OAuth is NOT supported yet. // * OAuth is NOT supported yet.
//
// DeviceManagementRequest should only contain one request which matches the
// HTTP query parameter - request, as listed below. Other requests within the
// container will be ignored.
// ping: policy_request
// register: register_request
// unregister: unregister_request
// policy: policy_request
// status: status_report_request
//
//
message DeviceManagementRequest { message DeviceManagementRequest {
// Register request. // Register request.
optional DeviceRegisterRequest register_request = 1; optional DeviceRegisterRequest register_request = 1;
...@@ -234,6 +330,10 @@ message DeviceManagementRequest { ...@@ -234,6 +330,10 @@ message DeviceManagementRequest {
// Policy request. // Policy request.
optional DevicePolicyRequest policy_request = 3; optional DevicePolicyRequest policy_request = 3;
// Update status.
optional DeviceStatusReportRequest device_status_report_request = 4;
optional SessionStatusReportRequest session_status_report_request = 5;
} }
// Response from server to device. // Response from server to device.
...@@ -264,4 +364,10 @@ message DeviceManagementResponse { ...@@ -264,4 +364,10 @@ message DeviceManagementResponse {
// Policy response. // Policy response.
optional DevicePolicyResponse policy_response = 5; optional DevicePolicyResponse policy_response = 5;
// Device status report response.
optional DeviceStatusReportResponse device_status_report_response = 6;
// Session status report response.
optional SessionStatusReportResponse session_status_report_response = 7;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment