Method: Azure::Armrest::ResourceGroupBasedService#delete

Defined in:
lib/azure/armrest/resource_group_based_service.rb

#delete(name, rgroup = configuration.resource_group) ⇒ Object

Delete the resource with the given name for the provided resource_group, or the resource group specified in your original configuration object. If successful, returns a ResponseHeaders object.

If the delete operation returns a 204 (no body), which is what the Azure REST API typically returns if the resource is not found, it is treated as an error and a ResourceNotFoundException is raised.



182
183
184
185
186
187
188
189
190
# File 'lib/azure/armrest/resource_group_based_service.rb', line 182

def delete(name, rgroup = configuration.resource_group)
  validate_resource_group(rgroup)
  validate_resource(name)

  url = build_url(rgroup, name)
  url = yield(url) || url if block_given?

  delete_by_url(url, "#{rgroup}/#{name}")
end