rackerlabs / mimic

An API mock service
Other
168 stars 57 forks source link

☂ Provide state-manipulation control-plane APIs for every piece of internal state in Nova #229

Open glyph opened 9 years ago

glyph commented 9 years ago

Right now we can have servers go from "active" to "error" on a timer, as part of their creation behavior. But what if we wanted to simulate a server going into the "error" state as part of a simulated event, driven by a testing tool? Or have other fields, such as creation or modification dates, change out from under an application? For some fields, such as metadata, there are public APIs for changing this data, and test harnesses can simply use those in those cases. But for some bits of data, which are (in a real service) intended to reflect real information, cannot be changed even by clients with administrative privileges, because they're supposed to reflect external realities. These fields should all be changeable by a mimic control plane endpoint.

This is an umbrella issue, and other issues / PRs should reference it; we should close this once there are no longer any others left. (This differs from a "milestone" because milestones automatically close when their last ticket is closed, whereas closing this should mean "we don't think we have any more of these to file".)

Sub-Issues:

ksheedlo commented 9 years ago

+1. I would be interested in helping design a pattern.

Also, +2 for the :umbrella: I didn't know you could type that.

I think it would be a good idea to set up a meeting to discuss this and invite all the regular contributors. @glyph what do you think? would you help facilitate?

glyph commented 9 years ago

Very important addendum here, “☂ U+2602 UMBRELLA” and “☔️ U+2614 U+FE0F UMBRELLA WITH RAIN DROPS” are separate unicode characters and mean totally different things :smile:

ksheedlo commented 9 years ago

@glyph has this gone anywhere since April?

glyph commented 9 years ago

@ksheedlo unfortunately, no, my focus has been elsewhere.

ksheedlo commented 9 years ago

What do you think it would look like? One thing I've thought about is adding additional REST-ish endpoints prefixed with "__mimic".

On Thursday, August 27, 2015, Glyph notifications@github.com wrote:

@ksheedlo https://github.com/ksheedlo unfortunately, no, my focus has been elsewhere.

— Reply to this email directly or view it on GitHub https://github.com/rackerlabs/mimic/issues/229#issuecomment-135616426.

glyph commented 9 years ago

I was just thinking these would be features of the existing mimic.rest.nova_api.NovaControlApi; no weird prefixes in the URLs, just an unusual endpoint name and type in the catalog.

ksheedlo commented 9 years ago

OK, but I'm mainly interested in the MaaS API. How do we take it beyond just Nova? Would that mean adding a new entry in the catalog?

On Thursday, August 27, 2015, Glyph notifications@github.com wrote:

I was just thinking these would be features of the existing mimic.rest.nova_api.NovaControlApi; no weird prefixes in the URLs, just an unusual endpoint name and type in the catalog.

— Reply to this email directly or view it on GitHub https://github.com/rackerlabs/mimic/issues/229#issuecomment-135625074.

glyph commented 9 years ago

Yes, I think the pattern is this: have one mock in the service catalog which is the public one, the "x" endpoint, let's say, that matches the name and type of the API being mocked; then write a second mock in the service catalog that is the "mimic-control-x" endpoint, that wraps the first one. So nova sets a reasonable example in this case.