Mimic is an API-compatible mock service

Mimic is an API-compatible mock service for Openstack Compute and Rackspace’s implementation of Identity and Cloud Load balancers. It is backed by in-memory data structure rather than a potentially expensive database.

Mimic helps with:

  • fast set-up
  • instant response
  • cost efficient
  • enables offline development
  • enables ability to test unusual behaviors/errors of an api
  • acts as a central repository for mocked responses from services

Quick start

The fastest way to install and start Mimic is:

pip install mimic
twistd -n mimic

You can test the server started successfully by sending this request and checking for the welcome message:

curl http://localhost:8900
>> To get started with Mimic, POST an authentication request to:
>> /identity/v2.0/tokens

You can use the command below to test authentication and see your service catalog. The service catalog contains the endpoints for other available APIs.

curl -s -XPOST -d '{"auth":{"RAX-KSKEY:apiKeyCredentials":{"username":"mimic","apiKey":"12345"}}}' http://localhost:8900/identity/v2.0/tokens | python -m json.tool

In order to use Mimic with most other projects you just need to override the Authentication Endpoint. In many projects, including the OpenStack Client CLI or the OpenStack Keystone client you can do that by setting the OS_AUTH_URL environment variable or the --os-auth-url option. For example:

keystone --os-username mimic --os-password 1235 --os-auth-url http://localhost:8900/identity/v2.0/ catalog

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store