GithubHelp home page GithubHelp logo

bc-class's Introduction

bc-class

API 文档

创建 Deloyment

POST: /create/deployment

Request:

{
    "name":"bc-class",  // deployment 名字,确保唯一性
    "labels":{
        "app":"bc-class"    // deployment 标签,其值最好与名字一致
    },
    "pod":{
        "labels":{
            "app":"bc-class"    // pod 标签,其值最好与 deployment 名字一致
        },
        "containers":[      // 容器数组
            {
                "name":"novnc",  // required
                "image":"uhub.service.ucloud.cn/safehouse/novnc",    // required
                "command":[
                    "/bin/sh"
                ],
                "args":[
                    "-c",
                    "/usr/src/app/noVNC/utils/launch.sh --vnc localhost:5091"
                ],
                "containerPorts":[
                    {
                        "container_port":6080    // required
                    }
                ]
            },
            {
                "name":"ubuntu-xfce-vnc",
                "image":"uhub.service.ucloud.cn/safehouse/ubuntu-xfce-vnc",
                "containerPorts":[
                    {
                        "container_port":5901
                    }
                ]
            }
        ]
    }
}

Response:

{
    "code": 200,
    "message": "Create successful"
}

罗列所有课程环境

GET: /list/deployment

Response:

{
    code: 200,
    message: 'ok',
    data: [
        {
            name: 'deployment name',
            available: 60
        }
    ]
}

罗列一个 deployment 下面的 pod

GET: /list/pod/:deployment

Response:

{
    "code":200,
    "data":[
        {
            "name":"etherum-64b46fb57f-qvdwk",
            "ip":"2002:ac1c:b401:1::2"
        },
        {
            "name":"etherum-64b46fb57f-r98ng",
            "ip":"2002:ac1c:b401:1::3"
        },
        {
            "name":"etherum-64b46fb57f-szhzl",
            "ip":"2002:ac1c:b401:1::3"
        }
    ]
}

删除一个 Pod

DELETE: /pod/:name

Response:

{
    code: 200,
    message: 'Delete successful'
}

扩容 deployment

GET: /scale/:deployment/:amount

Response:

{
    code: 200,
    message: 'Scale successful'
}

bc-class's People

Contributors

wang-kai avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.