1// Copyright 2018 The Fuchsia Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5library fuchsia.inspect; 6 7union PropertyValue { 8 string str; 9 vector<uint8> bytes; 10}; 11 12// A string property on an |Object|. Consisting of a key and value. 13struct Property { 14 string key; 15 PropertyValue value; 16}; 17 18// The value of a metric is one of these numeric types. 19union MetricValue { 20 int64 int_value; 21 uint64 uint_value; 22 float64 double_value; 23}; 24 25// A Metric is a string key and the associated numeric value. 26struct Metric { 27 string key; 28 MetricValue value; 29}; 30 31// An |Object| has a name and 0 or more properties and metrics. 32struct Object { 33 string name; 34 vector<Property>? properties; 35 vector<Metric>? metrics; 36}; 37 38// The |Inspect| interface provides a point for Components to expose 39// structured Objects for inspection. An Object may have 0 or more children. 40[Discoverable] 41interface Inspect { 42 1: ReadData() -> (Object object); 43 2: ListChildren() -> (vector<string>? children_names); 44 // Open a child of this Object by name. 45 // The name should match what is returned by ListChildren. 46 3: OpenChild(string child_name, request<Inspect> child_channel) -> (bool success); 47}; 48