-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathmimic_presets.py
59 lines (56 loc) · 3.79 KB
/
mimic_presets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
Defines the preset values in the mimic api.
"""
from __future__ import absolute_import, division, unicode_literals
get_presets = {"loadbalancers": {"lb_building": "On create load balancer, keeps the load balancer in "
"building state for given seconds",
"lb_error_state": "Puts the LB in error state, and such an LB can only"
"be deleted",
"lb_pending_update": "Changes the load balancer to PENDING-UPDATE"
"state for the given number of seconds, any action"
"other than delete is performed on the server",
"lb_pending_delete": "Changes the load balancer to PENDING-DELETE"
"state for the given seconds, when deleted"},
"servers": {"create_server_failure": "{\"message\": \"given message\","
"\"code\": given code}",
"delete_server_failure": "{\"code\": given code,"
"\"times\": returns given code that many times}",
"invalid_image_ref": ["INVALID-IMAGE-ID", "1111", "image_ends_with_Z"],
"invalid_flavor_ref": ["INVALID-FLAVOR-ID", "8888", "-4", "1"],
"server_error": "sets server state to error on create",
"server_building": "sets the server to be in building state for given time"
" in seconds"},
"identity": {
# On ``validate_token`` the tokens listed below
# result in 'monitoring-service-admin' impersonator role.
"maas_admin_roles": [
"this_is_an_impersonator_token",
"this_is_an_impersonator_token_also",
"impersonate_watson",
"impersonate_creator",
"this_is_an_impersonator_token_also_2",
"impersonate_foo_token"],
# On ``validate_token`` the tokens listed below
# result in 'racker' impersonator role.
"racker_token": ["this_is_a_racker_token"],
# Tenants with user observer role
"observer_role": ["09876"],
# Tenants with user creator role
"creator_role": ["09090"],
# Tenants with user admin role
"admin_role": ["9999"],
# Tenants with this token result in a 401 when validating the token
"token_fail_to_auth": ["never-cache-this-and-fail-to-auth"],
# Users presenting these tokens have contact IDs that correspond
# to presets in the Valkyrie plugin...
"non_dedicated_observer": ["OneTwo"],
"non_dedicated_admin": ["ThreeFour"],
"non_dedicated_impersonator": ["ThreeFourImpersonator"],
"non_dedicated_racker": ["ThreeFourRacker"],
"dedicated_full_device_permission_holder": ["HybridOneTwo"],
"dedicated_account_permission_holder": ["HybridThreeFour"],
"dedicated_impersonator": ["HybridThreeFourImpersonator"],
"dedicated_racker": ["HybridOneTwoRacker"],
"dedicated_limited_device_permission_holder": ["HybridFiveSix"],
"dedicated_non_permission_holder": ["HybridSevenEight"],
"dedicated_quasi_user_impersonator": ["HybridNineZero"]}}