Class ContentsApi

    • Method Detail

      • apiContentsPathCheckpointsPost

        public Checkpoints apiContentsPathCheckpointsPost​(String path)
                                                   throws ApiException
        Create a new checkpoint for a file Create a new checkpoint with the current state of a file. With the default FileContentsManager, only one checkpoint is supported, so creating new checkpoints clobbers existing ones.
        Parameters:
        path - file path (required)
        Returns:
        Checkpoints
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathCheckpointsPostWithHttpInfo

        public ApiResponse<CheckpointsapiContentsPathCheckpointsPostWithHttpInfo​(String path)
                                                                            throws ApiException
        Create a new checkpoint for a file Create a new checkpoint with the current state of a file. With the default FileContentsManager, only one checkpoint is supported, so creating new checkpoints clobbers existing ones.
        Parameters:
        path - file path (required)
        Returns:
        ApiResponse<Checkpoints>
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathGet

        public Contents apiContentsPathGet​(String path,
                                           String type,
                                           String format,
                                           Integer content,
                                           Integer hash)
                                    throws ApiException
        Get contents of file or directory A client can optionally specify a type and/or format argument via URL parameter. When given, the Contents service shall return a model in the requested type and/or format. If the request cannot be satisfied, e.g. type=text is requested, but the file is binary, then the request shall fail with 400 and have a JSON response containing a 'reason' field, with the value 'bad format' or 'bad type', depending on what was requested.
        Parameters:
        path - file path (required)
        type - File type ('file', 'directory') (optional)
        format - How file content should be returned ('text', 'base64') (optional)
        content - Return content (0 for no content, 1 for return content) (optional)
        hash - May return hash hexdigest string of content and the hash algorithm (0 for no hash - default, 1 for return hash). It may be ignored by the content manager. (optional)
        Returns:
        Contents
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathGetWithHttpInfo

        public ApiResponse<ContentsapiContentsPathGetWithHttpInfo​(String path,
                                                                    String type,
                                                                    String format,
                                                                    Integer content,
                                                                    Integer hash)
                                                             throws ApiException
        Get contents of file or directory A client can optionally specify a type and/or format argument via URL parameter. When given, the Contents service shall return a model in the requested type and/or format. If the request cannot be satisfied, e.g. type=text is requested, but the file is binary, then the request shall fail with 400 and have a JSON response containing a 'reason' field, with the value 'bad format' or 'bad type', depending on what was requested.
        Parameters:
        path - file path (required)
        type - File type ('file', 'directory') (optional)
        format - How file content should be returned ('text', 'base64') (optional)
        content - Return content (0 for no content, 1 for return content) (optional)
        hash - May return hash hexdigest string of content and the hash algorithm (0 for no hash - default, 1 for return hash). It may be ignored by the content manager. (optional)
        Returns:
        ApiResponse<Contents>
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathPost

        public Contents apiContentsPathPost​(String path,
                                            ApiContentsPathPostRequest model)
                                     throws ApiException
        Create a new file in the specified path A POST to /api/contents/path creates a New untitled, empty file or directory. A POST to /api/contents/path with body {'copy_from': '/path/to/OtherNotebook.ipynb'} creates a new copy of OtherNotebook in path.
        Parameters:
        path - file path (required)
        model - Path of file to copy (optional)
        Returns:
        Contents
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathPostWithHttpInfo

        public ApiResponse<ContentsapiContentsPathPostWithHttpInfo​(String path,
                                                                     ApiContentsPathPostRequest model)
                                                              throws ApiException
        Create a new file in the specified path A POST to /api/contents/path creates a New untitled, empty file or directory. A POST to /api/contents/path with body {'copy_from': '/path/to/OtherNotebook.ipynb'} creates a new copy of OtherNotebook in path.
        Parameters:
        path - file path (required)
        model - Path of file to copy (optional)
        Returns:
        ApiResponse<Contents>
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathPut

        public Contents apiContentsPathPut​(String path,
                                           ApiContentsPathPutRequest model)
                                    throws ApiException
        Save or upload file. Saves the file in the location specified by name and path. PUT is very similar to POST, but the requester specifies the name, whereas with POST, the server picks the name.
        Parameters:
        path - file path (required)
        model - New path for file or directory (optional)
        Returns:
        Contents
        Throws:
        ApiException - if fails to make API call
      • apiContentsPathPutWithHttpInfo

        public ApiResponse<ContentsapiContentsPathPutWithHttpInfo​(String path,
                                                                    ApiContentsPathPutRequest model)
                                                             throws ApiException
        Save or upload file. Saves the file in the location specified by name and path. PUT is very similar to POST, but the requester specifies the name, whereas with POST, the server picks the name.
        Parameters:
        path - file path (required)
        model - New path for file or directory (optional)
        Returns:
        ApiResponse<Contents>
        Throws:
        ApiException - if fails to make API call