ndio/remote/resources.py
def create_token(self,
                     token_name,
                     project_name,
                     dataset_name,
                     is_public):
        """
        Creates a token with the given parameters.
        Arguments:
            project_name (str): Project name
            dataset_name (str): Dataset name project is based on
            token_name (str): Token name
            is_public (int): 1 is public. 0 is not public
        Returns:
            bool: True if project created, false if not created.
        """
        url = self.url() + '/nd/resource/dataset/{}'.format(
            dataset_name) + '/project/{}'.format(project_name) + \
            '/token/{}/'.format(token_name)

        json = {
            "token_name": token_name,
            "public": is_public
        }

        req = self.remote_utils.post_url(url, json=json)

        if req.status_code is not 201:
            raise RemoteDataUploadError('Cout not upload {}:'.format(req.text))
        if req.content == "" or req.content == b'':
            return True
        else:
            return False
def create_token(self,
                     token_name,
                     project_name,
                     dataset_name,
                     is_public):
        """
        Creates a token with the given parameters.
        Arguments:
            project_name (str): Project name
            dataset_name (str): Dataset name project is based on
            token_name (str): Token name
            is_public (int): 1 is public. 0 is not public
        Returns:
            bool: True if project created, false if not created.
        """
        url = self.url() + '/nd/resource/dataset/{}'.format(
            dataset_name) + '/project/{}'.format(project_name) + \
            '/token/{}/'.format(token_name)

        json = {
            "token_name": token_name,
            "public": is_public
        }

        req = self.remote_utils.post_url(url, json=json)

        if req.status_code is not 201:
            raise RemoteDataUploadError('Cout not upload {}:'.format(req.text))
        if req.content == "" or req.content == b'':
            return True
        else:
            return False
def create_token ( self , token_name , project_name , dataset_name , is_public ) : url = self . url ( ) + '/nd/resource/dataset/{}' . format ( dataset_name ) + '/project/{}' . format ( project_name ) + '/token/{}/' . format ( token_name ) json = { "token_name" : token_name , "public" : is_public } req = self . remote_utils . post_url ( url , json = json ) if req . status_code is not 201 : raise RemoteDataUploadError ( 'Cout not upload {}:' . format ( req . text ) ) if req . content == "" or req . content == b'' : return True else : return False
Creates a token with the given parameters.
        Arguments:
            project_name (str): Project name
            dataset_name (str): Dataset name project is based on
            token_name (str): Token name
            is_public (int): 1 is public. 0 is not public
        Returns:
            bool: True if project created, false if not created.
Creates a token with the given parameters . Arguments : project_name ( str ) : Project name dataset_name ( str ) : Dataset name project is based on token_name ( str ) : Token name is_public ( int ) : 1 is public . 0 is not public Returns : bool : True if project created false if not created .