Mapsor API (0.2.0)

Download OpenAPI specification:Download

The purpose of this application is to provide documentation of the APIs in mapsor

Authentication

TokenAuth

Security scheme type: API Key
Query parameter name: token

Adds a new user, requires admin's auth token

Authorizations:
query Parameters
role
any

role of the user, default role is operator

Request Body schema: application/json
user
required
string

Username

Responses

201

Successfully Added user

400

Bad request

401

Token key is missing or invalid

403

Forbidden to access the resource

409

Image Already exists

500

Internal Server Error

post /add-user

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/add-user

Production Server

https://api.mapsor.amagi.tv/add-user

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user": "cloudport"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "kjrtklnhgcyk",
  • "message": "Please keep the token safely. It cannot be retrieved again"
}

Regenerates auth token for an existing user, requires admin's auth token

Authorizations:
Request Body schema: application/json
user
required
string

Username

Responses

201

Successfully Regenerated token for user

400

Bad request

401

Token key is missing or invalid

403

Forbidden to access the resource

409

Image Already exists

500

Internal Server Error

post /regenerate-token

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/regenerate-token

Production Server

https://api.mapsor.amagi.tv/regenerate-token

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user": "cloudport"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "token": "kjrtklnhgcyk",
  • "message": "Please keep the token safely. It cannot be retrieved again"
}

Enables user, requires admin's auth token

Authorizations:
Request Body schema: application/json
user
required
string

Username

Responses

201

Successfully enabled user

400

Bad request

401

Token key is missing or invalid

403

Forbidden to access the resource

409

Image Already exists

500

Internal Server Error

post /enable-user

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/enable-user

Production Server

https://api.mapsor.amagi.tv/enable-user

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user": "cloudport"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error":
    {
    }
}

disables user, requires admin's auth token

Authorizations:
Request Body schema: application/json
user
required
string

Username

Responses

201

Successfully disabled user

400

Bad request

401

Token key is missing or invalid

403

Forbidden to access the resource

409

Image Already exists

500

Internal Server Error

post /disable-user

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/disable-user

Production Server

https://api.mapsor.amagi.tv/disable-user

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "user": "cloudport"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error":
    {
    }
}

Schedules a container job, requires operator's access

Authorizations:
Request Body schema: application/json
customer
required
string (customer for which the job is run)

Customer

cloud
required
string (cloud_provider represents the list of all cloud providers supported)
Enum: "aws" "azure"

Cloud provider

region
required
string (region represents the region where the job was scheduled)

Cloud Provider region where the job was scheduled

env
object (env represents the environment variables passed to the container)

Key pair values of environment variables

id
required
string

Submitter Job Classification Identifier

tags
object (tags represents the custom tags used to tag the job)

Customer submitter tags

resources
object (resources represents the compute resources required to run the job)

Compute resources

image
string (dockerImage represents the docker image url)

Docker image url

command
Array of strings (command represents the docker arguments passed to the container)

Docker arguments

ami
string (AMI which needs to be used for EC2 job submission)

AMI

user_data
string (user data which needs to be passed for EC2 job submission)

User Data

priority
string (priority represents the Job priority)
Enum: "HIGH" "LOW"

Job priority

timeout
integer (timeout for a job's execution)

Job timeout

queue
string (Batch queue which needs to be used for Batch job submission)

Job Queue

Responses

200

queued container job

400

Bad request

401

Token key is missing or invalid

500

Internal Server Error

post /submit

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/submit

Production Server

https://api.mapsor.amagi.tv/submit

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "cloud": "aws",
  • "region": "us-east-1",
  • "env":
    {
    },
  • "id": "Transcode_23",
  • "customer": "lightning",
  • "tags":
    {
    },
  • "resources":
    {
    },
  • "image/ami": "hello-world:linux",
  • "command/user_data": "[]/<some_user_data>",
  • "priority/queue": "HIGH/<queue_name>"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "job_id": "string"
}

Gets status of a submitted job, requires operator access

Authorizations:
path Parameters
id
required
string

Job ID

Responses

200

Job status

