lib/azure/armrest/template_deployment_service.rb in azure-armrest-0.8.1 vs lib/azure/armrest/template_deployment_service.rb in azure-armrest-0.8.2
- old
+ new
@@ -11,12 +11,12 @@
def list_names(resource_group = configuration.resource_group)
list(resource_group).map(&:name)
end
# Get all deployments for the current subscription
- def list_all
- list_in_all_groups
+ def list_all(filter = {})
+ list_in_all_groups(filter)
end
# Get all operations of a deployment in a resource group
def list_deployment_operations(deploy_name, resource_group = configuration.resource_group)
validate_resource_group(resource_group)
@@ -59,9 +59,18 @@
end
end.compact
resource_ids << build_id_string(resource_group, deploy_name)
delete_resources(resource_ids, resource_ids.size)
+ end
+
+ # Returns whether or not the given deployment exists.
+ #
+ def exists?(deploy_name, resource_group = configuration.resource_group)
+ url = build_url(resource_group, deploy_name)
+ rest_head(url) and true
+ rescue Azure::Armrest::NotFoundException
+ false
end
private
def delete_resources(ids, retry_cnt)