Add security group :zap:
diff --git a/openstack/compute/v2/extensions/secgroups/results.go b/openstack/compute/v2/extensions/secgroups/results.go
index 8d9a4e9..8f5477e 100644
--- a/openstack/compute/v2/extensions/secgroups/results.go
+++ b/openstack/compute/v2/extensions/secgroups/results.go
@@ -3,6 +3,7 @@
import (
"github.com/mitchellh/mapstructure"
+ "github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/pagination"
)
@@ -50,3 +51,25 @@
err := mapstructure.Decode(casted, &response)
return response.SecurityGroups, err
}
+
+type commonResult struct {
+ gophercloud.Result
+}
+
+type CreateResult struct {
+ commonResult
+}
+
+func (r commonResult) Extract() (*SecurityGroup, error) {
+ if r.Err != nil {
+ return nil, r.Err
+ }
+
+ var response struct {
+ SecurityGroup SecurityGroup `mapstructure:"security_group"`
+ }
+
+ err := mapstructure.Decode(r.Body, &response)
+
+ return &response.SecurityGroup, err
+}