submodule openconfig-platform-common {

  yang-version "1";

  belongs-to openconfig-platform {
    prefix "oc-platform";
  }

  import openconfig-platform-types { prefix oc-platform-types; }
  import openconfig-extensions { prefix oc-ext; }
  import openconfig-types { prefix oc-types; }

  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "This modules contains common groupings that are used in multiple
    components within the platform module.";

  oc-ext:openconfig-version "0.21.1";

  revision "2022-12-19" {
    description
      "Update last-high-watermark timestamp documentation.";
    reference "0.21.1";
  }

  revision "2022-09-26" {
    description
      "Add state data for base-mac-address.";
    reference "0.21.0";
  }

  revision "2022-08-31" {
    description
      "Add new state data for component CLEI code.";
    reference "0.20.0";
  }

  revision "2022-07-28" {
    description
      "Add grouping for component power management";
    reference "0.19.0";
  }

  revision "2022-07-11" {
    description
      "Add switchover ready";
    reference "0.18.0";
  }

  revision "2022-06-10" {
    description
      "Specify units and epoch for switchover and reboot times.";
    reference "0.17.0";
  }

  revision "2022-04-21" {
    description
      "Add platform utilization.";
    reference "0.16.0";
  }

  // extension statements

  // feature statements

  // identity statements

  // typedef statements

  // grouping statements

  grouping platform-utilization-top {
    description
      "Top level of utilization.";

    container utilization {
      description
        "Utilization of the component.";

      container resources {
        description
          "Enclosing container for the resources in this component.";

        list resource {
          key "name";
          description
            "List of resources, keyed by resource name.";

          leaf name {
            type leafref {
              path "../config/name";
            }
            description
              "References the resource name.";
          }

          container config {
            description
              "Configuration data for each resource.";

            uses platform-utilization-resource-config;
          }

          container state {
            config false;
            description
              "Operational state data for each resource.";

            uses platform-utilization-resource-config;
            uses platform-utilization-resource-state;
          }
        }
      }
    }
  }

  grouping platform-utilization-resource-config {
    description
      "Configuration data for utilization resource.";

    leaf name {
      type string;
      description
        "Resource name within the component.";
    }
  }

  grouping platform-utilization-resource-state {
    description
      "Operational state data for utilization resource.";

    leaf used {
      type uint64;
      description
        "Number of entries currently in use for the resource.";
    }

    leaf committed {
      type uint64;
      description
        "Number of entries currently reserved for this resource. This is only
        relevant to tables which allocate a block of resource for a given
        feature.";
    }

    leaf free {
      type uint64;
      description
        "Number of entries available to use.";
    }

    leaf max-limit {
      type uint64;
      description
        "Maximum number of entries available for the resource. The value
        is the theoretical maximum resource utilization possible.";
    }

    leaf high-watermark {
      type uint64;
      description
        "A watermark of highest number of entries used for this resource.";
    }

    leaf last-high-watermark {
      type oc-types:timeticks64;
      description
        "The timestamp when the high-watermark was last updated. The value
		  is the timestamp in nanoseconds relative to the Unix Epoch
		  (Jan 1, 1970 00:00:00 UTC).";
    }
  }

  grouping component-power-management {
    description
      "Common grouping for managing component power";

    leaf power-admin-state {
      type oc-platform-types:component-power-type;
      default POWER_ENABLED;
      description
        "Enable or disable power to the component";
    }
  }

  // data definition statements

  // augment statements

  // rpc statements

  // notification statements
}