Skip to content

Fontend&Backend API List

dg8fv2010 edited this page Jul 15, 2016 · 11 revisions

###code

0x1 ok
0x2 Unknown problem
0x3 APIError
0x4 Username have been occupied by others
0x5 Email has been occupied by others
0x6 wrong password
0x7 Username not found
0x8 container name occupied
0x9 container not exist

###list instance fontend request:

request_url: GET /list_ins
{
  signin_username: 'eagle_user'
}

backend response:

{
  code: 'ok',
  instances:[
    {
      image_id: 1,
      container_serial: '',
      container_name: '',
      host: '192.168.0.2',
      port: 22,
      status: 1
    }
  ]
}

###restart instance fontend request:

request_url: POST /restart_ins
{
  container_serial: 'aabbccddd',
  user_name: 'xxx'
}

backend response:

{
  code: 'ok',
  message: 'restart successful',
  container_serial: 'aaabbbcccddd',
  host: '',
  port: 0
}

###modify username fontend request:

request_url: POST /modify_username
{
  user_id: xxx,
  username: 'xxx'
}

backend response:

{
  code: '0x1',
  message: 'modify username successful'
}

###modify email fontend request:

request_url: POST /modify_email
{
  user_id: xxx,
  email: 'xxx'
}

backend response:

{
  code: '0x1',
  message: 'modify email successful'
}

###modify password fontend request:

request_url: POST /modify_password
{
  user_id: xxx,
  password: 'xxx'
}

backend response:

{
  code: '0x1',
  message: 'modify password successful'
}

Clone this wiki locally