configchannel

Description

Provides methods to access and modify many aspects of configuration channels.

Namespace:

configchannel

Method: channelExists

Description:

Check for the existence of the config channel provided.

Parameters:

  • string sessionKey

  • string channelLabel - Channel to check for.

Returns:

  • int existence - 1 if exists, 0 otherwise

Method: create

Description:

Create a new global config channel. Caller must be at least a config admin or an organization admin.

Parameters:

  • string sessionKey

  • string channelLabel

  • string channelName

  • string channelDescription

Returns:

  • * struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: create

Description:

Create a new global config channel. Caller must be at least a config admin or an organization admin.

Parameters:

  • string sessionKey

  • string channelLabel

  • string channelName

  • string channelDescription

  • string channelType - The channel type either 'normal' or 'state'.

Returns:

  • * struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: create

Description:

Create a new global config channel. Caller must be at least a config admin or an organization admin.

Parameters:

  • string sessionKey

  • string channelLabel

  • string channelName

  • string channelDescription

  • string channelType - The channel type either 'normal' or 'state'.

  • struct - path info

    • string "contents" - Contents of the init.sls file

    • boolean "contents_enc64" - Identifies base64 encoded content(default: disabled)

Returns:

  • * struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: createOrUpdatePath

Description:

Create a new file or directory with the given path, or update an existing path.

Parameters:

  • string sessionKey

  • string configChannelLabel

  • string path

  • boolean isDir - True if the path is a directory, False if it is a file.

  • struct - path info

    • string "contents" - Contents of the file (text or base64 encoded if binary or want to preserve control characters like LF, CR etc.)(only for non-directories)

    • boolean "contents_enc64" - Identifies base64 encoded content (default: disabled, only for non-directories)

    • string "owner" - Owner of the file/directory.

    • string "group" - Group name of the file/directory.

    • string "permissions" - Octal file/directory permissions (eg: 644)

    • string "selinux_ctx" - SELinux Security context (optional)

    • string "macro-start-delimiter" - Config file macro start delimiter. Use null or empty string to accept the default. (only for non-directories)

    • string "macro-end-delimiter" - Config file macro end delimiter. Use null or empty string to accept the default. (only for non-directories)

    • int "revision" - next revision number, auto increment for null

    • boolean "binary" - mark the binary content, if True, base64 encoded content is expected (only for non-directories)

Returns:

  • * struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Available since API version: 10.2

Description:

Create a new symbolic link with the given path, or update an existing path in config channel of 'normal' type.

Parameters:

  • string sessionKey

  • string configChannelLabel

  • string path

  • struct - path info

    • string "target_path" - The target path for the symbolic link

    • string "selinux_ctx" - SELinux Security context (optional)

    • int "revision" - next revision number, skip this field for automatic revision number assignment

Returns:

  • * struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Available since API version: 10.2

Method: deleteChannels

Description:

Delete a list of global config channels. Caller must be a config admin.

Parameters:

  • string sessionKey

  • array :

    • string - configuration channel labels to delete.

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: deleteFileRevisions

Description:

Delete specified revisions of a given configuration file

Parameters:

  • string sessionKey

  • string channelLabel - Label of config channel to lookup on.

  • string filePath - Configuration file path.

  • array :

    • int - List of revisions to delete

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: deleteFiles

Description:

Remove file paths from a global channel.

Parameters:

  • string sessionKey

  • string channelLabel - Channel to remove the files from.

  • array :

    • string - file paths to remove.

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: deployAllSystems

Description:

Schedule an immediate configuration deployment for all systems subscribed to a particular configuration channel.

Parameters:

  • string sessionKey

  • string channelLabel - The configuration channel’s label.

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: deployAllSystems

Description:

Schedule a configuration deployment for all systems subscribed to a particular configuration channel.

Parameters:

  • string sessionKey

  • string channelLabel - The configuration channel’s label.

  • dateTime.iso8601 date - The date to schedule the action

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: deployAllSystems

Description:

Schedule a configuration deployment of a certain file for all systems subscribed to a particular configuration channel.

Parameters:

  • string sessionKey

  • string channelLabel - The configuration channel’s label.

  • string filePath - The configuration file path.

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: deployAllSystems

Description:

Schedule a configuration deployment of a certain file for all systems subscribed to a particular configuration channel.

Parameters:

  • string sessionKey

  • string channelLabel - The configuration channel’s label.

  • string filePath - The configuration file path.

  • dateTime.iso8601 date - The date to schedule the action

Returns:

  • int - 1 on success, exception thrown otherwise.

Method: getDetails

Description:

Lookup config channel details.

Parameters:

  • string sessionKey

  • string channelLabel

Returns:

  • * struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: getDetails

Description:

Lookup config channel details.

