Sha256: 9b2b6a2815652ea63e1270004c63c1665628daa9ef2588cbe18a4e3796cbc920

Contents?: true

Size: 1.5 KB

Versions: 13

Compression:

Stored size: 1.5 KB

Contents

module Azure
  module Armrest
    # Base class for managing templates and deployments
    class TemplateDeploymentService < ResourceGroupBasedService

      def initialize(configuration, options = {})
        super(configuration, 'deployments', 'Microsoft.Resources', options)
      end

      # Get names of all deployments in a resource group
      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
      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)
        validate_resource(deploy_name)

        url = build_url(resource_group, deploy_name, 'operations')
        response = rest_get(url)
        JSON.parse(response)['value'].map { |hash| TemplateDeploymentOperation.new(hash) }
      end

      # Get the operation of a deployment in a resource group
      def get_deployment_operation(op_id, deploy_name, resource_group = configuration.resource_group)
        validate_resource_group(resource_group)
        validate_resource(deploy_name)
        raise ArgumentError, "must specify operation id" unless op_id

        url = build_url(resource_group, deploy_name, 'operations', op_id)
        response = rest_get(url)
        TemplateDeploymentOperation.new(response)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
azure-armrest-0.3.7 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.2.10 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.6 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.2.9 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.5 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.4 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.3 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.2.8 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.2 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.1 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.3.0 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.2.7 lib/azure/armrest/template_deployment_service.rb
azure-armrest-0.2.6 lib/azure/armrest/template_deployment_service.rb