Class: TerraspacePluginAzurerm::Interfaces::Backend::BlobContainer

Inherits:
Base
  • Object
show all
Defined in:
lib/terraspace_plugin_azurerm/interfaces/backend/blob_container.rb

Instance Method Summary collapse

Methods inherited from Base

#azure_info, #config, #initialize, #logger

Constructor Details

This class inherits a constructor from TerraspacePluginAzurerm::Interfaces::Backend::Base

Instance Method Details

#createObject



3
4
5
6
7
8
9
# File 'lib/terraspace_plugin_azurerm/interfaces/backend/blob_container.rb', line 3

def create
  if exist?
    logger.debug "Storage Blob Container #{@container_name} already exists"
  else
    create_blob_container
  end
end

#create_blob_containerObject



15
16
17
18
# File 'lib/terraspace_plugin_azurerm/interfaces/backend/blob_container.rb', line 15

def create_blob_container
  logger.info "Creating Storage Blob Container #{@container_name}..."
  blob_container.create(name: @container_name)
end

#exist?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/terraspace_plugin_azurerm/interfaces/backend/blob_container.rb', line 11

def exist?
  blob_container.exist?(name: @container_name)
end