diff --git a/openshift/manage b/openshift/manage index 49a4b4e..d1e6586 100755 --- a/openshift/manage +++ b/openshift/manage @@ -61,6 +61,15 @@ usage () { requeueProcessedCreds - Use with caution. Requeue any credentials that have already been posted. + requeueSkippedCorpTypes [ -d ] + - Requeue any corporation from the provided list of types that were initally skipped from processing. + Where: + - [ -d ] - Optional - Specify the friendly name of the database pod containing the records. + - - A space seperated list of corporation types to requeue. + Examples: + $0 -e dev requeueSkippedCorpTypes FI LIB PAR + $0 -e dev requeueSkippedCorpTypes -d my-event-db FI LIB PAR + requeueOrganization - Use with caution. Requeue a specific company that may have already been processed. Where: @@ -194,7 +203,7 @@ usage () { untagApplicationImages - Deletes a specific tag from all of the application images. - - Handy for cleaning up backups of images. + - Handy for cleaning up backups of images. scaleUp - Scale up one or more pods. @@ -494,6 +503,34 @@ EOF ) } +function requeueSkippedCorpTypes() { + + local OPTIND + unset _dbPodName + while getopts d: FLAG; do + case $FLAG in + d ) + _dbPodName=$OPTARG + ;; + esac + done + shift $((OPTIND-1)) + + _podName=${_dbPodName:-event-db} + _skippedTypes=${@} + if [ -z "${_skippedTypes}" ]; then + echoError "\nrequeueSkippedCorpTypes; You MUST specify a list of skipped corp types.\n" + exit 1 + fi + + for type in ${_skippedTypes}; do + echo + runInContainer -v \ + ${_podName}${resourceSuffix} \ + "psql -d "'${POSTGRESQL_DATABASE}'" -ac \"update event_by_corp_filing set process_success = null, process_date = null, process_msg = null where process_msg like '${type}: Skipped%';\"" + done +} + function requeueProcessedCreds() { _podName=${1} if [ -z "${_podName}" ]; then @@ -935,6 +972,9 @@ case "${_cmd}" in dbPodName=${1:-event-db} requeueProcessedCreds "${dbPodName}" ;; + requeueskippedcorptypes) + requeueSkippedCorpTypes ${@} + ;; requeueorganization) corpNum=${1} dbPodName=${2:-event-db}