Application inputs

Use the APIs in this category to add questions and their responses. These questions are displayed on the Resiliency Platform console.

add_question

Description: Use this interface to add questions to complete the discovery of an application instance.

These questions are displayed on the Resiliency Platform console if the application instance is partially discovered and user inputs are required to complete the discovery.

The following table lists the questions that you can add.

Table: Questions and error messages

Question data field

Description

Expected value

QID

Message ID for the question text. A whole number denoting the question number.

Any positive number. This is a mandatory field.

QText

The question text.

Any text. This is a mandatory field.

QDescription

Description of the question.

Any text. This is an optional field.

Mandatory

Define this if an answer is mandatory to the question.

Yes or no. This is a mandatory field.

IsError

Define this if an error occurs for a question.

Yes or no. This is an optional field.

Encrypted

Define this if the answer needs encryption.

Yes or no. This is an optional field. Is set to "no" by default.

ErrorCode

Error code of the error message. If the response received is incorrect user needs to set this field.

Any positive number. This is an optional field.

ErrorMsg

Error message. If the response received is incorrect user needs to set this field.

Any text. This is an optional field.

Between an error code and an error message any one must be mentioned in case of error. An error message is preferred.

Is mandatory: No

Input parameter: Application instance object, question data

Return value: NA

Example:

my $qid1 = {	
		'QID' => 1,
		'QDescription' => 'Specify the administrator user name to 
				start the above instance.',
				'Mandatory' => 'yes',
		'QText' => 'Administrator user name for this instance',
		'Encrypted' => 'no'
};
$appInstObj->add_question($qid1);
get_qresponse

Description: This interface returns the response to the questions which you have defined using the add_question API. You can call this API when you need responses to the questions. The responses assist in completing the application discovery.

Is mandatory: No

Input parameter: String: Question ID

Return value: Response to the question ID if successful, else undefined.

Example:

$appInstObj->get_qresponse($qid);

Where $qid is the question ID.

set_qresponse

Description: Use this interface to define an error code and error message in response to any error that occurs for a particular question ID.

Is mandatory: No

Input parameter: String: Error code, error message, question ID

Return value: 0 with question data set with an error code and error message, else any positive number.

Example:

$appInstObj->set_qresponse($error_code, $error_string, $qid);