401

Token key is missing or invalid

404

Resource not found

500

Internal Server Error

get /status/{id}

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/status/{id}

Production Server

https://api.mapsor.amagi.tv/status/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "REJECTED"
}

Cancel a job, requires operator access

Authorizations:
path Parameters
id
required
string

Job ID

Responses

200

Cancel a job

400

Bad request

401

Token key is missing or invalid

404

Resource not found

500

Internal Server Error

get /cancel/{id}

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/cancel/{id}

Production Server

https://api.mapsor.amagi.tv/cancel/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "response": "string"
}

Retry a previous job, requires operator access

Authorizations:
path Parameters
id
required
string

Job ID

Responses

200

Retry a previous job

400

Bad request

401

Token key is missing or invalid

404

Resource not found

500

Internal Server Error

get /retry/{id}

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/retry/{id}

Production Server

https://api.mapsor.amagi.tv/retry/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "job_id": "string"
}

Returns logs of a job, requires operator access

Authorizations:
path Parameters
id
required
string

Job ID

Responses

200

Returns logs of a job

400

Bad request

401

Token key is missing or invalid

404

Resource not found

500

Internal Server Error

get /logs/{id}

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/logs/{id}

Production Server

https://api.mapsor.amagi.tv/logs/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error":
    {
    }
}

Returns list of jobs, requires monitor/operator access

Authorizations:
query Parameters
customer
required
string

Customer Name

start_time
required
number

Job Submission time in epoch milliseconds FROM where to filter

end_time
required
number

Job Submission time in epoch milliseconds UPTO where to filter

id
string

Submitter Job Classification Identifier

cloud
string (cloud_provider represents the list of all cloud providers supported)
Enum: "aws" "azure"

Cloud Provider

region
string

Region name of deployment as per cloud provider

Responses

200

Retuns list of jobs

401

Token key is missing or invalid

500

Internal Server Error

get /list

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/list

Production Server

https://api.mapsor.amagi.tv/list

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "response":
    [
    ]
}

Returns pubnub info of a ec2 job, requires operator access, this will be Successfull only if the spot request is visible. Ideally this request should come from the spot.

Authorizations:
query Parameters
id
required
string

Region

id
required
string

Instance ID

Responses

201

Pubnub info

400

Bad request

401

Token key is missing or invalid

500

Internal Server Error

get /get-info/{region}/{instance_id}

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/get-info/{region}/{instance_id}

Production Server

https://api.mapsor.amagi.tv/get-info/{region}/{instance_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "job_id": "3892fea6-df92-11e9-9d97-f2a54137d40c",
  • "publish_key": "pub-c-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  • "subscribe_key": "sub-c-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Terminates instance of a ec2 job, requires operator access, this will be Successfull only if the spot request is visible. Ideally this request should come from the spot.

Authorizations:
query Parameters
id
required
string

Region

id
required
string

Instance ID

Responses

201

Pubnub info

400

Bad request

401

Token key is missing or invalid

500

Internal Server Error

get /destroy/{region}/{instance_id}

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/destroy/{region}/{instance_id}

Production Server

https://api.mapsor.amagi.tv/destroy/{region}/{instance_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "response": "Terminated instance"
}

Returns list of jobs, requires admin access

Authorizations:
query Parameters
start_date
required
number

Time in epoch milliseconds FROM where to filter

end_date
required
number

Time in epoch milliseconds UPTO where to filter

cloud_provider
required
string (cloud_provider represents the list of all cloud providers supported)
Enum: "aws" "azure"

Cloud Provider

region
required
string

Region name of deployment as per cloud provider

price
int64

Total price to be charged. If given, the API returns cost per customer

Responses

200

Retuns list of jobs

400

Bad request

401

Token key is missing or invalid

500

Internal Server Error

get /get-metrics

Development Server

https://pbohw6r8e1.execute-api.us-east-1.amazonaws.com/dev/?token=Vqv80iwJyHVPreFu47dNYg/get-metrics

Production Server

https://api.mapsor.amagi.tv/get-metrics

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "response": { }
}