openstack/rackspace get resource type schema op and unit test
diff --git a/rackspace/orchestration/v1/stackresources/delegate.go b/rackspace/orchestration/v1/stackresources/delegate.go
index 03f080d..9029a24 100644
--- a/rackspace/orchestration/v1/stackresources/delegate.go
+++ b/rackspace/orchestration/v1/stackresources/delegate.go
@@ -30,3 +30,8 @@
func ListTypes(c *gophercloud.ServiceClient) pagination.Pager {
return os.ListTypes(c)
}
+
+// Schema retreives the schema for the given resource type.
+func Schema(c *gophercloud.ServiceClient, resourceType string) os.SchemaResult {
+ return os.Schema(c, resourceType)
+}
diff --git a/rackspace/orchestration/v1/stackresources/delegate_test.go b/rackspace/orchestration/v1/stackresources/delegate_test.go
index 9d0da3d..5800d7c 100644
--- a/rackspace/orchestration/v1/stackresources/delegate_test.go
+++ b/rackspace/orchestration/v1/stackresources/delegate_test.go
@@ -82,3 +82,15 @@
th.AssertNoErr(t, err)
th.CheckEquals(t, 1, count)
}
+
+func TestGetResourceSchema(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ os.HandleGetSchemaSuccessfully(t, os.GetSchemaOutput)
+
+ actual, err := Schema(fake.ServiceClient(), "OS::Heat::AResourceName").Extract()
+ th.AssertNoErr(t, err)
+
+ expected := os.GetSchemaExpected
+ th.AssertDeepEquals(t, expected, actual)
+}