src/sasctl/_services/model_repository.py
def import_model_from_zip(cls, name, project, file, description=None,
                              version='latest'):
        """Import a model and contents as a ZIP file into a model project.

        Parameters
        ----------
        name : str or dict
            The name of the model.
        project : str or dict
            The name or id of the model project, or a dictionary
            representation of the project.
        description : str
            The description of the model.
        file : bytes
            The ZIP file containing the model and contents.

        Returns
        -------
        RestObj
            The API response after importing the model.

        """
        project = cls.get_project(project)

        if project is None:
            raise ValueError('Project `%s` could not be found.' % str(project))

        params = {'name': name,
                  'description': description,
                  'type': 'ZIP',
                  'projectId': project.id,
                  'versionOption': version}
        params = '&'.join('{}={}'.format(k, v) for k, v in params.items())

        r = cls.post('/models#octetStream',
                     data=file.read(),
                     params=params,
                     headers={'Content-Type': 'application/octet-stream'})
        return r
Import a model and contents as a ZIP file into a model project.

        Parameters
        ----------
        name : str or dict
            The name of the model.
        project : str or dict
            The name or id of the model project, or a dictionary
            representation of the project.
        description : str
            The description of the model.
        file : bytes
            The ZIP file containing the model and contents.

        Returns
        -------
        RestObj
            The API response after importing the model.

        
Import a model and contents as a ZIP file into a model project.
Parameters

name : str or dict
The name of the model.
project : str or dict
The name or id of the model project, or a dictionary
representation of the project.
description : str
The description of the model.
file : bytes
The ZIP file containing the model and contents.

Returns

RestObj
The API response after importing the model.
Import a model and contents as a ZIP file into a model project . Parameters name : str or dict The name of the model . project : str or dict The name or id of the model project or a dictionary representation of the project . description : str The description of the model . file : bytes The ZIP file containing the model and contents . Returns RestObj The API response after importing the model .
def import_model_from_zip(cls, name, project, file, description=None,
                              version='latest'):
        project = cls.get_project(project)
        if project is None:
            raise ValueError('Project `%s` could not be found.' % str(project))
        params = {'name': name,
                  'description': description,
                  'type': 'ZIP',
                  'projectId': project.id,
                  'versionOption': version}
        params = '&'.join('{}={}'.format(k, v) for k, v in params.items())
        r = cls.post('/models#octetStream',
                     data=file.read(),
                     params=params,
                     headers={'Content-Type': 'application/octet-stream'})
        return r
def import_model_from_zip ( cls , name , project , file , description = None , version = 'latest' ) : project = cls . get_project ( project ) if project is None : raise ValueError ( 'Project `%s` could not be found.' % str ( project ) ) params = { 'name' : name , 'description' : description , 'type' : 'ZIP' , 'projectId' : project . id , 'versionOption' : version } params = '&' . join ( '{}={}' . format ( k , v ) for k , v in params . items ( ) ) r = cls . post ( '/models#octetStream' , data = file . read ( ) , params = params , headers = { 'Content-Type' : 'application/octet-stream' } ) return r
Import a model and contents as a ZIP file into a model project.
Import a model and contents as a ZIP file into a model project .
"""Import a model and contents as a ZIP file into a model project.

        Parameters
        ----------
        name : str or dict
            The name of the model.
        project : str or dict
            The name or id of the model project, or a dictionary
            representation of the project.
        description : str
            The description of the model.
        file : bytes
            The ZIP file containing the model and contents.

        Returns
        -------
        RestObj
            The API response after importing the model.

        """
cls
name
project
file
description
version