-
Notifications
You must be signed in to change notification settings - Fork 9
/
pipeline_scale_manifest_stage_resource.go
94 lines (91 loc) · 2.65 KB
/
pipeline_scale_manifest_stage_resource.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package provider
import (
"github.com/hashicorp/terraform/helper/schema"
)
func pipelineScaleManifestStageResource() *schema.Resource {
newScaleManifestStageInterface := func() stage {
return newScaleManifestStage()
}
return &schema.Resource{
Create: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageCreate(d, m, newScaleManifestStageInterface)
},
Read: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageRead(d, m, newScaleManifestStageInterface)
},
Update: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageUpdate(d, m, newScaleManifestStageInterface)
},
Delete: func(d *schema.ResourceData, m interface{}) error {
return resourcePipelineStageDelete(d, m, newScaleManifestStageInterface)
},
Importer: &schema.ResourceImporter{
State: resourcePipelineImporter,
},
Schema: stageResource(map[string]*schema.Schema{
"account": &schema.Schema{
Type: schema.TypeString,
Description: "The account name",
Required: true,
},
"application": &schema.Schema{
Type: schema.TypeString,
Description: "The application name",
Optional: true,
},
"cloud_provider": &schema.Schema{
Type: schema.TypeString,
Description: "The cloud provider name",
Required: true,
},
"cluster": &schema.Schema{
Type: schema.TypeString,
Description: "The cluster to scale",
Optional: true,
},
"criteria": &schema.Schema{
Type: schema.TypeString,
Description: "The criteria for determining the target cluster",
Optional: true,
},
"kind": &schema.Schema{
Type: schema.TypeString,
Description: "The kind of manifest to scale",
Optional: true,
},
"kinds": &schema.Schema{
Type: schema.TypeList,
Description: "The kinds of manifest to scale",
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"label_selectors": &schema.Schema{
Type: schema.TypeMap,
Description: "The label selectors",
Optional: true,
},
"location": &schema.Schema{
Type: schema.TypeString,
Description: "The namespace",
Optional: true,
},
"manifest_name": &schema.Schema{
Type: schema.TypeString,
Description: "The name of the manifest",
Optional: true,
},
"mode": &schema.Schema{
Type: schema.TypeString,
Description: "The selector mode",
Optional: true,
},
"replicas": &schema.Schema{
Type: schema.TypeString,
Description: "The number of replicas",
Optional: true,
},
}),
}
}