Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b747927

Browse filesBrowse files
Merge pull request #2387 from pdesgarets/master
Add missing fields in Objectstorage and compute API
2 parents f7efc95 + cec507c commit b747927
Copy full SHA for b747927

File tree

6 files changed

+17
-2
lines changed
Filter options

6 files changed

+17
-2
lines changed

‎openstack/compute/v2/servers/results.go

Copy file name to clipboardExpand all lines: openstack/compute/v2/servers/results.go
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ type Server struct {
279279

280280
// AvailabilityZone is the availabilty zone the server is in.
281281
AvailabilityZone string `json:"OS-EXT-AZ:availability_zone"`
282+
283+
// Locked indicates the lock status of the server
284+
// This requires microversion 2.9 or later
285+
Locked *bool `json:"locked"`
282286
}
283287

284288
type AttachedVolume struct {

‎openstack/compute/v2/servers/testing/fixtures_test.go

Copy file name to clipboardExpand all lines: openstack/compute/v2/servers/testing/fixtures_test.go
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ const ServerListBody = `
158158
"progress": 0,
159159
"OS-EXT-STS:power_state": 1,
160160
"config_drive": "",
161-
"metadata": {}
161+
"metadata": {},
162+
"locked": true
162163
},
163164
{
164165
"status": "ACTIVE",
@@ -297,7 +298,8 @@ const SingleServerBody = `
297298
"progress": 0,
298299
"OS-EXT-STS:power_state": 1,
299300
"config_drive": "",
300-
"metadata": {}
301+
"metadata": {},
302+
"locked": true
301303
}
302304
}
303305
`
@@ -631,6 +633,7 @@ var (
631633
TerminatedAt: time.Time{},
632634
DiskConfig: servers.Manual,
633635
AvailabilityZone: "nova",
636+
Locked: func() *bool { b := true; return &b }(),
634637
}
635638

636639
ConsoleOutput = "abc"

‎openstack/compute/v2/servers/testing/requests_test.go

Copy file name to clipboardExpand all lines: openstack/compute/v2/servers/testing/requests_test.go
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ func TestGetFaultyServer(t *testing.T) {
775775

776776
FaultyServer := ServerDerp
777777
FaultyServer.Fault = DerpFault
778+
FaultyServer.Locked = nil
778779
th.CheckDeepEquals(t, FaultyServer, *actual)
779780
}
780781

@@ -1146,6 +1147,7 @@ func TestCreateServerWithTags(t *testing.T) {
11461147
tags := []string{"foo", "bar"}
11471148
ServerDerpTags := ServerDerp
11481149
ServerDerpTags.Tags = &tags
1150+
ServerDerpTags.Locked = nil
11491151

11501152
createOpts := servers.CreateOpts{
11511153
Name: "derp",

‎openstack/objectstorage/v1/containers/results.go

Copy file name to clipboardExpand all lines: openstack/objectstorage/v1/containers/results.go
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ type GetHeader struct {
111111
TempURLKey2 string `json:"X-Container-Meta-Temp-URL-Key-2"`
112112
Timestamp float64 `json:"X-Timestamp,string"`
113113
VersionsEnabled bool `json:"-"`
114+
SyncKey string `json:"X-Sync-Key"`
115+
SyncTo string `json:"X-Sync-To"`
114116
}
115117

116118
func (r *GetHeader) UnmarshalJSON(b []byte) error {

‎openstack/objectstorage/v1/containers/testing/fixtures.go

Copy file name to clipboardExpand all lines: openstack/objectstorage/v1/containers/testing/fixtures.go
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ func HandleGetContainerSuccessfully(t *testing.T, options ...option) {
258258
w.Header().Set("X-Trans-Id", "tx554ed59667a64c61866f1-0057b4ba37")
259259
w.Header().Set("X-Storage-Policy", "test_policy")
260260
w.Header().Set("X-Versions-Enabled", "True")
261+
w.Header().Set("X-Sync-Key", "272465181849")
262+
w.Header().Set("X-Sync-To", "anotherContainer")
261263
w.WriteHeader(http.StatusNoContent)
262264
})
263265
}

‎openstack/objectstorage/v1/containers/testing/requests_test.go

Copy file name to clipboardExpand all lines: openstack/objectstorage/v1/containers/testing/requests_test.go
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ func TestGetContainer(t *testing.T) {
244244
StoragePolicy: "test_policy",
245245
Timestamp: 1471298837.95721,
246246
VersionsEnabled: true,
247+
SyncKey: "272465181849",
248+
SyncTo: "anotherContainer",
247249
}
248250
actual, err := res.Extract()
249251
th.AssertNoErr(t, err)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.