Baidu AI Cloud
中国站

百度智能云

Cloud File Storage

CFS Open API

File System

CreateFileSystem

Description

  • Create a cfs file system and return the assigned instance ID.
  • The payment method is postpaid.

Request

Request structure

POST /v{version}/cfs HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string

{
    "fsName": name,
    "type": type,
    "protocol": protocol
}

Request header

There are no other special headers except the public headers.

Request parameter

Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1)
clientToken String Yes Query parameter Idempotent Token, see clientToken for details
fsName String Yes RequestBody parameter The name of the FileSystem, easy to remember. It is 1-65 bytes in length beginning with a letter. It can contain letters, numbers and characters of -_/.
type String No RequestBody parameter The types of File System: 1.cap (Performance type), default performance type
protocol String No RequestBody parameter The types of protocol: 1.nfs 2.smb, nfs protocol by default

Response

Return status code

Return 200 for success, and error code for failure.

Return header

There are no other special headers except the public headers.

Return parameter

Parameter name Type Description
fsId String FileSystem ID. Subsequent operations on this instance need to carry this ID in the request

Example

Request:

POST /v1/cfs HTTP/1.1
HOST cfs.bj.agilecloud.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
{
    "fsName":"cfs-for-test"
}

Response:

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
{
	"fsId":"cfs-jVDkWrBBoj"
}

UpdateFileSystem

Description

Update the configuration information of a filesystem.

Request

Request structure

PUT /v{version}/cfs/{fsId} HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string
{
    "fsName": name
}

Request header

There are no other special headers except the public headers.

Request parameter

Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1)
fsId String Yes URL parameter ID of the FileSystem to update
fsName String No RequestBody parameter The name of the FileSystem, easy to remember. It is 1-65 bytes in length beginning with a letter. It can contain letters, numbers and characters of -_/..

Response

Return status code

Return 200 for success, and error code for failure.

Return header

There are no other special headers except the public headers.

Return parameter

None

Example

Request:

PUT /v1/cfs/cfs-jVDkWrBBoj HTTP/1.1
HOST cfs.bj.agilecloud.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
{
    "fsName":"cfs-for-test"
}

Response:

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS

DescribeFileSystem

Description

  • Query all FileSystem information under the user account.
  • Support query by fsId or userId,; matching rules support partial inclusion.
  • The return result is the intersection of multiple query conditions.
  • The result supports marker paging. The default paging size is 1,000, and can be specified by the maxKeys parameter.

Request

Request structure

GET /v{version}/cfs?fsId={fsId}&userId={userId}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string

Request header

There are no other special headers except the public headers.

Request parameter

Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1)
userId String No Query parameter User ID of the file system to query
fsId String No Query parameter FileSystem ID to query
marker String No Query parameter The starting location of query for batch acquisition of lists, and is one string generated by the system.
maxKeys int No Query parameter Maximum number contained in each page, generally not exceeding 1000. The default value is 1000.

Response

Return status code

Return 200 for success, and error code for failure.

Return header

There are no other special headers except the public headers.

Return parameter

Parameter name Type Description
FileSystemList List< FileSystemModel> List containing query results
marker string Mark the starting position of the query. The item does not exist if the result list is empty
isTruncated boolean True means there are additional data in the following pages and false means the current page is the last page.
nextMarker String The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false.
maxKeys int Number of results per page

Example

Request:

GET /v1/cfs?fsId=cfs-jVDkWrBBoj&maxKeys=2 HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02

Response

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS

{
    "FileSystemList": [
        {
            "fsId": "cfs-jVDkWrBBoj",
            "status": available,
            "name": "test-cfs",
			"type": "cap",
			"protocol": "nfs",
            "vpcId":"vpc-a3ashy00skpu",
            "MountTargetList": [
				{
            		"domain": "cfs-jVDkWrBBoj-jowjsoosdkwe.bce.qa.sandbox.baidu.com",
            		"subnetId": "sbn-qwkkxpvenm0z",
					"mountId": "70445147635732514f306c5a466a38394450385a37513d3e",
                    "ovip": "128.0.0.1"
        		}
			]
        },
    ],
	"marker": "cfs-jVDkWrBBoj",
    "isTruncated": false,
    "maxKeys": 1
}

DropFileSystem

Description

  • Release the specified FileSystem. The released FileSystem will be deleted forever and cannot be retrieved if its recovery time is exceeded.

Request

Request structure

DELETE /v{version}/cfs/{fsId} HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string

Request header

There are no other special headers except the public headers.

Request parameter

Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1)
fsId String Yes URL parameter ID of the FileSystem to release

Response

Return status code

Return 200 for success, and error code for failure

