Sha256: 782240aa76ba32a1ef4338f3ac0c05373eacf90bed616cbe5d5bfa1a6f6525d1

Contents?: true

Size: 1.74 KB

Versions: 47

Compression:

Stored size: 1.74 KB

Contents

module Fog
  module Network
    class AzureRM
      # Express Route Circuit Authorization model class for Network Service
      class ExpressRouteCircuitAuthorization < Fog::Model
        identity :name
        attribute :id
        attribute :resource_group
        attribute :authorization_name
        attribute :authorization_key
        attribute :authorization_use_status
        attribute :provisioning_state
        attribute :etag
        attribute :circuit_name

        def self.parse(circuit_authorization)
          circuit_auth_hash = get_hash_from_object(circuit_authorization)
          circuit_auth_hash['resource_group'] = get_resource_group_from_id(circuit_authorization.id)
          circuit_auth_hash['circuit_name'] = get_circuit_name_from_id(circuit_authorization.id)
          circuit_auth_hash
        end

        def save
          requires :name, :resource_group, :circuit_name
          circuit_authorization = service.create_or_update_express_route_circuit_authorization(express_route_circuit_authorization_params)
          merge_attributes(Fog::Network::AzureRM::ExpressRouteCircuitAuthorization.parse(circuit_authorization))
        end

        def destroy
          service.delete_express_route_circuit_authorization(resource_group, circuit_name, name)
        end

        private

        def express_route_circuit_authorization_params
          {
            name: name,
            resource_group: resource_group,
            circuit_name: circuit_name,
            authorization_name: authorization_name,
            authorization_key: authorization_key,
            authorization_use_status: authorization_use_status,
            provisioning_state: provisioning_state,
            etag: etag
          }
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.2.5 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb
fog-azure-rm-0.2.0 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb
fog-azure-rm-0.1.2 lib/fog/azurerm/models/network/express_route_circuit_authorization.rb