comments
diff --git a/openstack/orchestration/v1/stacktemplates/fixtures.go b/openstack/orchestration/v1/stacktemplates/fixtures.go
index dc354ec..71fa808 100644
--- a/openstack/orchestration/v1/stacktemplates/fixtures.go
+++ b/openstack/orchestration/v1/stacktemplates/fixtures.go
@@ -74,6 +74,7 @@
})
}
+// ValidateExpected represents the expected object from a Validate request.
var ValidateExpected = &ValidatedTemplate{
Description: "Simple template to test heat commands",
Parameters: map[string]interface{}{
@@ -87,6 +88,7 @@
},
}
+// ValidateOutput represents the response body from a Validate request.
const ValidateOutput = `
{
"Description": "Simple template to test heat commands",
diff --git a/openstack/orchestration/v1/stacktemplates/results.go b/openstack/orchestration/v1/stacktemplates/results.go
index 968a3ec..ac2f24b 100644
--- a/openstack/orchestration/v1/stacktemplates/results.go
+++ b/openstack/orchestration/v1/stacktemplates/results.go
@@ -5,6 +5,7 @@
"github.com/rackspace/gophercloud"
)
+// Template represents a stack template.
type Template struct {
Description string `mapstructure:"description"`
HeatTemplateVersion string `mapstructure:"heat_template_version"`
@@ -12,10 +13,13 @@
Resources map[string]interface{} `mapstructure:"resources"`
}
+// GetResult represents the result of a Get operation.
type GetResult struct {
gophercloud.Result
}
+// Extract returns a pointer to a Template object and is called after a
+// Get operation.
func (r GetResult) Extract() (*Template, error) {
if r.Err != nil {
return nil, r.Err
@@ -29,15 +33,19 @@
return &res, nil
}
+// ValidatedTemplate represents the parsed object returned from a Validate request.
type ValidatedTemplate struct {
Description string
Parameters map[string]interface{}
}
+// ValidateResult represents the result of a Validate operation.
type ValidateResult struct {
gophercloud.Result
}
+// Extract returns a pointer to a ValidatedTemplate object and is called after a
+// Validate operation.
func (r ValidateResult) Extract() (*ValidatedTemplate, error) {
if r.Err != nil {
return nil, r.Err