Options
All
  • Public
  • Public/Protected
  • All
Menu

Class V1ProfileRead

The V1ProfileRead class is for reading V1 profiles from disk. V1 profiles are not supported as of Zowe V3. Profiles should only be read for the purpose of converting the V1 profiles to a current zowe client configuration. All "fs" calls are wrapped here and errors are transformed to ImperativeError for error handling/flow throughout Imperative.

export
internal

Hierarchy

  • V1ProfileRead

Index

Properties

Static Private ERROR_ID

ERROR_ID: string = "V1ProfileRead Read Error"

Error IO tag for Imperative Errors

static
memberof

V1ProfileRead

Methods

Static Private crashInTeamConfigMode

  • crashInTeamConfigMode(): void

Static Private fileToProfileName

  • fileToProfileName(file: string, ext: string): string

Static getAllProfileDirectories

  • getAllProfileDirectories(profileRootDirectory: string): string[]
  • Accepts the profiles root directory and returns all directories within. The directories within the root directory are all assumed to be profile type directories (potentially containing a meta file and profiles of that type).

    static
    memberof

    V1ProfileRead

    Parameters

    • profileRootDirectory: string

      The profiles root directory to obtain all profiles from.

    Returns string[]

    • The list of profiles returned or a blank array

Static getAllProfileNames

  • getAllProfileNames(profileTypeDir: string, ext: string, metaNameForType: string): string[]
  • Accepts the profile directory location for a type, reads all filenames, and returns a list of profile names that are present within the directory (excluding the meta profile)

    static
    memberof

    V1ProfileRead

    Parameters

    • profileTypeDir: string

      The directory for the type

    • ext: string

      the extension for the profile files (normally YAML)

    • metaNameForType: string

      the meta name for this type

    Returns string[]

    • A list of all profile names (without path/ext)

Static readMetaFile

  • Read the profile meta file using Yaml "safeLoad" (ensures that no code executes, etc. during the load). The meta profile file for a type contains the default profile specification. The meta profile is ALWAYS in YAML format (controlled exclusively by the Imperative framework).

    static
    memberof

    V1ProfileRead

    Type parameters

    Parameters

    • path: string

      The path to the meta profile

    Returns IMetaProfile<T>

    • The meta profile

Static readProfileFile

  • readProfileFile(filePath: string, type: string): IProfile
  • Read a profile from disk. Profiles are always assumed to be YAML (YAML "safeLoad" is invoked to perform the load).

    static
    memberof

    V1ProfileRead

    Parameters

    • filePath: string

      Path to the profile.

    • type: string

      The profile type; used to populate the "type" in the profile object (type property not persisted on disk).

    Returns IProfile

    • The profile object.

Generated using TypeDoc