project.py 456 Bytes
Newer Older
1 2 3 4 5 6 7
# -*- coding: utf-8 -*-

import sys
import base
import swagger_client

class Project(base.Base):
Yan's avatar
Yan committed
8
    def create_project(self, name=None,
9
        metadata = {}, **kwargs):
Yan's avatar
Yan committed
10 11
        if name is None:
            name = base._random_name("project")
12 13 14 15
        client = self._get_client(**kwargs)
        _, _, header = client.projects_post_with_http_info(
            swagger_client.ProjectReq(name, metadata))
        return base._get_id_from_header(header), name