Diffo.Provider.Extension (Diffo v0.4.1)

Copy Markdown View Source

Unified DSL extension for all Diffo provider resource kinds.

Provides a single provider do section for Instance, Party, and Place kinds. The sections within provider do are self-similar across kinds — each kind uses the sections relevant to it, and verifiers enforce correct usage.

Instance

provider do
  specification do
    id "da9b207a-26c3-451d-8abd-0640c6349979"
    name "DSL Access Service"
    type :serviceSpecification
  end

  characteristics do
    characteristic :circuit, Diffo.Access.Circuit
  end

  features do
    feature :dynamic_line_management do
      characteristics do
        characteristic :constraints, Diffo.Access.Constraints
      end
    end
  end

  pools do
    pool :ports, :port
  end

  parties do
    party :provider, MyApp.Provider
    party_ref :owner, MyApp.InfrastructureCo
    parties :technicians, MyApp.Technician, constraints: [min: 1]
  end

  places do
    place :installation_site, MyApp.GeographicSite
    place_ref :billing_address, MyApp.GeographicAddress
  end

  behaviour do
    actions do
      create :build
    end
  end
end

Party

provider do
  instances do
    role :facilitates, MyApp.AccessService
    instance_ref :manages, MyApp.InternalService
  end
  parties do
    role :employer, MyApp.Person
  end
  places do
    role :headquarters, MyApp.GeographicSite
  end
end

Place

provider do
  instances do
    role :site_for, MyApp.AccessService
  end
  parties do
    role :managed_by, MyApp.Organization
  end
  places do
    role :within, MyApp.GeographicSite
  end
end

See Diffo.Provider.Extension.Info for runtime introspection. See Diffo.Provider.BaseInstance, Diffo.Provider.BaseParty, Diffo.Provider.BasePlace for full usage documentation.

Summary

Functions

provider(body)

(macro)