update network.md
Update Network
Infra API · Networks
PATCH https://app.mk.io/api/v1/projects/{project_name}/infra/networks/{name}
Update a network. To learn more about networks, read Network Concept.
RBAC Capability Required: infra.network.update
Authentication
Authorizationheader — Bearer authentication of the formBearer <token>.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
project_name |
string | Yes | — |
name |
string | Yes | — |
Request body
Content type: application/json
metadata· object · Optional — Resource metadata.displayName· string · Optional · 1-255 characters — A human-readable name for the resource.labels· map from strings to string · Optional — A dictionary of labels associated with the resource. Maximum number of labels: 32. Maximum length of a label or value: 256 characters. Label: alphanumeric, hyphens and underscores. Value: alphanumeric, hyphens, underscores and spaces.[any key]· string — map of additional properties
spec· object · Optional — Network specification.
Example request
curl -X PATCH "https://app.mk.io/api/v1/projects/{project_name}/infra/networks/{name}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"displayName": "string",
"labels": {
"key": "string"
}
},
"spec": {}
}'
Responses
200 — The updated network
kind· string · Required — The kind of record.metadata· object · Required — Network metadata.created· string · Optional · format: date-time — The time when the resource was createdcreatedBy· string · Optional · format: uuid — ID of the user who created the resourcecreatedByEmail· string · Optional — Email of the user who created the resourcedisplayName· string · Optional — The display name of the resourceid· string · Required · format: uuid — The ID of the resourcelabels· map from strings to string · Optional — A dictionary of labels associated with the resource[any key]· string — map of additional properties
name· string · Optional — The name of the resourceupdated· string · Optional · format: date-time — The time when the resource was last updatedupdatedBy· string · Optional · format: uuid — ID of the user who last updated the resourceupdatedByEmail· string · Optional — Email of the user who last updated the resource
spec· object · Required — Network specification.status· object · Required — Network status.owner· enum · Required — Indicates whether the network was automatically created by the system. System owned networks cannot be deleted, but they can be modified. To learn more, read System owned networks.- Allowed values:
User,System
- Allowed values:
scope· enum · Required — Indicates whether the network is a local network within a site. Local networks are always system owned and therefore cannot be deleted, however they can be modified.- Allowed values:
Connecting,Local
- Allowed values:
Example:
{
"kind": "string",
"metadata": {
"created": "2024-01-01T00:00:00Z",
"createdBy": "00000000-0000-0000-0000-000000000000",
"createdByEmail": "string",
"displayName": "string",
"id": "00000000-0000-0000-0000-000000000000",
"labels": {
"label1": "value1",
"label2": "value2"
},
"name": "string",
"updated": "2024-01-01T00:00:00Z",
"updatedBy": "00000000-0000-0000-0000-000000000000",
"updatedByEmail": "string"
},
"spec": {},
"status": {
"owner": "User",
"scope": "Connecting"
}
}
400 — Bad Request
error· object · Required — Pertinent information about the errorcode· string · Required — The error code.detail· string · Required — The error message.extraDetail· map from strings to any · Optional — Extra information regarding this error.[any key]· any — map of additional properties
ref· string · Required — A reference to the request that caused the error.status· integer · Required — The HTTP status code
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
401 — Unauthorized
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
403 — Forbidden
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
404 — Not Found
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
429 — Too Many Requests
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}
500 — Internal Server Error
Example:
{
"error": {
"code": "string",
"detail": "string",
"extraDetail": {
"key": null
}
},
"ref": "string",
"status": 0
}