~thumper/juju-core/fix-upstart-start-race

« back to all changes in this revision

Viewing changes to provider/joyent/instance.go

  • Committer: Tarmac
  • Author(s): Daniele Stroppa
  • Date: 2013-11-21 17:53:05 UTC
  • mfrom: (1953.1.17 juju-core)
  • Revision ID: tarmac-20131121175305-pzsz7j7oitdew42r
[r=gz] provider/joyent: Initial work towards joyent provider

Outline for new backend for running juju on the joyent cloud,
based on the skeleton provider. The gojoyent library will need
to get imported and used in a followup branch for actual use.

R=fwereade, gz

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 Joyent Inc.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package joyent
 
5
 
 
6
import (
 
7
        "launchpad.net/juju-core/instance"
 
8
        "launchpad.net/juju-core/provider/common"
 
9
)
 
10
 
 
11
type environInstance struct {
 
12
        id  instance.Id
 
13
        env *environ
 
14
}
 
15
 
 
16
var _ instance.Instance = (*environInstance)(nil)
 
17
 
 
18
func (inst *environInstance) Id() instance.Id {
 
19
        return inst.id
 
20
}
 
21
 
 
22
func (inst *environInstance) Status() string {
 
23
        _ = inst.env.getSnapshot()
 
24
        return "unknown (not implemented)"
 
25
}
 
26
 
 
27
func (inst *environInstance) Addresses() ([]instance.Address, error) {
 
28
        _ = inst.env.getSnapshot()
 
29
        return nil, errNotImplemented
 
30
}
 
31
 
 
32
func (inst *environInstance) DNSName() (string, error) {
 
33
        // This method is likely to be replaced entirely by Addresses() at some point,
 
34
        // but remains necessary for now. It's probably smart to implement it in
 
35
        // terms of Addresses above, to minimise churn when it's removed.
 
36
        _ = inst.env.getSnapshot()
 
37
        return "", errNotImplemented
 
38
}
 
39
 
 
40
func (inst *environInstance) WaitDNSName() (string, error) {
 
41
        // This method is likely to be replaced entirely by Addresses() at some point,
 
42
        // but remains necessary for now. Until it's finally removed, you can probably
 
43
        // ignore this method; the common implementation should work.
 
44
        return common.WaitDNSName(inst)
 
45
}