diff --git a/openstack/sharedfilesystems/v2/shares/results.go b/openstack/sharedfilesystems/v2/shares/results.go index 741f4a0d64..d2e7470bbb 100644 --- a/openstack/sharedfilesystems/v2/shares/results.go +++ b/openstack/sharedfilesystems/v2/shares/results.go @@ -69,6 +69,8 @@ type Share struct { // Used for filtering backends which either support or do not support share snapshots SnapshotSupport bool `json:"snapshot_support"` SourceCgsnapshotMemberID string `json:"source_cgsnapshot_member_id"` + // Used for filtering backends which either support or do not support creating shares from snapshots + CreateShareFromSnapshotSupport bool `json:"create_share_from_snapshot_support"` // Timestamp when the share was created CreatedAt time.Time `json:"-"` // Timestamp when the share was updated diff --git a/openstack/sharedfilesystems/v2/shares/testing/fixtures.go b/openstack/sharedfilesystems/v2/shares/testing/fixtures.go index 73b3e61345..19c3aa15f5 100644 --- a/openstack/sharedfilesystems/v2/shares/testing/fixtures.go +++ b/openstack/sharedfilesystems/v2/shares/testing/fixtures.go @@ -53,6 +53,7 @@ var createResponse = `{ "replication_type": null, "task_state": null, "snapshot_support": true, + "create_share_from_snapshot_support": true, "consistency_group_id": "9397c191-8427-4661-a2e8-b23820dc01d4", "source_cgsnapshot_member_id": null, "volume_type": "default", @@ -133,6 +134,7 @@ var updateResponse = ` "task_state": null, "is_public": false, "snapshot_support": true, + "create_share_from_snapshot_support": true, "name": "my_new_test_share", "created_at": "2015-09-18T10:25:24.000000", "share_proto": "NFS", @@ -188,6 +190,7 @@ var getResponse = `{ "task_state": null, "is_public": true, "snapshot_support": true, + "create_share_from_snapshot_support": true, "name": "my_test_share", "created_at": "2015-09-18T10:25:24.000000", "share_proto": "NFS", @@ -241,6 +244,7 @@ var listDetailResponse = `{ "task_state": null, "is_public": true, "snapshot_support": true, + "create_share_from_snapshot_support": true, "name": "my_test_share", "created_at": "2015-09-18T10:25:24.000000", "share_proto": "NFS", diff --git a/openstack/sharedfilesystems/v2/shares/testing/request_test.go b/openstack/sharedfilesystems/v2/shares/testing/request_test.go index 91efd4fbda..b7880c6238 100644 --- a/openstack/sharedfilesystems/v2/shares/testing/request_test.go +++ b/openstack/sharedfilesystems/v2/shares/testing/request_test.go @@ -79,19 +79,20 @@ func TestGet(t *testing.T) { "project": "my_app", "aim": "doc", }, - Status: "available", - Description: "My custom share London", - Host: "manila2@generic1#GENERIC1", - HasReplicas: false, - ReplicationType: "", - TaskState: "", - SnapshotSupport: true, - Name: "my_test_share", - CreatedAt: time.Date(2015, time.September, 18, 10, 25, 24, 0, time.UTC), - ShareProto: "NFS", - VolumeType: "default", - SourceCgsnapshotMemberID: "", - IsPublic: true, + Status: "available", + Description: "My custom share London", + Host: "manila2@generic1#GENERIC1", + HasReplicas: false, + ReplicationType: "", + TaskState: "", + SnapshotSupport: true, + CreateShareFromSnapshotSupport: true, + Name: "my_test_share", + CreatedAt: time.Date(2015, time.September, 18, 10, 25, 24, 0, time.UTC), + ShareProto: "NFS", + VolumeType: "default", + SourceCgsnapshotMemberID: "", + IsPublic: true, Links: []map[string]string{ { "href": "http://172.18.198.54:8786/v2/16e1ab15c35a457e9c2b2aa189f544e1/shares/011d21e2-fbc3-4e4a-9993-9ea223f73264", @@ -134,19 +135,20 @@ func TestListDetail(t *testing.T) { "project": "my_app", "aim": "doc", }, - Status: "available", - Description: "My custom share London", - Host: "manila2@generic1#GENERIC1", - HasReplicas: false, - ReplicationType: "", - TaskState: "", - SnapshotSupport: true, - Name: "my_test_share", - CreatedAt: time.Date(2015, time.September, 18, 10, 25, 24, 0, time.UTC), - ShareProto: "NFS", - VolumeType: "default", - SourceCgsnapshotMemberID: "", - IsPublic: true, + Status: "available", + Description: "My custom share London", + Host: "manila2@generic1#GENERIC1", + HasReplicas: false, + ReplicationType: "", + TaskState: "", + SnapshotSupport: true, + CreateShareFromSnapshotSupport: true, + Name: "my_test_share", + CreatedAt: time.Date(2015, time.September, 18, 10, 25, 24, 0, time.UTC), + ShareProto: "NFS", + VolumeType: "default", + SourceCgsnapshotMemberID: "", + IsPublic: true, Links: []map[string]string{ { "href": "http://172.18.198.54:8786/v2/16e1ab15c35a457e9c2b2aa189f544e1/shares/011d21e2-fbc3-4e4a-9993-9ea223f73264",