| // 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.inspect; |
| |
| union PropertyValue { |
| string str; |
| vector<uint8> bytes; |
| }; |
| |
| // A string property on an |Object|. Consisting of a key and value. |
| struct Property { |
| string key; |
| PropertyValue value; |
| }; |
| |
| // The value of a metric is one of these numeric types. |
| union MetricValue { |
| int64 int_value; |
| uint64 uint_value; |
| float64 double_value; |
| }; |
| |
| // A Metric is a string key and the associated numeric value. |
| struct Metric { |
| string key; |
| MetricValue value; |
| }; |
| |
| // An |Object| has a name and 0 or more properties and metrics. |
| struct Object { |
| string name; |
| vector<Property>? properties; |
| vector<Metric>? metrics; |
| }; |
| |
| // The |Inspect| interface provides a point for Components to expose |
| // structured Objects for inspection. An Object may have 0 or more children. |
| [Discoverable] |
| interface Inspect { |
| 1: ReadData() -> (Object object); |
| 2: ListChildren() -> (vector<string>? children_names); |
| // Open a child of this Object by name. |
| // The name should match what is returned by ListChildren. |
| 3: OpenChild(string child_name, request<Inspect> child_channel) -> (bool success); |
| }; |