सेवा बंडल का मेटाडेटा

इस पेज पर, सेवा बंडल के मेटाडेटा फ़ील्ड में ज़रूरी और वैकल्पिक फ़ील्ड इस्तेमाल करने का तरीका बताया गया है.

ज़रूरी मेटाडेटा

सेवा बंडल के एक्ज़ीक्यूशन मॉडल के लिए, हर सेवा बंडल को यह मेटाडेटा तय करना होता है:

sdv_service_bundle_metadata {
  # Name of the service bundle.
  #
  # Must follow SDV service naming convention rules.
  # Ref: https:/automotive/sdv/core-areas/naming-conventions
  #
  # When using VSIDL catalog and middleware generation, this name must be
  # equal to the service bundle name defined in the catalog.
  name: "TheNameOfTheServiceBundle"

  # Service Bundle Version Number.
  # Must be non-negative number.
  version_number: 1

  # Service Bundle Version Name.
  # Must be non-empty string.
  version_name: "1.0 alpha"

  # Path to the native library to be loaded as service bundle.
  # Must be the relative path from the APEX root directory
  native_library_path: "lib64/libservice_bundle.so"
}
# Service bundle one.
sdv_service_bundle_metadata {
  name: "ServiceBundleOne"
  ...
}
# Service bundle two.
sdv_service_bundle_metadata {
  name: "ServiceBundleTwo"
  ...
}

वैकल्पिक मेटाडेटा

एसडीवी की कुछ खास सुविधाओं के लिए, वैकल्पिक मेटाडेटा का इस्तेमाल किया जा सकता है.

ऑर्केस्ट्रेशन का मेटाडेटा

SDV ऑर्केस्ट्रेशन कॉन्फ़िगरेशन, सेवा बंडलों के स्टार्टअप और शटडाउन के व्यवहार को कंट्रोल करने का तरीका उपलब्ध कराता है. SDV ऑर्केस्ट्रेशन कॉन्फ़िगरेशन, नियमों का एक सेट तय करता है. इससे यह तय होता है कि सर्विस बंडल इंस्टेंस पर कार्रवाइयां कब और कैसे की जाएंगी. ये नियम, वाहन, पावर, और कस्टम मोड पर आधारित होते हैं.

ऑर्केस्ट्रेशन कॉन्फ़िगरेशन को सेवा के बंडल से जोड़ने के लिए, prebuilt_etc मॉड्यूल का पाथ दें. इसके लिए, वैकल्पिक orchestration_config_path फ़ील्ड का इस्तेमाल करें:

sdv_service_bundle_metadata {
  ...
  # Path to the orchestration config file.
  # Warning: Shall be relative path to the APEX root directory.
  orchestration_config_path: "etc/configuration/orchestration/configuration.textproto"
}

अनुमति से जुड़ी नीति का पाथ

एसडीवी की अनुमति देने से जुड़ी नीति, सेवा बंडल के लिए अनुमतियां तय करने का तरीका बताती है. अनुमति देने से जुड़ी नीति से यह तय होता है कि सेवा बंडल कौनसी कार्रवाइयां कर सकता है. जैसे, पब्लिश करना, सदस्यता लेना, सेवा देना या कॉल करना.

किसी सेवा बंडल से अनुमति देने की नीति को जोड़ने के लिए, prebuilt_etc मॉड्यूल का पाथ, authorization_policy_path फ़ील्ड में दें. यह फ़ील्ड ज़रूरी नहीं है:

sdv_service_bundle_metadata {
  ...
  # Path to the authorization policy file.
  # Warning: Shall be relative path to the APEX root directory.
  authorization_policy_path: "etc/authz/permissions.textproto"
}

VSIDL प्रोवाइडर का मेटाडेटा

VSIDL उपलब्ध कराने वाली कंपनी का मेटाडेटा, सेवा बंडलों को Diagnostics और SOME/IP प्लैटफ़ॉर्म एजेंट के साथ इंटिग्रेट करने के तरीके का हिस्सा है.

किसी सेवा बंडल के साथ VSIDL सेवा देने वाली कंपनी का मेटाडेटा जोड़ने के लिए, prebuilt_etc फ़ाइलों का पाथ दें. इन फ़ाइलों में, जनरेट किया गया मेटाडेटा होता है. यह पाथ, vsidl_schemas_path / diagnostics_config_path / (सिर्फ़ SOME/IP कॉन्फ़िगरेशन APEX) external_service_bundle_metadata_path फ़ील्ड में दिया जाता है. यह फ़ील्ड ज़रूरी नहीं है:

