-
Notifications
You must be signed in to change notification settings - Fork 29
Odo REST API
-
{profileIdentifier}
- Name or ID of the profile to edit (Ex: My%20Profile) -
{pathIdentifier}
- Name or ID of the path to edit (Ex: My%20Path) -
{clientUUID}
- UUID of the profile client to update, -1 is the default client (I know this is not a UUID)
POST /testproxy/api/profile/{profileIdentifier}/clients
{
"client": {
"id": 4,
"isActive": false,
"uuid": "5555-555-5555-5555",
"profile": {
…. profile information goes here
}
}
}
Clients should be deleted when they are no longer going to be used (ex: in test cleanup code)
DELETE /testproxy/api/profile/{profileIdentifier}/clients/{clientUUID}
POST /testproxy/api/profile/{profileIdentifier}/clients/{clientUUID}
POST BODY: active=true|false
POST /testproxy/api/path/{pathIdentifier}
POST BODY for Response Path: profileIdentifier={profileIdentifier}&responseEnabled=true|false
POST BODY for Request Path: profileIdentifier={profileIdentifier}&requestEnabled=true|false
POST /testproxy/api/path/{pathIdentifier}
POST BODY for Response Path: profileIdentifier={profileIdentifier}&resetResponse=true
POST BODY for Request Path: profileIdentifier={profileIdentifier}&resetRequest=true
In order to enable/disable a method on a path you need the override ID. The following request can be used to method information and find the ID {methodName} - Fully qualified method name. Ex: com.groupon.odo.override.Sleep
GET /testproxy/method/{methodName}
{
"method": {
"id": 55,
"httpCode": 200,
"description": "Sleeps",
"methodName": "Sleep",
"className": "com.groupon.odo.override",
"methodType": "interface com.groupon.odo.plugin.ResponseOverride",
"methodArguments": [
],
"methodArgumentNames": [
]
}
}
POST /testproxy/api/path/{pathIdentifier}
POST BODY: profileIdentifier={profileIdentifier}&addOverride={methodID}
Custom Response = -1 Custom Request = -2 Add Response Header = -3 Remove Response Header = -4 Add Request Header = -5 Remove Request Header = -6
POST /testproxy/api/path/{pathIdentifier}
POST BODY: profileIdentifier={profileIdentifier}&removeOverride={methodID}
Note: This is not always needed.. depends on the method you are using
The "ordinal" parameter is optional and is intended to indicate which enabled override you want to modify if multiple instances of the same override were added (ex: multiple custom responses). The ordinal is based at 1.
POST /testproxy/api/path/{pathIdentifier}/{methodName}
POST BODY: profileIdentifier={profileIdentifier}&ordinal=1&arguments[]=argument1&arguments[]=argument2&arguments[]=argument3
Custom response data is just the first argument to the custom response enabled override
POST /testproxy/api/path/{pathIdentifier}/-1
POST BODY: profileIdentifier={profileIdentifier}&ordinal=1&arguments[]=this%20is%20my%20custom%20response
POST /testproxy/api/path/{pathIdentifier}
POST BODY for Response Path: profileIdentifier={profileIdentifier}&customResponse=<data>
POST BODY for Request Path: profileIdentifier={profileIdentifier}&customRequest=<data>
You can set the repeat count for a specific enabled method instead of the whole path. This is the same call as setting an argument except using the parameter repeatNumber
POST /testproxy/api/path/{pathIdentifier}/-1
POST BODY: profileIdentifier={profileIdentifier}&ordinal=1&repeatNumber=5