/
data_source_dcos_service.go
58 lines (54 loc) · 1.09 KB
/
data_source_dcos_service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package dcos
import (
"github.com/hashicorp/terraform/helper/schema"
)
func dataSourceDcosService() *schema.Resource {
return &schema.Resource{
Read: dataSourceDcosServiceRead,
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"instances": {
Type: schema.TypeInt,
Computed: true,
},
"cmd": {
Type: schema.TypeString,
Computed: true,
},
"cpus": {
Type: schema.TypeFloat,
Computed: true,
},
"disk": {
Type: schema.TypeFloat,
Computed: true,
},
"mem": {
Type: schema.TypeFloat,
Computed: true,
},
},
}
}
func dataSourceDcosServiceRead(d *schema.ResourceData, meta interface{}) error {
// client := meta.(*dcos.Client)
//
// app, err := client.Marathon.MarathonClient.Application(d.Get("name").(string))
//
// if err != nil {
// return err
// }
//
// d.SetId(app.ID)
//
// d.Set("cmd", app.Cmd)
// d.Set("instances", app.Instances)
// d.Set("cpus", app.CPUs)
// d.Set("disk", app.Disk)
// d.Set("mem", app.Mem)
return nil
}