Skip to content

Commit f60a478

Browse files
Kms Rotation fixes (#360)
Kms Rotation fixes After testing in terraform made some fixes. Reviewed-by: Rodion Gyrbu <fpsoff@outlook.com>
1 parent adb6960 commit f60a478

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

openstack/kms/v1/keys/requests.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ type RotationOpts struct {
7272
// ID of a CMK
7373
KeyID string `json:"key_id" required:"true"`
7474
// Rotation interval of a CMK
75-
Interval int `json:"rotation_interval" required:"true"`
75+
Interval int `json:"rotation_interval"`
7676
// 36-byte serial number of a request message
7777
Sequence string `json:"sequence,omitempty"`
7878
}
@@ -297,7 +297,9 @@ func EnableKeyRotation(client *golangsdk.ServiceClient, opts RotationOptsBuilder
297297
return
298298
}
299299

300-
_, r.Err = client.Post(enableKeyRotationURL(client), b, &r.Body, nil)
300+
_, r.Err = client.Post(enableKeyRotationURL(client), b, &r.Body, &golangsdk.RequestOpts{
301+
OkCodes: []int{200},
302+
})
301303
return
302304
}
303305

@@ -307,7 +309,9 @@ func DisableKeyRotation(client *golangsdk.ServiceClient, opts RotationOptsBuilde
307309
r.Err = err
308310
return
309311
}
310-
_, r.Err = client.Post(disableKeyRotationURL(client), b, &r.Body, nil)
312+
_, r.Err = client.Post(disableKeyRotationURL(client), b, &r.Body, &golangsdk.RequestOpts{
313+
OkCodes: []int{200},
314+
})
311315
return
312316
}
313317

@@ -317,7 +321,9 @@ func GetKeyRotationStatus(client *golangsdk.ServiceClient, opts RotationOptsBuil
317321
r.Err = err
318322
return
319323
}
320-
_, r.Err = client.Post(getKeyRotationStatusURL(client), b, &r.Body, nil)
324+
_, r.Err = client.Post(getKeyRotationStatusURL(client), b, &r.Body, &golangsdk.RequestOpts{
325+
OkCodes: []int{200},
326+
})
321327

322328
return
323329
}
@@ -328,6 +334,8 @@ func UpdateKeyRotationInterval(client *golangsdk.ServiceClient, opts RotationOpt
328334
r.Err = err
329335
return
330336
}
331-
_, r.Err = client.Post(updateKeyRotationIntervalURL(client), b, &r.Body, nil)
337+
_, r.Err = client.Post(updateKeyRotationIntervalURL(client), b, &r.Body, &golangsdk.RequestOpts{
338+
OkCodes: []int{200},
339+
})
332340
return
333341
}

0 commit comments

Comments
 (0)