make create stack param timeout optional
diff --git a/openstack/orchestration/v1/stacks/requests.go b/openstack/orchestration/v1/stacks/requests.go
index 49f9749..ced78f6 100644
--- a/openstack/orchestration/v1/stacks/requests.go
+++ b/openstack/orchestration/v1/stacks/requests.go
@@ -33,8 +33,6 @@
type CreateOpts struct {
// (REQUIRED) The name of the stack. It must start with an alphabetic character.
Name string
- // (REQUIRED) The timeout for stack creation in minutes.
- Timeout int
// (OPTIONAL; REQUIRED IF Template IS EMPTY) The URL of the template to instantiate.
// This value is ignored if Template is supplied inline.
TemplateURL string
@@ -61,6 +59,8 @@
Files map[string]interface{}
// (OPTIONAL) User-defined parameters to pass to the template.
Parameters map[string]string
+ // (OPTIONAL) The timeout for stack creation in minutes.
+ Timeout int
}
// ToStackCreateMap casts a CreateOpts struct to a map.
@@ -94,10 +94,9 @@
s["parameters"] = opts.Parameters
}
- if opts.Timeout == 0 {
- return nil, errors.New("Required field 'Timeout' not provided.")
+ if opts.Timeout != 0 {
+ s["timeout_mins"] = opts.Timeout
}
- s["timeout_mins"] = opts.Timeout
return s, nil
}