コード例 #1
0
ファイル: notebook_client.py プロジェクト: apache/submarine
 def __init__(self, host: str = generate_host()):
     """
     Submarine notebook client constructor
     :param host: An HTTP URI like http://submarine-server:8080.
     """
     # TODO(pingsutw): support authentication for talking to the submarine server
     self.host = host
     configuration = Configuration()
     configuration.host = host + "/api"
     api_client = ApiClient(configuration=configuration)
     self.notebook_api = NotebookApi(api_client=api_client)
コード例 #2
0
    def __init__(
        self,
        env_vars=None,
        resources=None,
        cpu=None,
        memory=None,
        gpu=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """NotebookPodSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._env_vars = None
        self._resources = None
        self._cpu = None
        self._memory = None
        self._gpu = None
        self.discriminator = None

        if env_vars is not None:
            self.env_vars = env_vars
        if resources is not None:
            self.resources = resources
        if cpu is not None:
            self.cpu = cpu
        if memory is not None:
            self.memory = memory
        if gpu is not None:
            self.gpu = gpu
コード例 #3
0
    def __init__(self,
                 code=None,
                 success=None,
                 result=None,
                 attributes=None,
                 local_vars_configuration=None):  # noqa: E501
        """JsonResponse - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._code = None
        self._success = None
        self._result = None
        self._attributes = None
        self.discriminator = None

        if code is not None:
            self.code = code
        if success is not None:
            self.success = success
        if result is not None:
            self.result = result
        if attributes is not None:
            self.attributes = attributes
コード例 #4
0
    def __init__(
        self,
        name=None,
        channels=None,
        conda_dependencies=None,
        pip_dependencies=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """KernelSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._name = None
        self._channels = None
        self._conda_dependencies = None
        self._pip_dependencies = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if channels is not None:
            self.channels = channels
        if conda_dependencies is not None:
            self.conda_dependencies = conda_dependencies
        if pip_dependencies is not None:
            self.pip_dependencies = pip_dependencies
コード例 #5
0
ファイル: environment_spec.py プロジェクト: apache/submarine
    def __init__(
        self,
        name=None,
        docker_image=None,
        kernel_spec=None,
        description=None,
        image=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """EnvironmentSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._name = None
        self._docker_image = None
        self._kernel_spec = None
        self._description = None
        self._image = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if docker_image is not None:
            self.docker_image = docker_image
        if kernel_spec is not None:
            self.kernel_spec = kernel_spec
        if description is not None:
            self.description = description
        if image is not None:
            self.image = image
コード例 #6
0
    def __init__(
        self,
        model_name=None,
        model_version=None,
        model_type=None,
        model_uri=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """ServeSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._model_name = None
        self._model_version = None
        self._model_type = None
        self._model_uri = None
        self.discriminator = None

        if model_name is not None:
            self.model_name = model_name
        if model_version is not None:
            self.model_version = model_version
        if model_type is not None:
            self.model_type = model_type
        if model_uri is not None:
            self.model_uri = model_uri
コード例 #7
0
ファイル: code_spec.py プロジェクト: apache/submarine
    def __init__(self, sync_mode=None, url=None, local_vars_configuration=None):  # noqa: E501
        """CodeSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._sync_mode = None
        self._url = None
        self.discriminator = None

        if sync_mode is not None:
            self.sync_mode = sync_mode
        if url is not None:
            self.url = url
コード例 #8
0
    def __init__(
        self,
        replicas=None,
        resources=None,
        name=None,
        image=None,
        cmd=None,
        env_vars=None,
        cpu=None,
        memory=None,
        gpu=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """ExperimentTaskSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._replicas = None
        self._resources = None
        self._name = None
        self._image = None
        self._cmd = None
        self._env_vars = None
        self._cpu = None
        self._memory = None
        self._gpu = None
        self.discriminator = None

        if replicas is not None:
            self.replicas = replicas
        if resources is not None:
            self.resources = resources
        if name is not None:
            self.name = name
        if image is not None:
            self.image = image
        if cmd is not None:
            self.cmd = cmd
        if env_vars is not None:
            self.env_vars = env_vars
        if cpu is not None:
            self.cpu = cpu
        if memory is not None:
            self.memory = memory
        if gpu is not None:
            self.gpu = gpu
コード例 #9
0
    def __init__(self,
                 name=None,
                 params=None,
                 local_vars_configuration=None):  # noqa: E501
        """ExperimentTemplateSubmit - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._name = None
        self._params = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if params is not None:
            self.params = params
コード例 #10
0
ファイル: api_client.py プロジェクト: apache/submarine
    def __init__(self,
                 configuration=None,
                 header_name=None,
                 header_value=None,
                 cookie=None,
                 pool_threads=1):
        if configuration is None:
            configuration = Configuration.get_default_copy()
        self.configuration = configuration
        self.pool_threads = pool_threads

        self.rest_client = rest.RESTClientObject(configuration)
        self.default_headers = {}
        if header_name is not None:
            self.default_headers[header_name] = header_value
        self.cookie = cookie
        # Set default User-Agent.
        self.user_agent = "OpenAPI-Generator/0.7.0-SNAPSHOT/python"
        self.client_side_validation = configuration.client_side_validation
コード例 #11
0
ファイル: notebook_spec.py プロジェクト: apache/submarine
    def __init__(self,
                 meta=None,
                 environment=None,
                 spec=None,
                 local_vars_configuration=None):  # noqa: E501
        """NotebookSpec - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._meta = None
        self._environment = None
        self._spec = None
        self.discriminator = None

        if meta is not None:
            self.meta = meta
        if environment is not None:
            self.environment = environment
        if spec is not None:
            self.spec = spec
コード例 #12
0
ファイル: serve_request.py プロジェクト: apache/submarine
    def __init__(self,
                 model_name=None,
                 model_version=None,
                 namespace=None,
                 local_vars_configuration=None):  # noqa: E501
        """ServeRequest - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._model_name = None
        self._model_version = None
        self._namespace = None
        self.discriminator = None

        if model_name is not None:
            self.model_name = model_name
        if model_version is not None:
            self.model_version = model_version
        if namespace is not None:
            self.namespace = namespace
コード例 #13
0
ファイル: experiment_meta.py プロジェクト: apache/submarine
    def __init__(
        self,
        experiment_id=None,
        name=None,
        namespace=None,
        framework=None,
        cmd=None,
        env_vars=None,
        tags=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """ExperimentMeta - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._experiment_id = None
        self._name = None
        self._namespace = None
        self._framework = None
        self._cmd = None
        self._env_vars = None
        self._tags = None
        self.discriminator = None

        if experiment_id is not None:
            self.experiment_id = experiment_id
        if name is not None:
            self.name = name
        if namespace is not None:
            self.namespace = namespace
        if framework is not None:
            self.framework = framework
        if cmd is not None:
            self.cmd = cmd
        if env_vars is not None:
            self.env_vars = env_vars
        if tags is not None:
            self.tags = tags
コード例 #14
0
    def __init__(
        self, name=None, namespace=None, owner_id=None, labels=None, local_vars_configuration=None
    ):  # noqa: E501
        """NotebookMeta - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._name = None
        self._namespace = None
        self._owner_id = None
        self._labels = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if namespace is not None:
            self.namespace = namespace
        if owner_id is not None:
            self.owner_id = owner_id
        if labels is not None:
            self.labels = labels
コード例 #15
0
def get_api_client(host: str) -> ApiClient:
    configuration = Configuration()
    configuration.host = host + "/api"
    api_client = ApiClient(configuration=configuration)

    return api_client