Environments

Get Specific Environment

Gets the information for a single environment.

GET /api/environments/{id}

Permissions

User must be logged in. User must be a member of the environment.

Query Params

Param

Description

Optional/Required

id=[number]

id of the environment to get

Required

Success Response

200 OK
{
    "id": 1,
    "envName": "Test Environment 1",
    "ownerId": 1,
    "accessKey": "XXXXXXXXXX",
    "secretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "region": "us-east-2",
    "dbName": "DB",
    "host": "xxxxx.xxxxx.us-east-2.rds.amazonaws.com",
    "user": "user",
    "pass": "pass",
    "instance": "XXXXX",
    "parameterGroup": "paramGroup",
    "bucket": "testBucket",
    "prefix": null
}

Error Response

404 NOT FOUND
{
    "code": 404,
    "message": "Not Found"
}

Get All Environments

Gets all of the information for all environments that the user has access to.

GET /api/environments

Permissions

User must be logged in.

Success Response

200 OK
[
    {
        "id": 1,
        "name": "Test Environment 1",
        "ownerId": 1,
        "awsKeysId": 1,
        "dbId": 1,
        "s3Id": 1
    },
    {
        "id": 2,
        "name": "Test Environment 2",
        "ownerId": 1,
        "awsKeysId": 2,
        "dbId": 4,
        "s3Id": 2
    }
]

Error Response

404 NOT FOUND
{
    "code": 404,
    "message": "Not Found"
}

Post a New Environment

Creates a new environment that can be used in the application. The environment will be used to house a collection of captures and replays.

POST /api/environments

Permissions

User must be logged in.

Body Params

Param

Description

Optional/Required

accessKey=[string]

Access key for AWS resource

Required

secretKey=[string]

Secret key for AWS resource

Required

region=[string]

Region assigned to AWS resource

Required

bucket=[string]

S3 bucket AWS resource

Required

dbName=[string]

Name of AWS DB resource

Required

host=[string]

Where the AWS server resource is

Required

user=[string]

Username for AWS resource

Required

pass=[string]

Password for AWS resource

Required

envName=[string]

Environment name to add AWS resource to

Required

instance=[string]

AWS EC2 instance

Required

parameterGroup=[string]

AWS DB container for engine configuration

Optional

keysName=[string]

Saves previously chosen AWS IAM credentials in placeholder

Optional

prefix=[string]

Optional directory name to store workload and metrics files in AWS S3 resource

Optional

Sample Request Body

{
 "accessKey": "XXXXXXXXXX",
 "secretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 "region" : "us-east-2",
 "bucket" : "testBucket",
 "dbName" : "DB",
 "host" : "xxxxx.xxxxx.us-east-2.rds.amazonaws.com",
 "user" : "user",
 "pass" : "pass",
 "envName": "Test Environment 2",
 "instance" : "XXXXX",
 "parameterGroup": "paramGroup"
}

Success Response

200 OK
{
    "id": 2,
    "name": "Test Environment 2",
    "ownerId": 1,
    "awsKeysId": 2,
    "dbId": 4,
    "s3Id": 2
}

Error Response

400 BAD REQUEST
{
    "code": 400,
    "message": "Environment with same name already exists"
}

Edit an Existing Environment

Modifies an existing environment.

PUT /api/environments/{id}

Permissions

User must be logged in. User must be the environment admin.

Query Params

Param

Description

Optional/Required

id=[number]

id of the environment to edit

Required

Body Params

Param

Description

Optional/Required

accessKey=[string]

Access key for AWS resource

Required

secretKey=[string]

Secret key for AWS resource

Required

region=[string]

Region assigned to AWS resource

Required

bucket=[string]

S3 bucket AWS resource

Required

dbName=[string]

Name of AWS DB resource

Required

host=[string]

Where the AWS server resource is

Required

user=[string]

Username for AWS resource

Required

pass=[string]

Password for AWS resource

Required

envName=[string]

Environment name to add AWS resource to

Required

instance=[string]

AWS EC2 instance

Required

parameterGroup=[string]

AWS DB container for engine configuration

Optional

keysName=[string]

Saves previously chosen AWS IAM credentials in placeholder

Optional

prefix=[string]

Optional directory name to store workload and metrics files in AWS S3 resource

Optional

Sample Request Body

{
 "accessKey": "XXXXXXXXXX",
 "secretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
 "region" : "us-east-2",
 "bucket" : "testBucket",
 "dbName" : "DB",
 "host" : "xxxxx.xxxxx.us-east-2.rds.amazonaws.com",
 "user" : "user",
 "pass" : "pass",
 "envName": "Updated Env Name",
 "instance" : "XXXXX",
 "parameterGroup": "paramGroup"
}

Success Response

200 OK

Error Response

404 NOT FOUND
{
    "code": 404,
    "message": "The environment was not found"
}

Delete an Environment

Removes an existing environment from the application.

DELETE /api/environments/{id}

Permissions

User must be logged in. User must be the environment admin.

Query Params

Param

Description

Optional/Required

id=[number]

id of the environment to edit

Required

Success Response

200 OK
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 0,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "",
    "protocol41": true,
    "changedRows": 0
}

Error Response

401 UNAUTHORIZED
{
    "code": 401,
    "message": "Admin login required."
}
404 NOT FOUND
{
    "code": 404,
    "message": "The environment was not found"
}

Last updated