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

Add missing fields in Objectstorage and compute API #2387

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

Merged
merged 2 commits into from
Dec 18, 2024
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
4 changes: 4 additions & 0 deletions 4 openstack/compute/v2/servers/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ type Server struct {

// AvailabilityZone is the availabilty zone the server is in.
AvailabilityZone string `json:"OS-EXT-AZ:availability_zone"`

// Locked indicates the lock status of the server
// This requires microversion 2.9 or later
Locked *bool `json:"locked"`
}

type AttachedVolume struct {
Expand Down
7 changes: 5 additions & 2 deletions 7 openstack/compute/v2/servers/testing/fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ const ServerListBody = `
"progress": 0,
"OS-EXT-STS:power_state": 1,
"config_drive": "",
"metadata": {}
"metadata": {},
"locked": true
},
{
"status": "ACTIVE",
Expand Down Expand Up @@ -297,7 +298,8 @@ const SingleServerBody = `
"progress": 0,
"OS-EXT-STS:power_state": 1,
"config_drive": "",
"metadata": {}
"metadata": {},
"locked": true
}
}
`
Expand Down Expand Up @@ -631,6 +633,7 @@ var (
TerminatedAt: time.Time{},
DiskConfig: servers.Manual,
AvailabilityZone: "nova",
Locked: func() *bool { b := true; return &b }(),
}

ConsoleOutput = "abc"
Expand Down
2 changes: 2 additions & 0 deletions 2 openstack/compute/v2/servers/testing/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ func TestGetFaultyServer(t *testing.T) {

FaultyServer := ServerDerp
FaultyServer.Fault = DerpFault
FaultyServer.Locked = nil
th.CheckDeepEquals(t, FaultyServer, *actual)
}

Expand Down Expand Up @@ -1145,6 +1146,7 @@ func TestCreateServerWithTags(t *testing.T) {
tags := []string{"foo", "bar"}
ServerDerpTags := ServerDerp
ServerDerpTags.Tags = &tags
ServerDerpTags.Locked = nil

createOpts := servers.CreateOpts{
Name: "derp",
Expand Down
2 changes: 2 additions & 0 deletions 2 openstack/objectstorage/v1/containers/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ type GetHeader struct {
TempURLKey2 string `json:"X-Container-Meta-Temp-URL-Key-2"`
Timestamp float64 `json:"X-Timestamp,string"`
VersionsEnabled bool `json:"-"`
SyncKey string `json:"X-Sync-Key"`
SyncTo string `json:"X-Sync-To"`
}

func (r *GetHeader) UnmarshalJSON(b []byte) error {
Expand Down
2 changes: 2 additions & 0 deletions 2 openstack/objectstorage/v1/containers/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ func HandleGetContainerSuccessfully(t *testing.T, options ...option) {
w.Header().Set("X-Trans-Id", "tx554ed59667a64c61866f1-0057b4ba37")
w.Header().Set("X-Storage-Policy", "test_policy")
w.Header().Set("X-Versions-Enabled", "True")
w.Header().Set("X-Sync-Key", "272465181849")
w.Header().Set("X-Sync-To", "anotherContainer")
w.WriteHeader(http.StatusNoContent)
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ func TestGetContainer(t *testing.T) {
StoragePolicy: "test_policy",
Timestamp: 1471298837.95721,
VersionsEnabled: true,
SyncKey: "272465181849",
SyncTo: "anotherContainer",
}
actual, err := res.Extract()
th.AssertNoErr(t, err)
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.