Farms - Create Or Update
在特定参与方下创建或更新场资源。
PATCH {endpoint}/parties/{partyId}/farms/{farmId}?api-version=2023-11-01-preview
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
命名空间的主机名,例如 admaInstanceName.farmbeats.azure.net |
|
farm
|
path | True |
string |
场资源的 ID。 |
|
party
|
path | True |
string |
关联的参与方资源的 ID。 |
|
api-version
|
query | True |
string |
请求的 API 版本 |
请求头
Media Types: "application/merge-patch+json"
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| Authorization | True |
string |
请为授权的 API 调用提供有效的持有者令牌。 请注意,如果之前尝试了未经身份验证的调用,可能需要清除浏览器缓存。 |
请求正文
Media Types: "application/merge-patch+json"
| 名称 | 类型 | 说明 |
|---|---|---|
| description |
string minLength: 0maxLength: 500 |
资源的文本说明。 |
| name |
string minLength: 0maxLength: 100 |
用于标识资源的名称。 |
| properties |
属于资源的键值对的集合。 每对不能具有大于 50 个字符的键,并且不能具有大于 150 个字符的值。 注意:最多可以为资源提供 25 个键值对,仅支持字符串、数字和日期/时间(yyyy-MM-ddTHH:mm:ssZ) 值。 |
|
| source |
string minLength: 2maxLength: 100 |
资源的源。 |
| status |
string minLength: 0maxLength: 100 |
资源的状态。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
成功 |
|
| 201 Created |
创建 |
|
| Other Status Codes |
错误 标头 x-ms-error-code: string |
安全性
Authorization
请为授权的 API 调用提供有效的持有者令牌。 请注意,如果之前尝试了未经身份验证的调用,可能需要清除浏览器缓存。
类型:
apiKey
在:
header
示例
Farms_CreateOrUpdate
示例请求
PATCH {endpoint}/parties/PARTY123/farms/FARM123?api-version=2023-11-01-preview
{
"status": "Active",
"name": "John Smith's Farm",
"description": "Some description",
"source": "source",
"properties": {
"Irrigated": "Yes",
"RetailerId": "Retailer123"
}
}
示例响应
{
"id": "FARM123",
"partyId": "PARTY123",
"name": "John Smith's Farm",
"status": "Active",
"description": "Some description",
"source": "source",
"properties": {
"Irrigated": "Yes",
"RetailerId": "Retailer123"
},
"createdDateTime": "2021-04-21T06:49:30Z",
"modifiedDateTime": "2021-04-21T06:49:30Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"modifiedBy": "00000000-0000-0000-0000-000000000000",
"eTag": "0f8fad5b-d9cb-469f-a165-70867728950e"
}
{
"id": "FARM123",
"partyId": "PARTY123",
"name": "John Smith's Farm",
"status": "Active",
"description": "Some description",
"source": "source",
"properties": {
"Irrigated": "Yes",
"RetailerId": "Retailer123"
},
"createdDateTime": "2021-04-21T06:49:30Z",
"modifiedDateTime": "2021-04-21T06:49:30Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"modifiedBy": "00000000-0000-0000-0000-000000000000",
"eTag": "0f8fad5b-d9cb-469f-a165-70867728950e"
}
定义
| 名称 | 说明 |
|---|---|
| Error |
Azure AgPlatform 服务中的错误。 |
|
Error |
Azure AgPlatform 服务的错误响应。 请参阅 errorResponse 参考文档 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。 |
| Farm |
场资源的架构。 |
|
Inner |
包含错误列表的内部错误。请参阅 innerError 参考文档 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object。 |
Error
Azure AgPlatform 服务中的错误。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string minLength: 1 |
服务器定义的错误代码集。 |
| details |
Error[] |
导致此报告错误的特定错误的详细信息数组。 |
| innererror |
包含错误列表的内部错误。请参阅 innerError 参考文档 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object。 |
|
| message |
string minLength: 1 |
错误的人工可读表示形式。 |
| target |
string |
错误的目标。 |
ErrorResponse
Azure AgPlatform 服务的错误响应。 请参阅 errorResponse 参考文档 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
Azure AgPlatform 服务中的错误。 |
|
| traceId |
string |
唯一跟踪 ID。 |
Farm
场资源的架构。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdBy |
string |
由用户/租户 ID 创建。 |
| createdDateTime |
string (date-time) |
创建资源的日期时间,示例格式:yyyy-MM-ddTHH:mm:ssZ。 |
| description |
string minLength: 0maxLength: 500 |
资源的文本说明。 |
| eTag |
string |
实现乐观并发的 ETag 值。 |
| id |
string |
唯一的资源 ID。 |
| modifiedBy |
string |
由用户/租户 ID 修改。 |
| modifiedDateTime |
string (date-time) |
上次修改资源的日期时间,示例格式:yyyy-MM-ddTHH:mm:ssZ。 |
| name |
string minLength: 0maxLength: 100 |
用于标识资源的名称。 |
| partyId |
string |
群 ID。 |
| properties |
属于资源的键值对的集合。 每对不能具有大于 50 个字符的键,并且不能具有大于 150 个字符的值。 注意:最多可以为资源提供 25 个键值对,仅支持字符串、数字和日期/时间(yyyy-MM-ddTHH:mm:ssZ) 值。 |
|
| source |
string minLength: 2maxLength: 100 |
资源的源。 |
| status |
string minLength: 0maxLength: 100 |
资源的状态。 |
InnerError
包含错误列表的内部错误。请参阅 innerError 参考文档 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
包含的错误提供的特定错误代码。 |
| innererror |
包含错误列表的内部错误。请参阅 innerError 参考文档 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object。 |