Chapter 09/circuit-oneops-1-master/components/cookbooks/spark-cluster-v1/libraries/spark_cluster_helper.rb
# Parse the ciName to extract the cloud ID from it
#
# INPUT:
# ciName: The CI name to parse
#
# RETURNS:
# A string containing the numeric cloud ID, or '' if no
# name was specified
#
Parse the ciName to extract the cloud ID from it
INPUT:
ciName: The CI name to parse

A string containing the numeric cloud ID, or '' if no
name was specified
Parse the ciName to extract the cloud ID from it INPUT : ciName : The CI name to parse A string containing the numeric cloud ID or ' ' if no name was specified
def cloudid_from_name(ciName)
      if ciName == nil || ciName.empty?
        return ''
      end
       basename-cloudid-instance
       Split on the '-' character and take the second to last component
      nameComponents = ciName.split('-',-1)
      cloudid = nameComponents[nameComponents.length - 2]
      return cloudid
    end
def cloudid_from_name ( ciName ) if ciName == nil || ciName . empty? return '' end nameComponents = ciName . split ( '-' , - 1 ) cloudid = nameComponents [ nameComponents . length - 2 ] return cloudid end
Parse the ciName to extract the cloud ID from it
INPUT:
ciName: The CI name to parse
Parse the ciName to extract the cloud ID from it INPUT : ciName : The CI name to parse
# There was not a name specified.  Just return nothing. # The cloud ID is the second component of the CI name: # # basename-cloudid-instance # # Split on the '-' character and take the second to last component #
ciName
<not_specific>