API Class for manipulating config profiles.

### Hierarchy

- ConfigApi
  - ConfigProfiles

## Index

### Constructors

- constructor

### Properties

- mConfig

### Methods

- buildProfile
- defaultGet
- defaultSet
- exists
- findProfile
- get
- getProfileNameFromPath
- getProfilePathFromName
- set

## Constructors

### constructor

- new ConfigProfiles(mConfig: Config): ConfigProfiles

- Inherited from ConfigApi.constructor

  - Defined in @zowe/imperative/src/config/src/api/ConfigApi.ts:17

  #### Parameters

  - ##### mConfig: Config

  #### Returns ConfigProfiles

## Properties

### Protected mConfig

mConfig: Config

Inherited from ConfigApi.mConfig

- Defined in @zowe/imperative/src/config/src/api/ConfigApi.ts:18

## Methods

### buildProfile

- buildProfile(path: string, profiles: {}): {}

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:146

  Build the set of properties contained within a set of nested profiles.

  #### Parameters

  - ##### path: string

    The dotted path of desired location.

  - ##### profiles: {}

    A set of nested profile objects.

    - ##### [key: string]: IConfigProfile

  #### Returns {}

  The desired profile object. An empty object if profiles is empty.

  - ##### [key: string]: string

### defaultGet

- defaultGet(profileType: string): {}

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:96

  Get the profile contents for the default profile of the specified type of profile within the currently active layer.

  #### Parameters

  - ##### profileType: string

    The name of the desired type of profile (like zosmf).

  #### Returns {}

  An object containing the desired profile, for example {"host": "lpar.your.domain.net", port: 1234}

  - ##### [key: string]: string

### defaultSet

- defaultSet(profileType: string, value: string): void

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:82

  Set the default value for the specified type of profile within the currently active layer.

  #### Parameters

  - ##### profileType: string

    The name of the desired type of profile (like zosmf).

  - ##### value: string

    The dotted node path to the profile (like ca32.zosmf).

  #### Returns void

### exists

- exists(path: string): boolean

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:70

  Reports whether or not a profile exists at the specified location.

  #### Parameters

  - ##### path: string

    The dotted path of desired location.

  #### Returns boolean

  True if a profile exists. False otherwise.

### Private findProfile

- findProfile(path: string, profiles: {}): IConfigProfile

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:172

  Find a profile at a specified location from within a set of nested profiles.

  #### Parameters

  - ##### path: string

    The dotted path of desired location.

  - ##### profiles: {}

    A set of nested profile objects.

    - ##### [key: string]: IConfigProfile

  #### Returns IConfigProfile

  The profile object that was found. null if not found.

### get

- get(path: string, mustExist?: boolean): {}

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:55

  Get the profile object located at the specified location.

  #### Parameters

  - ##### path: string

    The dotted path of the location at which to set the profile.

  - ##### Optional mustExist: boolean

    If false, outer layer profile values will still be returned when the dotted path does not exist. Default is true.

  #### Returns {}

  - ##### [key: string]: string

### getProfileNameFromPath

- getProfileNameFromPath(path: string): string

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:124

  Obtain the profile name (either nested or not) based on a property path.

  note

    This may be useful for supporting token authentication in a nested configuration

  #### Parameters

  - ##### path: string

    The property path.

  #### Returns string

  The corresponding profile name.

### getProfilePathFromName

- getProfilePathFromName(shortPath: string): string

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:109

  Expands a short path into an expanded path.

  #### Parameters

  - ##### shortPath: string

    The short path.

  #### Returns string

  The expanded path.

### set

- set(path: string, profile: IConfigProfile): void

- - Defined in @zowe/imperative/src/config/src/api/ConfigProfiles.ts:30

  Set a profile object at the location identified by the path within the currently active layer.

  #### Parameters

  - ##### path: string

    The dotted path of the location in which to set the profile.

  - ##### profile: IConfigProfile

    The JSON profile object to set into the specified location,

  #### Returns void

Generated using TypeDoc