Creating a Partition

Function

This interface is used to create a partition.

Syntax

Operation type: POST

URL: https://device_ip/redfish/v1/Systems/Partitions

Request header:

X-Auth-Token: auth_value

Request message body:

{
    "Number": number,
    "CapacityBytes": capacity,
    "Links": [{
        "Device": {
            "@odata.id": device
        }
    }],
    "FileSystem": filesystem
}

Request Parameters

Table 1 Request parameters

Parameter

Mandatory/Optional

Description

Value

Number

Mandatory

Number of partitions.

The value is a number. A drive supports a maximum of 16 partitions (including system partitions).

CapacityBytes

Mandatory

Capacity.

NOTE:

The partition unit is 2 MB. If the partition capacity is not a multiple of 2 MB, the value is aligned upwards.

The value is a string of numbers in GB. The minimum value is 0.5, and a maximum of one decimal place is allowed. The value must be an integer multiple of 0.5.

Links

Mandatory

Object.

Partition link information, which can contain only one element.

Links.Device

Mandatory

Object.

Device information of a partition. The value can contain only @odata.id.

Links.Device.@odata.id

Mandatory

Device path.

Device resource path. The value is a string of a maximum of 256 characters, including only uppercase letters, lowercase letters, digits, underscores (_), and hyphens (-). The value starts with /dev/ and does not contain two consecutive periods (..).

FileSystem

Mandatory

File system.

ext4

Usage Guidelines

The API is developed by default. The function is adapted based on the external storage configuration.

Example

Request:

POST https://10.10.10.10/redfish/v1/Systems/Partitions

Request header:

X-Auth-Token: auth_value

Request message body:

{
    "Number": 1,
    "CapacityBytes": "0.5",
    "Links": [{
        "Device": {
            "@odata.id": "/dev/mdisk0"
        }
    }],
    "FileSystem": "ext4"
}

Response:

{
    "error": {
        "code": "Base.1.0.Success",
        "message": "Operation success. See ExtendedInfo for more information.",
        "@Message.ExtendedInfo": [
            {
                "@odata.type": "#MessageRegistry.v1_0_0.MessageRegistry",
                "Description": "Indicates that no error has occurred.",
                "Message": "Create system partition successfully.",
                "Severity": "OK",
                "NumberOfArgs": null,
                "ParamTypes": null,
                "Resolution": "None"
            }
        ]
    }
}

Response code: 202

Output Description

Table 2 Operation output description

Field

Type

Description

code

String

A string indicating the specific message ID in the message registry.

message

String

A readable message corresponding to a message in the message registry.

@odata.type

String

OData description of a message resource.

Description

String

Detailed description of a message resource.

Message

String

Detailed information about a message resource.

Severity

String

Severity. The following severity levels are supported:

  • OK
  • Warning
  • Critical

NumberOfArgs

Number

Number of parameters in a message description.

ParamTypes

Array

Parameter type list.

Resolution

String

Event handling suggestions.