Unsupported content

 

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

DeployJob - setAdvanceDeployJobPhaseScheduleWithSNMPNotificationByDBKey

DeployJob - setAdvanceDeployJobPhaseScheduleWithSNMPNotificationByDBKey

Description :

This command works only with advanced Deploy Jobs. This command first clears all schedules set for this Deploy Job, then lets you set a schedule for each phase of the Deploy Job with an SNMP notifiction on each step that was secheduled. You can also specify that specific phases not be scheduled, or indicate that the schedule should start after the previous phase.

The simulateType argument is a string that indicates how the simulate phase should be scheduled. You can set this string to one of the following values:

  • NotScheduled - Indicates the simulate phase should not occur. If you set simulateType to NotScheduled, you should set simulateDateString to a blank string.
  • AtTime - Indicates the simulate phase should start at the time you specify in simulateDateString.

The stageType argument is a string that indicates how the stage phase should be scheduled. You can set this string to one of the following values:

  • NotScheduled - Indicates the stage phase should not occur. If you set stageType to NotScheduled, you should set stageDateString to a blank string.
  • AfterPreviousPhase - Indicates that the stage phase should start after the previous phase has successfully completed.
  • AtTime - Indicates the stage phase should start at the time you specify in stageDateString.

The commitType argument is a string that indicates how the commit phase should be scheduled. You can set this string to one of the following values:

  • NotScheduled - Indicates the commit phase should not occur. If you set commitType to NotScheduled, you should set commitDateString to a blank string.
  • AfterPreviousPhase - Indicates that the commit phase should start after the previous phase has successfully completed.
  • AtTime - Indicates the commit phase should start at the time you specify in commitDateString.

The following rules apply to the use of this command: <ol>
Used for advanced Deploy Jobs only.
All time strings must be formatted as follows: YYYY-MM-DD HH:MM:SS
All provided schedule times must occur after the previous phase scheduled time.
You cannot set simulateType to AfterPreviousPhase.
If you specify the AtTime type option for a phase, then you must provide a valid time string for this phase. If you specify any other type option, the time string is ignored -- we recommend that you use a blank string ("") for the time string in this case.
If the simulate phase is not enabled for the Deploy Job, then you must set simulateType to NotScheduled. Other settings will generate an error.
No phase can be set to AfterPreviousPhase if the previous phase is not scheduled, or will not occur.
Failures for rules 1-4 have no effect on the Deploy Job. However failures for rules 5-7 reset the Deploy Job to be in a "Do not execute" state, because by this point all existing schedules have already been removed.

The argument recipient is the snmp receiver, and the statusType argument determines the statuses for which you want to issue a notification. The possible statuses each have a value as follows:

  • Success=2
  • Failure=4
  • Cancel=8

For statusType, add the values representing the statuses for which you want to issue notifications. For example, if you want to issue notifications when the job status is Failure or Cancel, then statusType=12. This command returns a handle to the updated job.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

jobKey

DBKey

The handle to the Deploy Job.

simulateType

String

Simulate phase schedule type. The string can be "NotScheduled" or "AtTime"

simulateDateString

String

One-time schedule for simulate phase. The date string must be in the format YYYY-MM-DD HH:MM:SS.

stageType

String

Stage phase schedule type. The string can be "NotScheduled", "AfterPreviousPhase", or "AtTime"

stageDateString

String

One-time schedule for stage phase. The date string must be in the format YYYY-MM-DD HH:MM:SS.

commitType

String

Commit phase schedule type. The string can be "NotScheduled", "AfterPreviousPhase", or "AtTime"

commitDateString

String

One-time schedule for commit phase. The date string must be in the format YYYY-MM-DD HH:MM:SS.

recipient

String

Receiver of the SNMP trap

statusType

Integer

Sum of all statuses for which you want to issue notification. For more detailed information, see the description above.

Example

The following example shows how to retrieve a Deploy Job, clear the schedules associated with it, then specify specific times at which various stages should start.

Script


# Name of the existing job. 

JOB_NAME="deployjob" 

# Job group in which Deploy Job is stored. 

JOB_GROUP="/Workspace/DeployJobs" 

# Get the Deploy Job DBKey using the above information. 

JOB_DBKEY=`blcli DeployJob getDBKeyByGroupAndName $JOB_GROUP $JOB_NAME` 

SIMULATE_DATE_STRING="2011-01-01 23:35:00" 

STAGE_DATE_STRING="2011-01-01 23:45:00" 

COMMIT_DATE_STRING="2011-01-01 23:55:00" 

SNMP_LISTENER="listener.company.com" 

JOB_DBKEY=`blcli DeployJob setAdvanceDeployJobPhaseScheduleWithSNMPNotificationByDBKey $JOB_DBKEY AtTime $SIMULATE_DATE_STRING AtTime $STAGE_DATE_STRING AtTime $COMMIT_DATE_STRING $SNMP_LISTENER 12` 



Was this page helpful? Yes No Submitting... Thank you

Comments