lib/azure/armrest/resource_group_based_service.rb
# Parse the provider and service name out of an ID string.
Parse the provider and service name out of an ID string.
Parse the provider and service name out of an ID string .
def parse_id_string(id_string)
        regex = %r{
          subscriptions/(?<subscription_id>[^\/]+)?
          (/resourceGroups/(?<resource_group>[^\/]+)?)?
          (/providers/(?<provider>[^\/]+)?)?
          (/(?<service_name>[^\/]+)?/(?<resource_name>[^\/]+))?
          (/(?<subservice_name>[^\/]+)?/(?<subservice_resource_name>[^\/]+))?
          \z
        }xi
        match = regex.match(id_string)
        raise ArgumentError, "Invalid ID string: #{id_string}" unless match
        Hash[match.names.zip(match.captures)]
      end
def parse_id_string ( id_string ) regex = %r{ 
          subscriptions/(?<subscription_id>[^ \/ ]+)?
          (/resourceGroups/(?<resource_group>[^ \/ ]+)?)?
          (/providers/(?<provider>[^ \/ ]+)?)?
          (/(?<service_name>[^ \/ ]+)?/(?<resource_name>[^ \/ ]+))?
          (/(?<subservice_name>[^ \/ ]+)?/(?<subservice_resource_name>[^ \/ ]+))?
           \z }xi match = regex . match ( id_string ) raise ArgumentError , "Invalid ID string: #{id_string}" unless match Hash [ match . names . zip ( match . captures ) ] end
Parse the provider and service name out of an ID string.
Parse the provider and service name out of an ID string .
id_string
<not_specific>