github.com/cloudwan/edgelq-sdk@v1.15.4/devices/proto/v1/device.proto (about) 1 syntax = "proto3"; 2 3 package ntt.devices.v1; 4 5 import "edgelq-sdk/common/api/healthcheck.proto"; 6 import "edgelq-sdk/iam/proto/v1/common.proto"; 7 import "google/api/resource.proto"; 8 import "google/protobuf/duration.proto"; 9 import "google/protobuf/field_mask.proto"; 10 import "google/protobuf/timestamp.proto"; 11 import "google/type/latlng.proto"; 12 import "goten-sdk/types/meta.proto"; 13 14 option go_package = "github.com/cloudwan/edgelq-sdk/devices/resources/v1/device;device"; 15 option java_multiple_files = true; 16 option java_outer_classname = "DeviceProto"; 17 option java_package = "com.ntt.devices.pb.v1"; 18 19 // Device Resource 20 message Device { 21 option (google.api.resource) = { 22 type : "devices.edgelq.com/Device" 23 pattern : "projects/{project}/regions/{region}/devices/{device}" 24 }; 25 26 // Name of Device 27 // When creating a new instance, this field is optional and if not provided, 28 // it will be generated automatically. Last ID segment must conform to the 29 // following regex: [a-z][a-z0-9\\-]{0,28}[a-z0-9] 30 string name = 1; 31 32 // Metadata is an object with information like create, update and delete time 33 // (for async deleted resources), has user labels/annotations, sharding 34 // information, multi-region syncing information and may have non-schema 35 // owners (useful for taking ownership of resources belonging to lower level 36 // services by higher ones). 37 goten.types.Meta metadata = 2; 38 39 // Display name for the device 40 string display_name = 6; 41 42 // Optional. Description of the Device. 43 string description = 7; 44 45 // Spec holds the expected state of the Device, meaning configurations. 46 Spec spec = 3; 47 48 // Status of the Device reported from the actual device. 49 Status status = 4; 50 51 PublicListingSpec public_listing_spec = 5; 52 53 message Spec { 54 // The associated service account to the Device. 55 // The agents in the device uses a key from this service account 56 // when they issue any requests to our endpoints for authoroization and 57 // authentication. `ProvisionServiceAccountToDevice` creates a new service 58 // account and a key for the Device and asign the account to this fileld. If 59 // you change the value of this field, the existing device would lose the 60 // access to the resources in our services, that means you can revoke the 61 // permissions from the device. You can manually set an empty value to do 62 // so, or call `RemoveServiceAccountFromDevice`. 63 string service_account = 1; 64 65 // Logging bucket associated with device 66 string log_bucket = 14; 67 68 // Monitoring metrics bucket associated with device 69 string metrics_bucket = 15; 70 71 // The expected OS version in string (e.g. 1.0.2). 72 // The device will automatically download the OS image and upgrade itself 73 // with it. You can stack the OS upgrade progress in the Condition named 74 // `OSReady` in Status.Conditions. 75 string os_version = 2; 76 77 string netplan_yaml_config = 17; 78 79 NetworkConfigMode netplan_api_config_mode = 12; 80 81 // The URL is dynamically constructed once the device is created or updated. 82 // The URL will be based on the device hardware information 83 // URL format: base_url/dedicated_path/iso_version/architecture/os_type 84 string os_image_url = 5; 85 86 SSHConfig ssh_config = 6; 87 88 AttestationConfig attestation_config = 7; 89 90 // Disables the daemon on the device for device auto discovery on the 91 // network. When it's enabled, avahi-daemon is launched on the device which 92 // listens at UDP 5353. This daemon is useful to locate the device that 93 // acquires an IP address with DHCP. 94 bool disable_device_discovery = 8; 95 96 LoggingConfig logging_config = 9; 97 98 ProxyConfig proxy_config = 10; 99 100 Location location = 13; 101 102 USBGuard usb_guard = 16; 103 104 // Custom Health checks for device 105 repeated ntt.api.HealthCheckSpec health_checks = 18; 106 107 // If enabled, the default network configuration that was part of the 108 // initial disk image will never be used. This needs to be used with caution 109 // because clearing this flag would require access to device over console 110 // port or by connecting a Monitor to it. 111 bool disable_network_config_fallback = 19; 112 113 // SSHConfig defines the ssh configuration for the Device. 114 message SSHConfig { 115 bool disable_ssh_server = 1; 116 117 bool disable_ssh_password = 2; 118 119 repeated AuthKey ssh_authorized = 3; 120 121 repeated string ip_allow_list = 4; 122 123 repeated string ip_deny_list = 5; 124 125 google.protobuf.Duration reject_period = 6; 126 127 bool disable_ssh_authkey = 7; 128 129 message AuthKey { 130 string ssha_key = 1; 131 132 bool cert_authority = 2; 133 134 string command = 3; 135 136 string environment = 4; 137 138 string from = 5; 139 140 bool no_agent_forwarding = 6; 141 142 bool no_port_forwarding = 7; 143 144 bool no_pty = 8; 145 146 bool no_user_rc = 9; 147 148 bool no_x11_forwarding = 10; 149 150 string permitopen = 11; 151 152 string principals = 12; 153 154 string tunnel = 13; 155 156 bool restrict = 14; 157 } 158 } 159 160 message AttestationConfig { 161 // If true, the droplet will try to attest itself. 162 bool attestation_expected = 1; 163 164 // Attestation domain for device attestation. 165 string attestation_domain = 2; 166 167 reserved 3; 168 } 169 170 message LoggingConfig { 171 // Log priority as understood by systemd (0 - emergency, 1 - alert, 2 - 172 // critical, 3 - error, 4 - warning, 5 - notice, 6 - informational, 7 - 173 // debug). Journal logs with this priority and higher will be uploaded to 174 // the server. 175 int32 priority = 1; 176 177 // List of systemd unit names to monitor for logs, e.g. 178 // NetworkManager.service, docker.service. 179 // Leave empty to export all journald logs. 180 repeated string units = 2; 181 182 // Whether the journald log exporter is enabled. 183 bool enable_journal_export = 3; 184 185 ContainerLoggingConfig container_logging_config = 4; 186 187 // Configuration to control how container log export is handled 188 // Only enable option is available now 189 message ContainerLoggingConfig { 190 // Enable container log export. Default is disabled 191 bool enable_container_log_export = 1; 192 } 193 } 194 195 message ProxyConfig { 196 string http_proxy = 1; 197 198 string https_proxy = 2; 199 200 string no_proxy = 3; 201 202 // By default proxy is applicable for all interfaces 203 // configuring proxy_interfaces allows to restrict proxy setting to be 204 // used only with specific interfaces At present this is only used for 205 // Control Plane (for eg LTE fallback) 206 repeated string proxy_interfaces = 4; 207 } 208 209 // Device location of the device. 210 message Location { 211 string address = 1; 212 213 string placement = 2; 214 } 215 216 // USB Guard. When enable is not set, USB guard service will not be started. 217 // When it is enabled, we can specify allowed device white list with 218 // WhiteList. Each device can be specified one of Device Name, Device ID or 219 // connected port number. We can specify multiple parameter for a device. 220 message USBGuard { 221 // Enable USB Guard service on the device. 222 bool enable = 1; 223 224 // This is array of white list of the USB devices. 225 repeated WhiteList white_list = 2; 226 227 // USB match operator for "via-port". 228 message Port { 229 repeated string equals = 1; 230 231 repeated string one_of = 2; 232 } 233 234 // USB match operator for "with-interface". 235 message Interface { 236 repeated string equals = 1; 237 238 repeated string one_of = 2; 239 } 240 241 // This is array of white list of the USB devices. 242 message WhiteList { 243 // USB device name to be allowed to connect. 244 string device_name = 1; 245 246 // USB device id to be allowed to connect. 247 string device_id = 2; 248 249 // USB port to be allowed to connect. 250 Port via_port = 3; 251 252 // USB interface to be allowed to connect. 253 Interface with_interface = 4; 254 255 // USB connect type to be allowed to connect. 256 string with_connect_type = 5; 257 } 258 } 259 260 // MERGE or REPLACE the api netplan_config with the baked in config in the 261 // device. REPLACE - The desired configuration must be input in full. The 262 // default config in disk will not be used. MERGE - Replaces level keys such 263 // as ethernet, modems, wifis etc that are defined in API config. Merge 264 // makes it easier to add new types of configuration - for example if the 265 // default configuration does not have wifis, it is easier to just add wifi 266 // config alone in API and use config mode merge. However, if the goal is to 267 // add to or replace a specific configuration in a section that already 268 // exists in the default configuration, then the API config should have the 269 // entire section and not just the changes for example if the default config 270 // on disk has eno1, eno2 under ethernet section and the goal is to replace 271 // the eno2 on disk, then the API configuration should specify both eno1 and 272 // eno2. This is because the merge mode still replaces whole sections that 273 // are defined in the API config 274 enum NetworkConfigMode { 275 MERGE = 0; 276 277 REPLACE = 1; 278 } 279 280 reserved 11, 4; 281 } 282 283 message Status { 284 // List of network addresses. 285 repeated Address addresses = 1; 286 287 // List of conditions of the Device. 288 repeated Condition conditions = 2; 289 290 NetworkConfigState network_config_state = 105; 291 292 ProxyConfigStatus proxy_config_status = 106; 293 294 // Device detailed information 295 DeviceInfo device_info = 3; 296 297 repeated ntt.iam.v1.PCR attestation_status = 4; 298 299 // Normalized Address. 300 NormalizedAddress normalized_address = 5; 301 302 ConnectionStatus connection_status = 6; 303 304 // Last change of connection_status 305 google.protobuf.Timestamp connection_status_change_time = 7; 306 307 // Interface addresses of the Device. 308 message Address { 309 // IPv4 or IPv6 address such as `203.0.113.5` (no suffix for subnet) 310 string address = 1; 311 312 // Always `InternalIP` 313 string type = 2; 314 } 315 316 // Condition holds status of each sub component or module of the device. 317 message Condition { 318 // The message describes the status. 319 string message = 1; 320 321 // The reason for the status. 322 string reason = 2; 323 324 // The status name. 325 string status = 3; 326 327 // Type name of the status. 328 string type = 4; 329 330 // When the status has been updated last time. 331 // Deprecated 332 google.protobuf.Timestamp last_heart_beat_time = 5; 333 334 // When the status has tuned into the current value. 335 google.protobuf.Timestamp last_transition_time = 6; 336 } 337 338 message NetworkConfigState { 339 NetworkConfigSource active_network_config_source = 1; 340 341 NetworkConfigSource desired_network_config_source = 2; 342 343 string desired_network_config_error = 3; 344 345 string default_netplan_config = 7; 346 347 string active_netplan_config = 8; 348 349 string desired_netplan_config = 9; 350 351 enum NetworkConfigSource { 352 UNKNOWN = 0; 353 354 DEFAULT_CONFIG = 1; 355 356 API_CONFIG = 2; 357 358 MERGED_DEFAULT_AND_API_CONFIG = 3; 359 360 PREVIOUS_MERGED_DEFAULT_AND_API_CONFIG = 4; 361 362 PREVIOUS_API_CONFIG = 5; 363 } 364 365 reserved 4, 5, 6; 366 } 367 368 message ProxyConfigStatus { 369 ProxyConfigSource active_config_source = 1; 370 371 ProxyConfigSource desired_config_source = 2; 372 373 string proxy_config_error = 3; 374 375 Spec.ProxyConfig default_config = 4; 376 377 Spec.ProxyConfig active_config = 5; 378 379 Spec.ProxyConfig api_config = 6; 380 381 enum ProxyConfigSource { 382 NO_CONFIG = 0; 383 384 DEFAULT_CONFIG = 1; 385 386 API_CONFIG = 2; 387 } 388 } 389 390 // Device Information 391 message DeviceInfo { 392 // The architecture of the CPU (and the software compilied for) (e.g. 393 // `arm64`) 394 string architecture = 1; 395 396 // The platform hardware (e.g. `raspberry`, `generic`) 397 string hardware = 7; 398 399 // Base OS name (e.g. `Linux`) 400 string operating_system = 2; 401 402 // OS kernel version 403 string kernel_version = 3; 404 405 // OS base Image name 406 string os_image = 4; 407 408 // Not used 409 string container_runtime_version = 5; 410 411 // Liquid OS version currently used. 412 string os_version = 6; 413 414 // Container driver name (e.g. `/var/lib/droplet/compose`) 415 string driver = 101; 416 417 HardwareInformation hardware_information = 102; 418 419 map<string, NetworkInterface> network_interfaces = 103; 420 421 ControlPlaneInterfaceInfo control_plane_interface_info = 104; 422 423 message HardwareInformation { 424 OS os = 1; 425 426 BIOS bios = 2; 427 428 System system = 3; 429 430 CPU cpu = 4; 431 432 Block block = 5; 433 434 Network network = 6; 435 436 GPU gpu = 7; 437 438 MemoryInfo memory_info = 23; 439 440 HailoInfo hailo_info = 20; 441 442 NvidiaInfo nvidia_info = 21; 443 444 repeated ModemStatus modem_status = 22; 445 446 message Capability { 447 string name = 1; 448 449 string description = 2; 450 } 451 452 message OS { 453 string operating_system = 1; 454 455 string kernel_version = 2; 456 457 string os_image = 3; 458 459 string container_runtime_version = 4; 460 } 461 462 // TODO: Add capabilities and size 463 message BIOS { 464 string vendor = 1; 465 466 string bios_version = 2; 467 468 string release_date = 3; 469 } 470 471 message System { 472 string manufacturer = 1; 473 474 string product_name = 2; 475 476 string version = 3; 477 478 string serial_number = 4; 479 480 Configuration configuration = 5; 481 482 message Configuration { 483 string chassis = 1; 484 485 string uuid = 2; 486 487 string sku_number = 3; 488 489 string family = 4; 490 } 491 } 492 493 message CPU { 494 repeated Processor processors = 1; 495 496 message Processor { 497 string vendor = 1; 498 499 string model = 2; 500 501 repeated Capability capabilities = 3; 502 503 uint32 num_threads = 4; 504 505 uint32 num_cores = 5; 506 507 uint32 num_enabled_cores = 6; 508 509 string name = 7; 510 511 string serial = 8; 512 513 int64 frequency_mhz = 9; 514 515 int64 max_frequency_mhz = 10; 516 517 repeated Cache cache_info = 11; 518 519 string driver = 12; 520 521 int64 latency = 13; 522 523 int64 clock = 14; 524 525 message Cache { 526 string type = 1; 527 528 int64 size_bytes = 2; 529 } 530 } 531 } 532 533 message Block { 534 repeated Disk disks = 1; 535 536 message Disk { 537 string name = 1; 538 539 int64 size_bytes = 2; 540 541 string drive_type = 3; 542 543 string vendor = 4; 544 545 string model = 5; 546 547 string serial_number = 6; 548 549 string wwn = 7; 550 551 repeated Partition partitions = 8; 552 553 message Partition { 554 string name = 1; 555 556 int64 size_bytes = 2; 557 558 string mount_point = 3; 559 560 string type = 4; 561 } 562 } 563 } 564 565 message Network { 566 repeated NIC nics = 1; 567 568 message NIC { 569 string name = 1; 570 571 string mac_address = 2; 572 573 bool virtual = 3; 574 575 string description = 4; 576 577 string product_name = 5; 578 579 string vendor = 6; 580 581 string subvendor = 7; 582 583 map<string, string> setting = 8; 584 } 585 } 586 587 message GPU { 588 repeated GraphicCard graphic_cards = 1; 589 590 message GraphicCard { 591 int64 index = 1; 592 593 PCIDevice device = 2; 594 } 595 } 596 597 // Revisit: May be just device ?? 598 message PCIDevice { 599 string address = 1; 600 601 string vendor = 2; 602 603 string product = 3; 604 605 string name = 4; 606 607 string subvendor = 5; 608 } 609 610 message MemoryInfo { 611 string description = 1; 612 613 int64 size_bytes = 2; 614 615 repeated MemoryBank memory_banks = 3; 616 617 message MemoryBank { 618 string description = 1; 619 620 string product = 2; 621 622 string vendor = 3; 623 624 string serial = 4; 625 626 string slot = 5; 627 628 int64 size_bytes = 6; 629 630 int64 frequency_hz = 7; 631 632 int32 width_bits = 8; 633 } 634 } 635 636 message HailoInfo { 637 string status = 1; 638 639 string cli_version = 2; 640 641 repeated HailoModuleInfo modules = 10; 642 643 message HailoModuleInfo { 644 string dev_id = 1; 645 646 string control_proto_version = 2; 647 648 string firmware_version = 3; 649 650 string logger_version = 4; 651 652 string board_name = 5; 653 654 string serial_number = 6; 655 656 string part_number = 7; 657 658 string product_name = 8; 659 660 string neural_network_core_clock_rate = 9; 661 } 662 } 663 664 message NvidiaInfo { 665 string status = 1; 666 667 string driver_version = 2; 668 669 string cuda_version = 3; 670 671 repeated GpuInfo gpus = 10; 672 673 message GpuInfo { 674 string id = 1; 675 676 string product_name = 2; 677 } 678 } 679 680 message ModemStatus { 681 Modem modem = 1; 682 683 message RegistrationSettings { 684 string drx_cycle = 1; 685 686 string mico_mode = 2; 687 } 688 689 message FiveGNr { RegistrationSettings registration_settings = 1; } 690 691 message Settings { 692 string apn = 1; 693 694 string ip_type = 2; 695 696 string password = 3; 697 698 string user = 4; 699 } 700 701 message InitialBearer { 702 string dbus_path = 1; 703 704 Settings settings = 2; 705 } 706 707 message Eps { 708 InitialBearer initial_bearer = 1; 709 710 string ue_mode_operation = 2; 711 } 712 713 message ThreeGpp { 714 FiveGNr fiveg_nr = 1; 715 716 repeated string enabled_locks = 2; 717 718 Eps eps = 3; 719 720 string imei = 4; 721 722 string operator_code = 5; 723 724 string operator_name = 6; 725 726 string packet_service_state = 7; 727 728 string pco = 8; 729 730 string registration_state = 9; 731 } 732 733 message Cdma { 734 string activation_state = 1; 735 736 string cdma1x_registration_state = 2; 737 738 string esn = 3; 739 740 string evdo_registration_state = 4; 741 742 string meid = 5; 743 744 string nid = 6; 745 746 string sid = 7; 747 } 748 749 message SignalQuality { 750 string recent = 1; 751 752 string value = 2; 753 } 754 755 message Generic { 756 repeated string access_technologies = 1; 757 758 repeated string bearers = 2; 759 760 string carrier_configuration = 3; 761 762 string carrier_configuration_revision = 4; 763 764 repeated string current_bands = 5; 765 766 repeated string current_capabilities = 6; 767 768 string current_modes = 7; 769 770 string device = 8; 771 772 string device_identifier = 9; 773 774 repeated string drivers = 10; 775 776 string equipment_identifier = 11; 777 778 string hardware_revision = 12; 779 780 string manufacturer = 13; 781 782 string model = 14; 783 784 repeated string own_numbers = 15; 785 786 string plugin = 16; 787 788 repeated string ports = 17; 789 790 string power_state = 18; 791 792 string primary_port = 19; 793 794 string primary_sim_slot = 20; 795 796 string revision = 21; 797 798 SignalQuality signal_quality = 22; 799 800 string sim = 23; 801 802 repeated string sim_slots = 24; 803 804 string state = 25; 805 806 string state_failed_reason = 26; 807 808 repeated string supported_bands = 27; 809 810 repeated string supported_capabilities = 28; 811 812 repeated string supported_ip_families = 29; 813 814 repeated string supported_modes = 30; 815 816 string unlock_required = 31; 817 818 repeated string unlock_retries = 32; 819 } 820 821 message SimStatus { 822 string dbus_path = 1; 823 824 string active = 2; 825 826 string eid = 3; 827 828 repeated string emergency_numbers = 4; 829 830 string esim_status = 5; 831 832 string gid1 = 6; 833 834 string gid2 = 7; 835 836 string iccid = 8; 837 838 string imsi = 9; 839 840 string operator_code = 10; 841 842 string operator_name = 11; 843 844 string removability = 12; 845 846 string sim_type = 13; 847 } 848 849 message Modem { 850 ThreeGpp three_g_pp = 1; 851 852 Cdma cdma = 2; 853 854 string dbus_path = 3; 855 856 Generic generic = 4; 857 858 map<string, SimStatus> sim_status = 7; 859 860 reserved 5, 6; 861 } 862 } 863 864 reserved 8; 865 } 866 867 // Network Interface 868 message NetworkInterface { 869 string interface_name = 1; 870 871 repeated string ip_address_v4 = 2; 872 873 repeated string external_ip_address_v4 = 3; 874 875 repeated string ip_address_v6 = 4; 876 877 repeated string external_ip_address_v6 = 5; 878 879 // Asinfo describes the ISP (ASN) details for the interface 880 // This is resolved automatically from the external_ip_address. 881 ASInfo as_info = 10; 882 883 // Carrier. 884 Carrier carrier = 14; 885 886 message ASInfo { 887 // AS Number string example AS7018 888 string asn = 1; 889 890 // AS Owner name example AT&T Services, Inc. 891 string name = 2; 892 893 // Domain name example att.com 894 string domain = 3; 895 896 // Routes exported from this ASN example 12.128.0.0/9 897 repeated string routes = 4; 898 899 // ASN Owner type example isp(AT&T) / hosting(google)/ business 900 // (Amazon) 901 string asn_type = 5; 902 } 903 904 message Carrier { 905 // Mobile network carrier name example AT&T 906 string name = 1; 907 908 // Mobile country code example 214 909 string mobile_country_code = 2; 910 911 // Mobile network code example 7 912 string mobile_network_code = 3; 913 914 // Mobile location area code example 2862 915 string location_area_code = 4; 916 } 917 } 918 919 message ControlPlaneInterfaceInfo { 920 string active_control_plane_interface = 1; 921 922 bool usesProxy = 2; 923 924 // is_fallback would be true if droplet could not connect using the best 925 // default route and explicitly uses this interface to connect to api 926 // endpoint 927 bool is_fallback = 3; 928 } 929 } 930 931 message NormalizedAddress { 932 // Postal code 933 string postal_code = 1; 934 935 // Country code example US, JP 936 string country_code = 2; 937 938 // Continent, e.g. North America, Asia 939 string continent = 3; 940 941 string continent_id = 4; 942 943 // Country name example United States, Japan 944 string country = 5; 945 946 string country_id = 6; 947 948 // Probe Location Administrative Area level 1 name, e.g. California 949 // (state), Chiba (prefecture) 950 string admin_area1 = 7; 951 952 string admin_area1_id = 8; 953 954 // Probe Location Administrative Area level 2 name, e.g. Santa Clara 955 // (county), Tateyama (town) 956 string admin_area2 = 9; 957 958 string admin_area2_id = 10; 959 960 // Probe Location Administrative Area level 3 name, e.g. Sunnyvale (city) 961 string admin_area3 = 11; 962 963 string admin_area3_id = 12; 964 965 // Probe Location Administrative Area level 4 name, e.g. Sunnyvale (city) 966 string admin_area4 = 13; 967 968 string admin_area4_id = 14; 969 970 // Original address. 971 string address = 15; 972 973 // coordinates 974 google.type.LatLng coordinates = 16; 975 976 // location accuracy in meters 977 double accuracy = 17; 978 } 979 980 enum ConnectionStatus { 981 CONNECTION_STATUS_UNSPECIFIED = 0; 982 983 CONNECTED = 1; 984 985 DISCONNECTED = 2; 986 } 987 } 988 989 message PublicListingSpec { 990 bool enabled = 1; 991 992 google.protobuf.FieldMask field_mask = 2; 993 } 994 }