openstack stack templates ops and unit tests
diff --git a/openstack/orchestration/v1/stacktemplates/results.go b/openstack/orchestration/v1/stacktemplates/results.go
new file mode 100644
index 0000000..968a3ec
--- /dev/null
+++ b/openstack/orchestration/v1/stacktemplates/results.go
@@ -0,0 +1,52 @@
+package stacktemplates
+
+import (
+ "github.com/mitchellh/mapstructure"
+ "github.com/rackspace/gophercloud"
+)
+
+type Template struct {
+ Description string `mapstructure:"description"`
+ HeatTemplateVersion string `mapstructure:"heat_template_version"`
+ Parameters map[string]interface{} `mapstructure:"parameters"`
+ Resources map[string]interface{} `mapstructure:"resources"`
+}
+
+type GetResult struct {
+ gophercloud.Result
+}
+
+func (r GetResult) Extract() (*Template, error) {
+ if r.Err != nil {
+ return nil, r.Err
+ }
+
+ var res Template
+ if err := mapstructure.Decode(r.Body, &res); err != nil {
+ return nil, err
+ }
+
+ return &res, nil
+}
+
+type ValidatedTemplate struct {
+ Description string
+ Parameters map[string]interface{}
+}
+
+type ValidateResult struct {
+ gophercloud.Result
+}
+
+func (r ValidateResult) Extract() (*ValidatedTemplate, error) {
+ if r.Err != nil {
+ return nil, r.Err
+ }
+
+ var res ValidatedTemplate
+ if err := mapstructure.Decode(r.Body, &res); err != nil {
+ return nil, err
+ }
+
+ return &res, nil
+}