Nexfs Management API Documentation

Method Index

CreateFile

Create new files within the Nexfs Filesystem using the management API


Action: CreateFiles

Creates one or more new files within the Nexfs Filesystem

Permissions

The requesting session must have the nexfs/CreateFiles role enabled.


Request Parameters

A request must be made against the nexfs management console api with the CreateFile action.


The request must be signed with a valid AWS V4 style Signature using an active temporary session security token.


Action

CreateFiles


RequestJson

A URI encoded json string containing a list of new file properties


RequestJson Format


{

"Files": [

{

"Name": "string",

"Size": integer,

"ChunkSize": integer,

"Owner": "string",

"Group": "string",

"OwnerRead": integer,

"OwnerWrite": integer,

"OwnerExec": integer,

"GroupRead": integer,

"GroupWrite": integer,

"GroupExec": integer,

"OtherRead": integer,

"OtherWrite": integer,

"OtherExec": integer,

"Path": "string"

}

]

}


RequestJson Elements


Name

The name of the new folder to be created

Size

The initial size in bytes of the new file to be created (file is created thin provisioned)


ChunkSize

The data part ChunkSize to be used for the file, cannot be changed after the file has data written to it that exceeds the existing file ChunkSize.


Default: Value of configuration parameter PARTSIZE


Valid Values: An integer between 512000 and 8192000, value must be a factor of 512


Owner

(Optional) The POSIX Owner to attach to the new file

Default: root


Group

(Optional) The POSIX Group to attach to the new file

Default: root

OwnerRead (Optional)

0 (Owner DOES NOT have posix READ access to the new file) or

1 (Owner HAS posix READ access to the new file)

Default: 0

OwnerWrite (Optional)

0 (Owner DOES NOT have posix WRITE access to the new file) or

1 (Owner HAS posix WRITE access to the new file)

Default: 0


OwnerExec (Optional)

0 (Owner DOES NOT HAVE posix ACCESS to execute (run the new file) or

1 (Owner HAS posix ACCESS to execute (run) the new file)

Default: 0


GroupRead (Optional)

0 (Group DOES NOT have posix READ access to the new file) or

1 (Group HAS posix READ access to the new file)

Default: 0


GroupWrite (Optional)

0 (Group DOES NOT have posix WRITE access to the new file) or

1 (Group HAS posix WRITE access to the new file)

Default: 0


GroupExec (Optional)

0 (Group DOES NOT HAVE posix ACCESS to execute (run the new file) or

1 (Group HAS posix ACCESS to the new folder)

Default: 0


OtherRead (Optional)

0 (Others DO NOT have posix READ access to the new folder) or

1 (Others HAVE posix READ access to the new folder)

Default: 0

OtherWrite (Optional)

0 (Others DO NOT have posix WRITE access to the new file) or

1 (Others HAVE posix WRITE access to the new file)

Default: 0


OtherExec (Optional)

0 (Others DO NOT HAVE posix ACCESS to execute (run) the new file) or

1 (Others HAVE posix ACCESS to execute (run) the new file)

Default: 0


Path

The name of the existing folder within the Nexfs filesystem for the new file to be created within, or / to create at the start (root) of the Nexfs filesystem


Request Body

The request does not have a request body.


Response Syntax


HTTP1/1 200

<?xml version="1.0" encoding="UTF-8"?>

<RequestCompleted>

<Code>string</Code>

<Message>string</Message>

<Resource>string</Resource>

<RequestId>integer</RequestId>

</RequestCompleted>


Response Elements

If the action is successful, the service sends back an HTTP 200 response.


The following data is returned in XML format by the service:

RequestCompleted

Root Level tag for the successful Revoke Session response


Code

OK


Message

Request Completed


Resource

/nexfsconsoleapi

RequestId

A requestid number that identifies the request made against the management api


Errors

Also See Rest Error Responses


400 BadRequest The request was Malformed

A BadRequest is returned if RequestJSON missing from the request


400 BadRequest The request was Malformed

A BadRequest is returned if the RequestJSON format is invalid


400 BadRequest <POSIX MESSAGE>

An error occurred while preforming the request, examples: file exists, user does not exist, group does not exist etc


401 Unauthorized The request cannot be authenticated


403 Forbidden Session does not have the rights to perform the requested action


500 InternalServerError An Internal Error was encountered

Example Request


GET http://nexfsdemo:9200/nexfsconsoleapi?Action=CreateFile&RequestJSON={%20%22Files%22:%20[%20{%20%22Name%22:%20%22newfile%22,%22Size%22:%200,%22ChunkSize%22:%201024000,%22Owner%22:%20%22paul%22,%22Group%22:%20%22staff%22,%22OwnerRead%22:%201,%22OwnerWrite%22:%201,%22OwnerExec%22:%201,%22GroupRead%22:%201,%22GroupWrite%22:%201,%22GroupExec%22:%201,%22OtherRead%22:%201,%22OtherWrite%22:%201,%22OtherExec%22:%201,%22Path%22:%20%22/%22%20}%20]%20}

Authorization: AWS4-HMAC-SHA256 Credential=2d5fc148ba1448cfa60c0960f4452fb0/20220829/nexfs/nexfsconsoleapi/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=6b3309ac422e67b9d3857f4d2a823ab90aaf88f3b1f4972f570f0ceb62caa9f6

host: nexfs.example.com

x-amz-date: 20220829T122132Z


Example Response


<?xml version="1.0" encoding="UTF-8"?>

<RequestCompleted>

<Code>Ok</Code>

<Message>Request Completed</Message>

<Resource>/nexfsconsoleapi</Resource>

<RequestId>87</RequestId>

</RequestCompleted>