Adding a Field to an Object Instance
Function
This API is used to add required fields to custom object instances.
URI
POST Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object/{object_id}/Field
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Object_id |
Yes |
String |
Explanation Object instance ID, which can be queried by calling the API of Querying All Custom Objects (id in the response message). Constraints None Value None Default value None |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Explanation Name of the new field. Constraints The value cannot be changed after being specified. Value The value must start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_) and can contain a maximum of 63 characters. Default value None |
label |
Yes |
String |
Explanation Label of the new field. Constraints None Value 1–80 characters Default value None |
inlineHelpText |
No |
String |
Explanation Description of the new field. Constraints None Value 1–255 characters Default value None |
dataLength |
Yes |
Int |
Explanation Length of new fields. Constraints None Value 1–64 characters Default value None |
dataType |
Yes |
String |
Explanation Type of the new field. Constraints The value cannot be changed after being specified. Value
Default value None |
description |
No |
String |
Explanation Description of the new field. Constraints None Value 1–80 characters Default value None |
defaultValue |
No |
String |
Explanation Default value of the new field. Constraints The format must comply with the rules of the type configured in the field type (dataType). Value None Default value None |
caseSensitive |
No |
Boolean |
Explanation Whether the value is case sensitive. For example, If ABC and abc are considered equal, the setting is case insensitive. If they are treated as different, the setting is case sensitive. Constraints None Value
Default value false |
isRequired |
No |
Boolean |
Explanation Whether the field is mandatory. Constraints None Value
Default value false |
isUnique |
No |
Boolean |
Explanation Whether duplicate data is allowed in a field. Constraints None Value
Default value false |
profiles |
No |
Array |
Explanation Profiles assigned. Constraints None |
layouts |
No |
Array |
Explanation Layout name of the field. Constraints None |
view |
No |
Object |
Explanation Each item is a string array. The name is the layout of the field, and the content is the fields contained in the layout. Constraints None |
isSearchable |
No |
Boolean |
Explanation Whether the search statement can be used to search for the field. Constraints None Value
Default value false |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
resCode |
String |
Explanation Return code. Value If the request is successful, 0 is returned. For details about other error codes, see Error Codes. |
resMsg |
String |
Explanation Message returned. Value If the request is successful, Success is returned. In other cases, an error message is returned. |
result |
string |
Explanation If the request is successful, an ID is returned. Value None |
Example Request
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/metadata/v1.0/Object/cust000000aKoa6I4E6K/Field
{
"label":"test",
"name":"CNAME1__test__CST",
"inlineHelpText":"dsf",
"description":"fsdf",
"dataType":"text",
"dataLength":255,
"defaultValue":"vfdsg",
"caseSensitive":true,
"isRequired":true,
"isUnique":true,
"isSearchable":true,
"profiles":[
{
"profile":"000T0000000000000002",
"readable":true,
"editable":true
},
{
"profile":"000T0000000000000003",
"readable":true,
"editable":true
},
{
"profile":"000T0000000000000004",
"readable":true,
"editable":true
},
{
"profile":"000T0000000000000006",
"readable":true,
"editable":true
},
{
"profile":"000T000000Tiq6fUQhjK",
"readable":true,
"editable":true
},
{
"profile":"000T000000Tiq6lJCs2y",
"readable":true,
"editable":true
},
{
"profile":"000T000000W1a8iTFglU",
"readable":true,
"editable":true
}
],
"layouts":[
"000D000000aKoa6OJOxk"
],
"view":{
"000D000000aKoa6OJOxk":{
"fields":[
"name",
"test__df__CST",
"test__sdadsd__CST",
"test__sdd__CST"
]
}
}
}
Example Response
{
"resCode":"0",
"resMsg": "Success",
"result":"cust000000iY8i3Jvyng"
}
Status Code
See Status Codes.
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot