Rename a file or directory
patch
/20260430/aiDataPlatforms/{aiDataPlatformId}/workspaces/{workspaceKey}/notebook/api/contents/{contentPath}
Renames a file or directory without re-uploading content.
Request
Path Parameters
-
aiDataPlatformId(required): string
The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the AI Data Platform (Data Lake) instance.
-
contentPath(required): string
The path to the notebook file.
-
workspaceKey(required): string
The key of the Workspace
Header Parameters
-
if-match: string
For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
-
should-update-recent: boolean
A flag to identify if the recent list should be updated.Default Value:
false
New path for file or directory.
Root Schema : ModifyContentDetails
Type:
objectPath of file to copy. 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
Show Source
-
path:
string
New path for file or directory
Response
Supported Media Types
- application/json
200 Response
Successful operation. Directory or file path is updated.
Headers
-
Location: string(url)
Updated URL for the file or directory.
-
etag: string
For optimistic concurrency control. See `if-match`.
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
-
opc-work-request-id: string
The OCID of the asynchronous work request. Use GetWorkRequest with this ID to track the status of the request.
Root Schema : Content
Type:
objectContent model provides a programmatic interface to interact with notebooks, files and directories within the AI Data Platform Workbench Notebook environment.
Type field is used to describe content types like file, directory or notebook.
Other notable fields are content and format. The content and format keys may be null if content is not contained.
Show Source
-
content(required):
object content
Content if requested, otherwise is Null. For Notebook model, this contains a nbformat NotebookNode representing the .ipynb file represented by the model. For File model, content field is always Unicode type. For text-format file models, content simply contains the bytes of the file after decoding as UTF-8. Non-text (base64) files are read as bytes, base64 encoded, and then decoded as UTF-8. For Directory model, content field contains a list of content-free models representing the entities in the directory.
-
created(required):
string(date-time)
Creation timestamp.
-
description:
string
A user-provided description of the file.
-
format(required):
string
Allowed Values:
[ "NULL", "json", "text", "base64" ]Format of content. For Notebook model, format field is always 'json'. For File model, format field is either 'text' or 'base64'. For directory model, format field is always 'json'. -
hash:
string
[optional] The hexdigest hash string of content, if requested, otherwise null. It cannot be null if hashAlgorithm is defined.
-
hash_algorithm:
string
[optional] The algorithm used to produce the hash, if requested, (otherwise null). It cannot be null if hash is defined. Available algorithms.
-
last_modified(required):
string(date-time)
Last modified timestamp.
-
mimetype(required):
string
Mimetype is only applicable for File model. For other models, it is None. If content is not null, and type is 'file', this contains the mimetype of file. For example, text/plain application/octet-stream. Otherwise this is null.
-
name(required):
string
Name of notebook, file or directory, equivalent to the last part of the path.
-
path(required):
string
Full path for notebook, file or directory.
-
size:
integer
Size of file or notebook in bytes. If no size is provided, defaults to null.
-
type(required):
string
Allowed Values:
[ "notebook", "file", "directory" ]Type of content model. -
writable(required):
boolean
Indicates whether the requester has permission to edit the file.
Nested Schema : content
Type:
objectContent if requested, otherwise is Null.
For Notebook model, this contains a nbformat NotebookNode representing the .ipynb file represented by the model.
For File model, content field is always Unicode type. For text-format file models, content simply contains the bytes of the file after decoding as UTF-8.
Non-text (base64) files are read as bytes, base64 encoded, and then decoded as UTF-8.
For Directory model, content field contains a list of content-free models representing the entities in the directory.
400 Response
Bad Request (invalid query parameters, malformed headers, and so on).
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
401 Response
Unauthorized (missing or expired credentials, and so on).
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
404 Response
Not Found. The requested resource was not found.
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
409 Response
Conflict. Request conflicts with the current state of the resource.
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
412 Response
Precondition Failed (One or more conditions in request failed).
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
429 Response
Too Many Requests. Too many requests sent to the server in a short period.
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
500 Response
Internal Server Error. The server encountered an unexpected condition preventing fulfilment of the request.
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.
Default Response
Unknown Error. Error is not recognized by the system.
Headers
-
opc-request-id: string
Unique Oracle-assigned ID for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error message.