mlm_insights.core.profile_readers package

Subpackages

Submodules

mlm_insights.core.profile_readers.local_profile_reader module

class mlm_insights.core.profile_readers.local_profile_reader.LocalProfileReader(path: str)

Bases: ProfileReader

Reads Insights Profile from the local file system.
The profile read using this profile reader is subsequently used as part of the Insights Test/Test Suites component.

Configuration

path: str
  • The path to the profile stored in local file system.

Sample code

def main():
    local_profile_reader = LocalProfileReader(path="/location/profiles/profile.bin")
    profile_reader_result =  local_profile_reader.read()
    # The LocalProfileReader.read() method returns a ProfileReaderResult object,
    #  which contains the profile.

    profile = profile_reader_result.profile

    # This profile file can be converted to JSON format for more clarity.
    json_profile = profile.to_json()
read(**kwargs: Any) ProfileReaderResult
Parameters:
kwargs:
  • Extra keyword arguments.

Returns:
profile_reader_result: ProfileReaderResult
  • An object that contains profile content (accessible as profile_reader_result.profile)

mlm_insights.core.profile_readers.oci_object_storage_profile_reader module

class mlm_insights.core.profile_readers.oci_object_storage_profile_reader.OCIObjectStorageProfileReader(path: str, storage_options: Dict[str, Any] = {}, **kwargs: Any)

Bases: ProfileReader

Reads Insights Profile from a user-provided Oracle Cloud Infrastructure Object Storage bucket.
The profile read using this profile reader is subsequently used as part of the Insights Test/Test Suites component.

Configuration

path: str
  • The path to the profile stored in OCI Object Storage.

  • Of the form oci://<location_of_file>.

storage_options: Dict[str, Any]
  • A dictionary containing optional configuration options for OCI Object Storage.

  • Used to authenticate the file system using OCI authentication.

Sample code

def main():
    oci_object_storage_profile_reader = OCIObjectStorageProfileReader(path="oci://location/profiles/profile.bin")
    profile_reader_result =  oci_object_storage_profile_reader.read()
    # The OCIObjectStorageProfileReader.read() method returns a ProfileReaderResult object,
    #  which contains the profile.

    profile = profile_reader_result.profile

    # This profile file can be converted to JSON format for more clarity.
    json_profile = profile.to_json()
read(**kwargs: Any) ProfileReaderResult
Parameters:
kwargs:
  • Extra keyword arguments.

Returns:
profile_reader_result: ProfileReaderResult
  • An object that contains profile content (accessible as profile_reader_result.profile)

validate() None

Validates whether file path is passed to profile reader.

Raises

ProfileReadException
  • If the validation fails.

mlm_insights.core.profile_readers.profile_reader_result module

class mlm_insights.core.profile_readers.profile_reader_result.ProfileReaderResult(profile: mlm_insights.core.profiles.profile.Profile)

Bases: object

profile: Profile

Module contents