blob: 881e97d4f5ab2a1fe72f9562e9e2ff243303a404 [file] [log] [blame] [edit]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.cobalt;
/// Channels should not be longer than this.
const MAX_CHANNEL_NAME_LENGTH uint32 = 256;
/// Realm names should not be longer than this.
const MAX_REALM_NAME_LENGTH uint32 = 256;
/// Response codes for Logger operations.
type Status = strict enum : int32 {
OK = 0;
/// For example the supplied metric id is invalid.
INVALID_ARGUMENTS = 1;
/// An attempt was made to log an Event whose serialized size exceeds
/// MAX_BYTES_PER_EVENT.
EVENT_TOO_BIG = 2;
/// Cobalt's local buffer is temporarily full and cannot handle any more
/// Events at this time. Try again later. This condition should be rare
BUFFER_FULL = 3;
// Cobalt has received a ShutDown signal and will not accept any more
// events.
SHUT_DOWN = 4;
/// Catch-all for unexpected errors.
INTERNAL_ERROR = -1;
};
/////////////////////////////////////////////////////////////////////
// SystemProfileUpdater Interface
/////////////////////////////////////////////////////////////////////
/// A collection of fields describing a system's software distribution.
type SoftwareDistributionInfo = table {
/// The channel that the device last used as an update source. This value
/// may be empty to indicate that the device is not currently associated
/// with any channel.
1: current_channel string:MAX_CHANNEL_NAME_LENGTH;
/// The realm of the device represented by the Omaha App ID. This value
/// may be empty to indicate that the device is not currently associated
/// with any realm.
2: current_realm string:MAX_REALM_NAME_LENGTH;
};
/// The SystemDataUpdater interface allows callers to update the state of
/// the SystemProfile in Cobalt. The changes are global and affect all loggers
/// running on the device.
@discoverable
protocol SystemDataUpdater {
/// Sets Cobalt's view of the system-wide distribution information replacing the
/// existing values.
///
/// `info` The specifications of the current system's software distribution.
SetSoftwareDistributionInfo(struct {
info SoftwareDistributionInfo;
}) -> (struct {
status Status;
});
};