sdv_service_bundle_metadata {
  ...
  # Path to the file with protobuf schemas extracted from bundle's VSIDL definition.
  # Warning: Must be relative path to the APEX root directory.
  vsidl_schemas_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-vsidl-config.binpb"

  # Path to the diagnostics config file.
  # Warning: Shall be relative path to the APEX root directory.
  diagnostics_config_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-diag-config.binpb"

  # Path to the SOME/IP config file. To be used in SOME/IP configuration apex only.
  # Warning: Must be relative path to the APEX root directory.
  external_protocol_mapping_path: "etc/vsidl_provider/someip-config.binpb"
}

ज़्यादा जानने के लिए, VSIDL Provider की खास जानकारी देखें.

टैग का मेटाडेटा लॉग करना

लॉग टैग एट्रिब्यूट, सेवा बंडल से जनरेट किए गए लॉग के लिए यूनीक आइडेंटिफ़ायर तय करता है. अगर इस एट्रिब्यूट को तय नहीं किया जाता है, तो पैकेज का नाम, सेवा बंडल का नाम, और इंस्टेंस का नाम इस्तेमाल करके, डिफ़ॉल्ट टैग अपने-आप जनरेट हो जाता है. ज़्यादा जानकारी के लिए, छोटा और यूनीक लॉग टैग तय करें.

कस्टम मेटाडेटा

कस्टम मेटाडेटा की मदद से, OEM और वेंडर, सेवा के बंडल के कुछ खास मेटाडेटा तय कर सकते हैं

sdv_service_bundle_metadata {
  ...
  # Custom service bundle metadata map.
  # Key is a string, value is a string.
  #
  # 1st custom metadata value.
  custom_metadata {
    key: "question"
    value: "Answer to the Ultimate Question of Life, the Universe, and Everything"
  }
  # 2nd custom metadata value.
  custom_metadata {
    key: "answer" value: "42"
  }
}
sdv_service_bundle_metadata {
  ...
  # Custom metadata values are stored in etc/.
  custom_metadata {
    key: "path_to_custom_metadata"
    value: "etc/configuration/file"
  }
}

पूरा उदाहरण

# proto-file: //system/software_defined_vehicle/core_services/service_bundles_registry/proto/sdv_service_bundles_manifest.proto
# proto-message: SdvServiceBundleManifestEntry

# SDV service bundle.
sdv_service_bundle_metadata {
  # Name of the service bundle.
  # Must follow SDV service naming convention rules.
  name: "TheNameOfTheServiceBundle"

  # Service Bundle Version Number.
  # Must be non-negative number.
  version_number: 42

  # Service Bundle Version Name.
  # Must be non-empty string.
  version_name: "42.0.beta"

  # Path to the native library to be loaded as service bundle.
  # Must be the relative path from the APEX root directory.
  native_library_path: "lib64/libservice_bundle.so"

  # The log tag used for Android logging for the service bundle.
  # If not specified, a tag derived from service bundle FQIN will be used.
  log_tag: "current_service_bundle"

  # Path to the orchestration config file.
  # Warning: Shall be relative path to the APEX root directory.
  orchestration_config_path: "etc/configuration/orchestration/configuration.textproto"

  # Path to the file with protobuf schemas extracted from bundle's VSIDL definition.
  # Warning: Must be relative path to the APEX root directory.
  vsidl_schemas_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-vsidl-config.binpb"

  # Path to the diagnostics config file.
  # Warning: Must be relative path to the APEX root directory.
  diagnostics_config_path: "etc/vsidl_provider/TheNameOfTheServiceBundle-diag-config.binpb"

  # Path to the SOME/IP config file. To be used in SOME/IP configuration apex only.
  # Warning: Must be relative path to the APEX root directory.
  external_protocol_mapping_path: "etc/vsidl_provider/someip-config.binpb"

  # Custom service bundle metadata string.
  # Key is a string, value is a string.
  custom_metadata {
    key: "key" value: "value"
  }

  # Custom metadata values are stored in etc/.
  custom_metadata {
    key: "path_to_custom_metadata"
    value: "etc/configuration/file"
  }
}

संदर्भ