Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharedfilesystems: Add CreateShareFromSnapshotSupport field to Share struct #2191

Merged
merged 2 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openstack/sharedfilesystems/v2/shares/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions openstack/sharedfilesystems/v2/shares/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
54 changes: 28 additions & 26 deletions openstack/sharedfilesystems/v2/shares/testing/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down