Parameters:

  • string sessionKey

  • int channelId

Returns:

  • * struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: getEncodedFileRevision

Description:

Get revision of the specified configuration file and transmit the contents as base64 encoded.

Parameters:

  • string sessionKey

  • string configChannelLabel - label of config channel to lookup on

  • string filePath - config file path to examine

  • int revision - config file revision to examine

Returns:

  • * struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Method: getFileRevision

Description:

Get revision of the specified config file

Parameters:

  • string sessionKey

  • string configChannelLabel - label of config channel to lookup on

  • string filePath - config file path to examine

  • int revision - config file revision to examine

Returns:

  • * struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Method: getFileRevisions

Description:

Get list of revisions for specified config file

Parameters:

  • string sessionKey

  • string channelLabel - label of config channel to lookup on

  • string filePath - config file path to examine

Returns:

  • array :

  • struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Method: listFiles

Description:

Return a list of files in a channel.

Parameters:

  • string sessionKey

  • string channelLabel - label of config channel to list files on.

Returns:

  • array :

  • struct - Configuration File information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • dateTime.iso8601 "last_modified" - Last Modified Date

Method: listGlobals

Description:

List all the global config channels accessible to the logged-in user.

Parameters:

  • string sessionKey

Returns:

  • array :

  • struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • string "type"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: listSubscribedSystems

Description:

Return a list of systems subscribed to a configuration channel

Parameters:

  • string sessionKey

  • string channelLabel - label of config channel to list subscribed systems.

Returns:

  • array :

  • struct - system

    • int "id"

    • string "name"

Method: lookupChannelInfo

Description:

Lists details on a list channels given their channel labels.

Parameters:

  • string sessionKey

  • array :

    • string - configuration channel label

Returns:

  • array :

  • struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: lookupFileInfo

Description:

Given a list of paths and a channel, returns details about the latest revisions of the paths.

Parameters:

  • string sessionKey

  • string channelLabel - label of config channel to lookup on

  • array :

    • string - List of paths to examine.

Returns:

  • array :

  • struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Available since API version: 10.2

Method: lookupFileInfo

Description:

Given a path, revision number, and a channel, returns details about the latest revisions of the paths.

Parameters:

  • string sessionKey

  • string channelLabel - label of config channel to lookup on

  • string path - path of file/directory

  • int revsion - The revision number.

Returns:

  • * struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.

Available since API version: 10.12

Method: scheduleFileComparisons

Description:

Schedule a comparison of the latest revision of a file against the version deployed on a list of systems.

Parameters:

  • string sessionKey

  • string channelLabel - Label of config channel

  • string path - File path

  • array :

    • long - The list of server id that the comparison will be performed on

Returns:

  • int actionId - The action id of the scheduled action

Method: update

Description:

Update a global config channel. Caller must be at least a config admin or an organization admin, or have access to a system containing this config channel.

Parameters:

  • string sessionKey

  • string channelLabel

  • string channelName

  • string description

Returns:

  • * struct - Configuration Channel information

    • int "id"

    • int "orgId"

    • string "label"

    • string "name"

    • string "description"

    • struct "configChannelType"

  • struct - Configuration Channel Type information

    • int "id"

    • string "label"

    • string "name"

    • int "priority"

Method: updateInitSls

Description:

Update the init.sls file for the given state channel. User can only update contents, nothing else.

Parameters:

  • string sessionKey

  • string configChannelLabel

  • struct - path info

    • string "contents" - Contents of the init.sls file

    • boolean "contents_enc64" - Identifies base64 encoded content(default: disabled)

    • int "revision" - next revision number, auto increment for null

Returns:

  • * struct - Configuration Revision information

    • string "type"

    • file

    • directory

    • symlink

    • string "path" - File Path

    • string "target_path" - Symbolic link Target File Path. Present for Symbolic links only.

    • string "channel" - Channel Name

    • string "contents" - File contents (base64 encoded according to the contents_enc64 attribute)

    • boolean "contents_enc64" - Identifies base64 encoded content

    • int "revision" - File Revision

    • dateTime.iso8601 "creation" - Creation Date

    • dateTime.iso8601 "modified" - Last Modified Date

    • string "owner" - File Owner. Present for files or directories only.

    • string "group" - File Group. Present for files or directories only.

    • int "permissions" - File Permissions (Deprecated). Present for files or directories only.

    • string "permissions_mode" - File Permissions. Present for files or directories only.

    • string "selinux_ctx" - SELinux Context (optional).

    • boolean "binary" - true/false , Present for files only.

    • string "sha256" - File’s sha256 signature. Present for files only.

    • string "macro-start-delimiter" - Macro start delimiter for a config file. Present for text files only.

    • string "macro-end-delimiter" - Macro end delimiter for a config file. Present for text files only.