Return header

There are no other special headers except the public headers.

Return parameter

None

Example

Request:

DELETE /v1/cfs/cfs-jVDkWrBBoj HTTP/1.1
HOST cfs.bj.agilecloud.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02

Response:

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS

Mount Target

CreateMountTarget

Description

  • Create the mount target for a file system and return the domain.
  • The payment method is postpaid.

Request

Request structure

POST /v{version}/cfs/{fsId} HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string
{
    "subnetId": subnetId
}

Request header

There are no other special headers except the public headers.

Request parameter

Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1).
fsId String Yes URL parameter FileSystem ID of MountTarget to create.
subnetId String Yes RequestBody parameter The subnet to which MountTarget belongs. The subnet belongs to the vpc where the fs is located. It is a short id.
vpcId String Yes RequestBody parameter Short ID of the VPC to which the fs instance vip belongs.

Response

Return status code

Return 200 for success, and error code for failure.

Return header

There are no other special headers except the public headers.

Return parameter

Parameter name Type Description
domain String The assigned service dns, through which the file system mount is performed, and the service can be accessed.
mountId String Mount target ID.

Example

Request:

POST /v1/cfs/cfs-jVDkWrBBoj HTTP/1.1
HOST cfs.bj.agilecloud.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02

{
    "subnetId":"sbn-qwkkxpvenm0z"
}

Response:

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
{
	"mountId" : "53585364776c6d577a2f424444796a2b6641584251773d3d"
	"domain":"cfs-jVDkWrBBoj-sdfoijnvsdf.bce.qa.sandbox.baidu.com"
}

DeleteMountTarget

Description

  • Release the MountTarget of the specified FileSystem.

Request

Request structure

DELETE /v{version}/cfs/{fsId}/{mountId} HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string

Request header

There are no other special headers except the public headers.

Request parameter Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1).
fsId String Yes URL parameter FileSystem ID of the target to release.
mountId String Yes URL parameter Target ID to release.

Response

Return status code

Return 200 for success, and error code for failure

Return header

There are no other special headers except the public headers.

Return parameter

None

Example

Request:

DELETE /v1/cfs/cfs-jVDkWrBBoj/53585364776c6d577a2f424444796a2b6641584251773d3d HTTP/1.1
HOST cfs.bj.agilecloud.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02

Response:

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS

DescribeMountTarget

Description

  • Query all MountTarget information under the specified file system.
  • The return result is the intersection of multiple query conditions.
  • The result supports marker paging. The default paging size is 1,000, and can be specified by the maxKeys parameter.

Request

Request structure

GET /v{version}/cfs/{fId}?&mountId={mountId}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: authorization string

Request header

There are no other special headers except the public headers.

Request parameter

Parameter name Type Required or not Parameter position Description
version String Yes URL parameter API version number (the current value is 1).
fsId String Yes URL parameter FileSystem ID to query
mountId String No Query parameter The ID of the MountTarget to query.
marker String No Query parameter The starting location of query for batch acquisition of lists, and is one string generated by the system.
maxKeys int No Query parameter Maximum number contained in each page, generally not exceeding 1000. The default value is 1000.

Response

Return status code

Return 200 for success, and Error Code for failure.

Return header

There are no other special headers except the public headers.

Return parameter

Parameter name Type Description
MountTargetList List< MountTargetModel> List containing query results.
marker string Mark the starting position of the query. The item does not exist if the result list is empty.
isTruncated boolean True means there are additional data in the following pages and false means the current page is the last page.
nextMarker String The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false.
maxKeys int Maximum number contained in each page.

Example

Request:

GET /v1/cfs/cfs-jVDkWrBBoj?maxKeys=100 HTTP/1.1
Host: cfs.bj.agilecloud.com
Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02

Response:

HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS

{
    "MountTargetList": [
        {
            "domain": "cfs-jVDkWrBBoj-xsjkusdgffes.bce.qa.sandbox.baidu.com",
            "subnetId": "sbn-qwkkxpvenm0z"
			"mountId": "53585364776c6d577a2f424444796a2b6641584251773d3d",
            "ovip": "128.0.0.1"
        },
        {
            "domain": "cfs-jVDkWrBBoj-kweicskdgsev.bce.qa.sandbox.baidu.com",
            "subnetId": "sbn-keisnlekndsw"
			"mountId": "36684e635250353569345454684e76364c36457057513d3d",
            "ovip": "128.0.0.1"
        }
    ],
    "marker": "kweicskdgsev",
    "nextMarker": "kweicskdgsev",
    "isTruncated": false,
    "maxKeys": 2
}
Previous
Service Domain Name
Next
Model Object Definition