Class: Armrest::Services::BlobContainer
- Defined in:
- lib/armrest/services/blob_container.rb
Instance Method Summary collapse
-
#create(attrs = {}) ⇒ Object
docs.microsoft.com/en-us/rest/api/storagerp/blob-containers/create PUT management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/accountName/blobServices/default/containers/containerName?api-version=2021-04-01.
- #exist?(attrs = {}) ⇒ Boolean
-
#get(attrs = {}) ⇒ Object
docs.microsoft.com/en-us/rest/api/storagerp/blob-containers/get GET management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/accountName/blobServices/default/containers/containerName?api-version=2021-04-01.
-
#initialize(options = {}) ⇒ BlobContainer
constructor
A new instance of BlobContainer.
Methods included from Api::Settings
#client_id, #client_secret, #endpoint, #group, #location, #resource, #subscription_id, #tenant_id
Methods included from Api::HandleResponse
Methods included from Logging
#default_logger, #logger, #logger=
Constructor Details
#initialize(options = {}) ⇒ BlobContainer
Returns a new instance of BlobContainer.
3 4 5 6 |
# File 'lib/armrest/services/blob_container.rb', line 3 def initialize(={}) super @storage_account = [:storage_account] end |
Instance Method Details
#create(attrs = {}) ⇒ Object
docs.microsoft.com/en-us/rest/api/storagerp/blob-containers/create PUT management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/accountName/blobServices/default/containers/containerName?api-version=2021-04-01
23 24 25 26 27 |
# File 'lib/armrest/services/blob_container.rb', line 23 def create(attrs={}) name = attrs.delete(:name) path = "subscriptions/#{subscription_id}/resourceGroups/#{group}/providers/Microsoft.Storage/storageAccounts/#{@storage_account}/blobServices/default/containers/#{name}" api.put(path) end |
#exist?(attrs = {}) ⇒ Boolean
16 17 18 19 |
# File 'lib/armrest/services/blob_container.rb', line 16 def exist?(attrs={}) resp = get(attrs) resp.code =~ /^20/ end |
#get(attrs = {}) ⇒ Object
docs.microsoft.com/en-us/rest/api/storagerp/blob-containers/get GET management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/accountName/blobServices/default/containers/containerName?api-version=2021-04-01
10 11 12 13 14 |
# File 'lib/armrest/services/blob_container.rb', line 10 def get(attrs={}) name = attrs[:name] path = "subscriptions/#{subscription_id}/resourceGroups/#{group}/providers/Microsoft.Storage/storageAccounts/#{@storage_account}/blobServices/default/containers/#{name}" api.get(path) end |